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$
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classInner class which derives from the PNGTranscoder and calls the manipulateSVGDocument just before encoding happens. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringError 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 StringThe userLanguage for which the document should be tested.protected booleanControls whether or not the SVG file should be validated.static final StringValidating parser class nameFields inherited from class 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, variationURLsFields inherited from class AbstractTest
id, name, parent -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFor subclassesSVGRenderingAccuracyTest(String svgURL, String refImgURL) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionencode(URL srcURL, FileOutputStream fos) Returns theImageTranscoderthe Test should usebooleanprotected DocumentTemplate method which subclasses can override if they need to manipulate the DOM in some way before running the accuracy test.voidsetUserLanguage(String userLanguage) Sets the userLanguagevoidsetValidating(Boolean validate) If true, this test will use validationMethods inherited from class AbstractRenderingAccuracyTest
addVariationURL, buildDiffImage, compare, getCandidateReference, getImage, getImage, getName, getNextTempFileName, getNextTempFileName, getSaveVariation, getTempDirectory, getURLFile, getVariationURLs, imageToFile, makeCompareImage, makeRandomFileName, makeTempFileName, resolveURL, run, saveImage, saveImage, setCandidateReference, setConfig, setSaveVariationMethods inherited from class 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
-
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
-
encode
- Specified by:
encodein classAbstractRenderingAccuracyTest
-
getTestImageTranscoder
Returns theImageTranscoderthe Test should use
-