Package org.apache.batik.test.svg
Class SVGRenderingAccuracyTest
java.lang.Object
org.apache.batik.test.AbstractTest
org.apache.batik.test.svg.AbstractRenderingAccuracyTest
org.apache.batik.test.svg.SVGRenderingAccuracyTest
- All Implemented Interfaces:
Test
- Direct Known Subclasses:
PreconfiguredRenderingTest
Checks for regressions in rendering a specific SVG document.
The
Test
will rasterize and SVG document and
compare it to a reference image. The test passes if the
rasterized SVG and the reference image match exactly (i.e.,
all pixel values are the same).- Version:
- $Id: SVGRenderingAccuracyTest.java 1804130 2017-08-04 14:41:11Z ssteiner $
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
Inner class which derives from the PNGTranscoder and calls the manipulateSVGDocument just before encoding happens. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Error when transcoding the SVG document generates an error {0} = URI of the transcoded SVG file {1} = Exception class {2} = Exception message {3} = Stack trace.protected String
The userLanguage for which the document should be tested.protected boolean
Controls whether or not the SVG file should be validated.static final String
Validating parser class nameFields inherited from class org.apache.batik.test.svg.AbstractRenderingAccuracyTest
candidateReference, configuration, CONFIGURATION_RESOURCES, COULD_NOT_GENERATE_COMPARISON_IMAGES, COULD_NOT_LOAD_IMAGE, COULD_NOT_OPEN_VARIATION_URL, ENTRY_KEY_DIFFERENCE_IMAGE, ENTRY_KEY_ERROR_DESCRIPTION, ENTRY_KEY_INTERNAL_ERROR, ENTRY_KEY_REFERENCE_GENERATED_IMAGE_URI, ERROR_CANNOT_CREATE_TEMP_FILE, ERROR_CANNOT_CREATE_TEMP_FILE_STREAM, ERROR_CANNOT_OPEN_GENERATED_IMAGE, ERROR_CANNOT_OPEN_REFERENCE_IMAGE, ERROR_ERROR_WHILE_COMPARING_FILES, ERROR_SVG_RENDERING_NOT_ACCURATE, IMAGE_FILE_EXTENSION, IMAGE_TYPE_COMPARISON, IMAGE_TYPE_DIFF, refImgURL, saveVariation, svgURL, TEMP_FILE_PREFIX, TEMP_FILE_SUFFIX, tempDirectory, variationURLs
Fields inherited from class org.apache.batik.test.AbstractTest
id, name, parent
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
For subclassesSVGRenderingAccuracyTest
(String svgURL, String refImgURL) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionencode
(URL srcURL, FileOutputStream fos) Returns theImageTranscoder
the Test should useboolean
protected Document
Template method which subclasses can override if they need to manipulate the DOM in some way before running the accuracy test.void
setUserLanguage
(String userLanguage) Sets the userLanguagevoid
setValidating
(Boolean validate) If true, this test will use validationMethods inherited from class org.apache.batik.test.svg.AbstractRenderingAccuracyTest
addVariationURL, buildDiffImage, compare, getCandidateReference, getImage, getImage, getName, getNextTempFileName, getNextTempFileName, getSaveVariation, getTempDirectory, getURLFile, getVariationURLs, imageToFile, makeCompareImage, makeRandomFileName, makeTempFileName, resolveURL, run, saveImage, saveImage, setCandidateReference, setConfig, setSaveVariation
Methods inherited from class org.apache.batik.test.AbstractTest
assertEquals, assertEquals, assertNull, assertTrue, error, getId, getParent, getQualifiedId, reportError, reportException, reportSuccess, runImpl, runImplBasic, setId, setName, setParent
-
Field Details
-
ERROR_CANNOT_TRANSCODE_SVG
Error when transcoding the SVG document generates an error {0} = URI of the transcoded SVG file {1} = Exception class {2} = Exception message {3} = Stack trace.- See Also:
-
VALIDATING_PARSER
Validating parser class name -
validate
protected boolean validateControls whether or not the SVG file should be validated. By default, no validation is used. -
userLanguage
The userLanguage for which the document should be tested.
-
-
Constructor Details
-
SVGRenderingAccuracyTest
Constructor.- Parameters:
svgURL
- the URL String for the SVG document being tested.refImgURL
- the URL for the reference image.
-
SVGRenderingAccuracyTest
protected SVGRenderingAccuracyTest()For subclasses
-
-
Method Details
-
setValidating
If true, this test will use validation -
getValidating
public boolean getValidating() -
setUserLanguage
Sets the userLanguage -
getUserLanguage
-
manipulateSVGDocument
Template method which subclasses can override if they need to manipulate the DOM in some way before running the accuracy test. For example, this can be useful to test the alternate stylesheet support. -
encode
- Specified by:
encode
in classAbstractRenderingAccuracyTest
-
getTestImageTranscoder
Returns theImageTranscoder
the Test should use
-