Package diva.util.java2d.test.junit
Class Polygon2DJUnitTest
- java.lang.Object
-
- diva.util.java2d.test.junit.Polygon2DJUnitTest
-
public class Polygon2DJUnitTest extends java.lang.Object
Test out diva.util.java2d.Polygon2D class.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Christopher Brooks
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (cxh)
-
-
Field Summary
Fields Modifier and Type Field Description Polygon2D.Double
unitDiamond
A 1.0 x 1.0 diamond centered on 0.0, 0.0.Polygon2D.Double
unitSquare
A 1.0 x 1.0 square with a corner at 0.0, 0.0.Polygon2D.Double
unitSquareCentered
A 1.0 x 1.0 square centered at 0.0, 0.0.
-
Constructor Summary
Constructors Constructor Description Polygon2DJUnitTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
before()
static void
main(java.lang.String[] args)
Test the diva.util.java2d.Polygon2D classvoid
unitDiamond()
Instantiate a 1x1 diamond with a centered on 0.0, 0.0.void
unitDiamondContains()
Test Polygon2D.contains() on a unit diamond centered on 0.0.void
unitDiamondContains2()
Corner case that fails in old implementation of contains().void
unitSquare()
Instantiate a 1x1 square with a corner at 0.0, 0.0.void
unitSquareCentered()
Instantiate a 1x1 square centered at 0.0, 0.0.void
unitSquareCenteredContains()
Test Polygon2D.contains() on a unit square centered at 0.0, 0.0.void
unitSquareCenteredContains1()
Corner case that fails in old implementation of contains().void
unitSquareCenteredContains2()
Corner case that fails in old implementation of contains().void
unitSquareContains()
Test Polygon2D.contains() on a unit square with a corner at 0.0, 0.0.void
unitSquareContains2()
Corner case that fails in old implementation of contains().void
unitSquareContains3()
Corner case that fails in old implementation of contains().void
unitSquareContains4()
Corner case that fails in old implementation of contains().void
unitSquareContains5()
Corner case that fails in old implementation of contains().
-
-
-
Field Detail
-
unitDiamond
public Polygon2D.Double unitDiamond
A 1.0 x 1.0 diamond centered on 0.0, 0.0.
-
unitSquare
public Polygon2D.Double unitSquare
A 1.0 x 1.0 square with a corner at 0.0, 0.0.
-
unitSquareCentered
public Polygon2D.Double unitSquareCentered
A 1.0 x 1.0 square centered at 0.0, 0.0.
-
-
Method Detail
-
before
public void before()
-
unitDiamond
public void unitDiamond()
Instantiate a 1x1 diamond with a centered on 0.0, 0.0.
-
unitSquare
public void unitSquare()
Instantiate a 1x1 square with a corner at 0.0, 0.0.
-
unitSquareCentered
public void unitSquareCentered()
Instantiate a 1x1 square centered at 0.0, 0.0.
-
unitDiamondContains
public void unitDiamondContains() throws java.lang.Exception
Test Polygon2D.contains() on a unit diamond centered on 0.0.- Throws:
java.lang.Exception
-
unitDiamondContains2
public void unitDiamondContains2()
Corner case that fails in old implementation of contains().
-
unitSquareContains
public void unitSquareContains() throws java.lang.Exception
Test Polygon2D.contains() on a unit square with a corner at 0.0, 0.0.- Throws:
java.lang.Exception
-
unitSquareContains2
public void unitSquareContains2()
Corner case that fails in old implementation of contains().
-
unitSquareContains3
public void unitSquareContains3()
Corner case that fails in old implementation of contains().
-
unitSquareContains4
public void unitSquareContains4()
Corner case that fails in old implementation of contains().
-
unitSquareContains5
public void unitSquareContains5()
Corner case that fails in old implementation of contains().
-
unitSquareCenteredContains
public void unitSquareCenteredContains() throws java.lang.Exception
Test Polygon2D.contains() on a unit square centered at 0.0, 0.0.- Throws:
java.lang.Exception
-
unitSquareCenteredContains1
public void unitSquareCenteredContains1()
Corner case that fails in old implementation of contains().
-
unitSquareCenteredContains2
public void unitSquareCenteredContains2()
Corner case that fails in old implementation of contains().
-
main
public static void main(java.lang.String[] args)
Test the diva.util.java2d.Polygon2D classTo run, use:
$PTII/bin/ptinvoke diva.util.java2d.Polygon2DJUnitTest
orjava -classpath $PTII:${PTII}/lib/junit-4.8.2.jar diva.util.java2d.test.junit.Polygon2DJUnitTest
We use ptinvoke so that the classpath is set to include all the packages used by Ptolemy II.- Parameters:
args
- Ignored.
-
-