diva.canvas.test
Class FigureTest

java.lang.Object
  extended by diva.util.jester.TestSuite
      extended by diva.canvas.test.FigureTest

public class FigureTest
extends TestSuite

A test suite for Figure. Since Figure is an interface, this class has no main() method. It defines a factory interface that concrete factories must implement.

Version:
$Id: FigureTest.java 43786 2006-09-21 15:40:15Z cxh $
Author:
John Reekie

Nested Class Summary
static interface FigureTest.FigureFactory
          The figure factory interface
 class FigureTest.RegionTestCase
          Region testing test case.
 
Field Summary
private  FigureTest.FigureFactory factory
          The unit factory
 
Constructor Summary
FigureTest(TestHarness harness, FigureTest.FigureFactory factory)
          Constructor
 
Method Summary
 void runSuite()
          runSuite()
 void testHit()
          Test hit.
 void testIntersects()
          Test intersection.
 void testPaint()
          Test painting.
 void testProperties()
          Perform the simple set/get tests.
 void testTransform()
          Test how transforms affect the figure
 void testTranslate()
          Test how translates affect the figure
 
Methods inherited from class diva.util.jester.TestSuite
getFactory, getTestHarness, run, runAll, runTestCase, setFactory, setTestHarness
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factory

private FigureTest.FigureFactory factory
The unit factory

Constructor Detail

FigureTest

public FigureTest(TestHarness harness,
                  FigureTest.FigureFactory factory)
Constructor

Method Detail

runSuite

public void runSuite()
runSuite()

Specified by:
runSuite in class TestSuite

testProperties

public void testProperties()
Perform the simple set/get tests.


testHit

public void testHit()
Test hit. This doesn't actually do a hit test, but it does check that the passed rectangle is not modified.


testIntersects

public void testIntersects()
Test intersection. This doesn't actually do an intersection test, but it does check that the passed rectangle is not modified.


testPaint

public void testPaint()
Test painting. This method calls both versions of the paint method. It doesn't actually test what the paint method does. In either case, it verifies that the transform context of the Graphics2D is not changed. In the case of the paint method that takes a region, it also verifies that the region is not changed by the call. Note that we transform the figure first as this is sometimes needed to make this bug show up.


testTransform

public void testTransform()
Test how transforms affect the figure


testTranslate

public void testTranslate()
Test how translates affect the figure