| gunit.framework.BaseTestCase
All known Subclasses: gunit.framework.TestCase,
BaseTestCase | abstract public class BaseTestCase extends junit.framework.TestCase (Code) | | BaseTestCase is an abstract class that extends JUnit's
TestCase and contains methods that should run on PBP/PP.
All profile and optional package specific functionality are defined
as abstract methods.
BaseTestCase overrides setUp(), tearDown() and runTest()
methods from the base class to provide gunit's Testcase behavioir.
|
Method Summary | |
final protected void | assertImageEquals() | final protected void | assertImageEquals(Object expected, Object actual) Assertion method for image equal operation. | abstract protected void | assertImageEquals(String message, Object expected, Object actual) | abstract protected void | clearToBackgroundColor(Graphics g, Color c, int x, int y, int w, int h) | abstract protected BufferedImage | createBufferedImage(int width, int height) | protected Container | createContainer() | abstract protected void | encodeImage(BufferedImage image, String filename) | final protected String[] | getArguments() Returns the arguments for the testcase. | final protected Container | getContainer() | final protected Graphics | getGraphics() Returns a Graphics for the graphics testcase to
render. | static String[] | getRefImageDirs(String path) | final protected Object | getReferenceImage() Returns the reference image for the testcase. | final protected Object | getReferenceImage(String fileName) | final protected String | getReferenceImageFilename() | final protected Object | getTestImage() | final protected Image | loadImage(String imageFile) | final protected Image | loadImage(URL url) | protected void | runTest() | protected void | setUp() | protected void | tearDown() | static Image | trackImage(Image img) | static Image | trackImage(Image img, Component comp) | protected boolean | useBackBuffer() Indicates if a back buffer should be used to render the testcase
graphics operations. |
isAsserted | protected boolean isAsserted(Code) | | Indicates if the testcase asserted using any of the assert
functions provided by gunit.
|
testArgs | static TestArguments testArgs(Code) | | |
assertImageEquals | final protected void assertImageEquals()(Code) | | A convenience method that does
assertImageEquals(getReferenceImage(),getTestImage())
|
assertImageEquals | final protected void assertImageEquals(Object expected, Object actual)(Code) | | Assertion method for image equal operation.
Parameters: expected - the value returned from getReferenceImage() Parameters: actual - the value returned from getTestImage() |
assertImageEquals | abstract protected void assertImageEquals(String message, Object expected, Object actual)(Code) | | Ensures that the assertion is valid
Parameters: message - message for the failure case. Parameters: expected - the value returned from getReferenceImage() Parameters: actual - the value returned from getTestImage() |
clearToBackgroundColor | abstract protected void clearToBackgroundColor(Graphics g, Color c, int x, int y, int w, int h)(Code) | | Set the background color for the graphics
|
createBufferedImage | abstract protected BufferedImage createBufferedImage(int width, int height)(Code) | | Creates a BufferedImage for the specified width
and height with INT_ARGB format
|
encodeImage | abstract protected void encodeImage(BufferedImage image, String filename)(Code) | | Encode the contents of the BufferedImage with an
image compression format (preferably PNG) onto the file specified
|
getArguments | final protected String[] getArguments()(Code) | | Returns the arguments for the testcase. It returns a zero length
string if there are no arguments for the testcase
|
getContainer | final protected Container getContainer()(Code) | | Returns the container for the testcase to create GUI artifacts
|
getGraphics | final protected Graphics getGraphics()(Code) | | Returns a Graphics for the graphics testcase to
render.
|
getReferenceImage | final protected Object getReferenceImage()(Code) | | Returns the reference image for the testcase.
|
getReferenceImage | final protected Object getReferenceImage(String fileName)(Code) | | Returns the expected image for the fileName relative to the
image directory
Parameters: fileName - file name relative to the image directory |
getReferenceImageFilename | final protected String getReferenceImageFilename()(Code) | | Returns the image file name for the testcase
|
getTestImage | final protected Object getTestImage()(Code) | | Returns the image that contains the testcase rendition
|
loadImage | final protected Image loadImage(String imageFile)(Code) | | An utility method that loads an image from a file
|
loadImage | final protected Image loadImage(URL url)(Code) | | An utility method that loads an image from a URL
|
setUp | protected void setUp()(Code) | | |
tearDown | protected void tearDown()(Code) | | |
useBackBuffer | protected boolean useBackBuffer()(Code) | | Indicates if a back buffer should be used to render the testcase
graphics operations. The default value is true , but
the testcase can override to return false ,so that
screen graphics is used instead of the image buffer
|
|
|