Package diva.util.java2d.test.junit
Class Polygon2DJUnitTest
- java.lang.Object
-
- diva.util.java2d.test.junit.Polygon2DJUnitTest
-
public class Polygon2DJUnitTest extends java.lang.ObjectTest 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.DoubleunitDiamondA 1.0 x 1.0 diamond centered on 0.0, 0.0.Polygon2D.DoubleunitSquareA 1.0 x 1.0 square with a corner at 0.0, 0.0.Polygon2D.DoubleunitSquareCenteredA 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 voidbefore()static voidmain(java.lang.String[] args)Test the diva.util.java2d.Polygon2D classvoidunitDiamond()Instantiate a 1x1 diamond with a centered on 0.0, 0.0.voidunitDiamondContains()Test Polygon2D.contains() on a unit diamond centered on 0.0.voidunitDiamondContains2()Corner case that fails in old implementation of contains().voidunitSquare()Instantiate a 1x1 square with a corner at 0.0, 0.0.voidunitSquareCentered()Instantiate a 1x1 square centered at 0.0, 0.0.voidunitSquareCenteredContains()Test Polygon2D.contains() on a unit square centered at 0.0, 0.0.voidunitSquareCenteredContains1()Corner case that fails in old implementation of contains().voidunitSquareCenteredContains2()Corner case that fails in old implementation of contains().voidunitSquareContains()Test Polygon2D.contains() on a unit square with a corner at 0.0, 0.0.voidunitSquareContains2()Corner case that fails in old implementation of contains().voidunitSquareContains3()Corner case that fails in old implementation of contains().voidunitSquareContains4()Corner case that fails in old implementation of contains().voidunitSquareContains5()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.ExceptionTest 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.ExceptionTest 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.ExceptionTest 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.Polygon2DJUnitTestWe use ptinvoke so that the classpath is set to include all the packages used by Ptolemy II.- Parameters:
args- Ignored.
-
-