Package org.jzy3d.junit
Class ChartTester
java.lang.Object
org.jzy3d.junit.ChartTester
- Direct Known Subclasses:
 NativeChartTester
Primitives for chart tests.
 
 A chart having a screenshot different from the test case image will generate throw a
 ChartTestFailed exception.
- Author:
 - martin
 
- 
Field Summary
Fields - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidassertSimilar(Chart chart, String testImage) voidassertSimilar(IColorMap colormap, String testImage) voidvoidvoidbooleanvoidcompare(BufferedImage actual, BufferedImage expected) Perform the comparison between twoBufferedImage.voidCompare the image displayed by the chart with an image given by filename.voidvoidcompare(AWTColorbarImageGenerator colorbar, String filename) Compare a colorbar image with a reference image given by filename.protected BufferedImagecopy(BufferedImage source) protected voiddoHighlightPixels(BufferedImage expected, IntegerCoord2d diffs, org.jzy3d.junit.ChartTester.Highlight highlight) Invert the pixel color identified by the input coordinates (IntegerCoord2d)voidvoidRun a chart and verify if its screenshot is pixelwise similar to the test case image.voidvoidprotected BufferedImagegetBufferedImage(Chart chart) protected BufferedImagegetBufferedImage(AWTColorbarImageGenerator colorbar) protected BufferedImagegetErroneousArea(BufferedImage expected, List<IntegerCoord2d> diffs) protected AWTColorbarImageGeneratorgetImageGenerator(IColorMap colormap) getTestCaseFileName(String testName) protected voidhighlightPixel(BufferedImage expected, List<IntegerCoord2d> diffs, org.jzy3d.junit.ChartTester.Highlight highlight) Invert the pixel color identified by the input coordinates.protected voidhighlightSize(BufferedImage diffImage, String m) booleanbooleanprotected BufferedImageloadBufferedImage(String filename) voidsetTestCaseInputFolder(String testCaseFolder) voidsetTestCaseOutputFolder(String testCaseOutputFolder) voidsetTextInvisible(boolean textInvisible) voidPerform a chart comparison to image and output multiple diagnostic images in case of failure Expected image Actual image Diff image Zoom imagevoidPerform a chart comparison to image and output multiple diagnostic images in case of failure Expected image Actual image Diff image Zoom image 
- 
Field Details
- 
FILE_LABEL_ACTUAL
- See Also:
 
 - 
FILE_LABEL_EXPECT
- See Also:
 
 - 
FILE_LABEL_DIFF
- See Also:
 
 - 
FILE_LABEL_ZOOM
- See Also:
 
 - 
TEST_IMG_SIZE
public static int TEST_IMG_SIZE - 
textInvisible
protected boolean textInvisible - 
testCaseOutputFolder
 - 
testCaseInputFolder
 - 
MAVEN_TEST_RESOURCES_PATH
- See Also:
 
 - 
MAVEN_TARGET_PATH
- See Also:
 
 - 
colorbarDimension
 - 
WIDTH
protected int WIDTH - 
HEIGHT
protected int HEIGHT 
 - 
 - 
Constructor Details
- 
ChartTester
public ChartTester() 
 - 
 - 
Method Details
- 
assertSimilar
 - 
execute
Run a chart and verify if its screenshot is pixelwise similar to the test case image. If test case image does not exist, build it for the first time. Failure to compare the chart with the test case image will create an imagedata/tests/error-[name].png. This image is always deleted before running a testcase. Calling clean() will delete the test case image.- Parameters:
 chart-testImage-- Throws:
 IOException- if a non chart related error occurs. Actual chart test errors callfail(...)
 - 
execute
- Throws:
 IOException
 - 
clean
 - 
cleanFile
 - 
build
- Throws:
 IOException
 - 
isBuilt
 - 
test
Perform a chart comparison to image and output multiple diagnostic images in case of failure- Expected image
 - Actual image
 - Diff image
 - Zoom image
 
- Parameters:
 chart-testImage-- Throws:
 IOException
 - 
assertSimilar
 - 
execute
- Throws:
 IOException
 - 
execute
- Throws:
 IOException
 - 
build
- Throws:
 IOException
 - 
test
Perform a chart comparison to image and output multiple diagnostic images in case of failure- Expected image
 - Actual image
 - Diff image
 - Zoom image
 
- Parameters:
 chart-testImage-- Throws:
 IOException
 - 
highlightSize
 - 
copy
 - 
highlightPixel
protected void highlightPixel(BufferedImage expected, List<IntegerCoord2d> diffs, org.jzy3d.junit.ChartTester.Highlight highlight) Invert the pixel color identified by the input coordinates. - 
doHighlightPixels
protected void doHighlightPixels(BufferedImage expected, IntegerCoord2d diffs, org.jzy3d.junit.ChartTester.Highlight highlight) Invert the pixel color identified by the input coordinates (IntegerCoord2d) - 
getErroneousArea
 - 
compare
Compare the image displayed by the chart with an image given by filename.- Parameters:
 chart-filename-- Throws:
 IOExceptionChartTestFailed- is thrown if at least one pixel differ. The exception holds all pixel coordinates where a difference exists.
 - 
compare
public void compare(AWTColorbarImageGenerator colorbar, String filename) throws IOException, ChartTestFailed Compare a colorbar image with a reference image given by filename.- Parameters:
 filename-chart-- Throws:
 IOExceptionChartTestFailed- is thrown if at least one pixel differ. The exception holds all pixel coordinates where a difference exists.
 - 
compare
- Throws:
 IOExceptionChartTestFailed
 - 
getImageGenerator
- Throws:
 IOException
 - 
getBufferedImage
- Throws:
 IOException
 - 
getBufferedImage
- Throws:
 IOException
 - 
loadBufferedImage
- Throws:
 IOException
 - 
compare
Perform the comparison between twoBufferedImage.- Parameters:
 actual-expected-- Throws:
 ChartTestFailed- is thrown if at least one pixel differ. The exception holds all pixel coordinates where a difference exists.
 - 
path
 - 
path
 - 
path
 - 
getTestCaseFile
 - 
getTestCaseFileName
 - 
getTestCaseFileName
 - 
getTestCaseFailedFileName
 - 
getTestName
 - 
getTestCanvasType
 - 
getTestCaseInputFolder
 - 
setTestCaseInputFolder
 - 
getTestCaseOutputFolder
 - 
setTestCaseOutputFolder
 - 
isTextInvisible
public boolean isTextInvisible() - 
setTextInvisible
public void setTextInvisible(boolean textInvisible)  
 -