Package org.apache.batik.test.svg
Class SVGReferenceRenderingAccuracyTest
java.lang.Object
org.apache.batik.test.AbstractTest
org.apache.batik.test.svg.AbstractRenderingAccuracyTest
org.apache.batik.test.svg.SVGRenderingAccuracyTest
org.apache.batik.test.svg.PreconfiguredRenderingTest
org.apache.batik.test.svg.SamplesRenderingTest
org.apache.batik.test.svg.ParametrizedRenderingAccuracyTest
org.apache.batik.test.svg.SVGReferenceRenderingAccuracyTest
- All Implemented Interfaces:
Test
Base class for tests which take an additional parameter in addition
to the SVG file.
- Version:
- $Id: SVGReferenceRenderingAccuracyTest.java 1806580 2017-08-29 12:06:44Z ssteiner $
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.batik.test.svg.SVGRenderingAccuracyTest
SVGRenderingAccuracyTest.InternalPNGTranscoder -
Field Summary
FieldsFields inherited from class org.apache.batik.test.svg.ParametrizedRenderingAccuracyTest
parameter, PARAMETER_SEPARATORFields inherited from class org.apache.batik.test.svg.SamplesRenderingTest
REF_IMAGE_PREFIX, REF_IMAGE_SUFFIX, SAVE_CANDIDATE_REFERENCE_PREFIX, SAVE_CANDIDATE_REFERENCE_SUFFIX, SAVE_VARIATION_PREFIX, SAVE_VARIATION_SUFFIX, SVG_URL_PREFIX, VARIATION_PREFIX, VARIATION_SUFFIXFields inherited from class org.apache.batik.test.svg.PreconfiguredRenderingTest
DEFAULT_VARIATION_PLATFORMS, PATH_SEPARATOR, PNG_EXTENSION, SVG_EXTENSION, SVGZ_EXTENSIONFields inherited from class org.apache.batik.test.svg.SVGRenderingAccuracyTest
ERROR_CANNOT_TRANSCODE_SVG, userLanguage, validate, VALIDATING_PARSERFields 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, variationURLsFields inherited from class org.apache.batik.test.AbstractTest
id, name, parent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildCandidateReferenceFile(String svgDir, String svgFile) Gives a chance to the subclass to control the construction of the candidateReference URL, which is built as: getSaveVariationPrefix() + svgDir + getSaveVariationSuffix() + svgFile + parameter + PNG_EXTENSIONprotected StringbuildRefImgURL(String svgDir, String svgFile) Gives a chance to the subclass to control the construction of the reference PNG file from the svgFile name The refImgURL is built as: getRefImagePrefix() + svgDir + getRefImageSuffix() + svgFilebuildSaveVariationFile(String svgDir, String svgFile) Gives a chance to the subclass to control the construction of the saveVariation URL, which is built as: getSaveVariationPrefix() + svgDir + getSaveVariationSuffix() + svgFile + parameter + PNG_EXTENSIONprotected StringbuildSVGURL(String svgDir, String svgFile) Gives a chance to the subclass to prepend a prefix to the svgFile name.String[]buildVariationURLs(String svgDir, String svgFile) Gives a chance to the subclass to control the construction of the variation URL, which is built as: getVariationPrefix() + svgDir + getVariationSuffix() + svgFile + parameter + PNG_EXTENSIONprotected URLresolveURL(String url) Resolves the input string as follows.voidFor this type of test, the id should be made as follows:
<fileName>#reference-alias
For example:
samples/anne.svg#svgView(viewBox(0,0,100,100))-viewBox1Methods inherited from class org.apache.batik.test.svg.ParametrizedRenderingAccuracyTest
getParameterSeparatorMethods inherited from class org.apache.batik.test.svg.SamplesRenderingTest
getCandidateReferencePrefix, getCandidateReferenceSuffix, getRefImagePrefix, getRefImageSuffix, getSaveVariationPrefix, getSaveVariationSuffix, getSVGURLPrefix, getVariationPlatforms, getVariationPrefix, getVariationSuffixMethods inherited from class org.apache.batik.test.svg.PreconfiguredRenderingTest
breakSVGFile, buildSVGURL, getName, setFileMethods inherited from class org.apache.batik.test.svg.SVGRenderingAccuracyTest
encode, getTestImageTranscoder, getUserLanguage, getValidating, manipulateSVGDocument, setUserLanguage, setValidatingMethods inherited from class org.apache.batik.test.svg.AbstractRenderingAccuracyTest
addVariationURL, buildDiffImage, compare, getCandidateReference, getImage, getImage, getNextTempFileName, getNextTempFileName, getSaveVariation, getTempDirectory, getURLFile, getVariationURLs, imageToFile, makeCompareImage, makeRandomFileName, makeTempFileName, run, saveImage, saveImage, setCandidateReference, setConfig, setSaveVariationMethods inherited from class org.apache.batik.test.AbstractTest
assertEquals, assertEquals, assertNull, assertTrue, error, getId, getParent, getQualifiedId, reportError, reportException, reportSuccess, runImpl, runImplBasic, setName, setParent
-
Field Details
-
alias
-
-
Constructor Details
-
SVGReferenceRenderingAccuracyTest
public SVGReferenceRenderingAccuracyTest()
-
-
Method Details
-
setId
For this type of test, the id should be made as follows:
<fileName>#reference-alias
For example:
samples/anne.svg#svgView(viewBox(0,0,100,100))-viewBox1- Specified by:
setIdin interfaceTest- Overrides:
setIdin classParametrizedRenderingAccuracyTest
-
resolveURL
Resolves the input string as follows. + First, the string is interpreted as a file description minus any url fragment it may have (stuff after a '#'). If the file's parent directory exists, then the file name is turned into a URL and the fragment if any is appended. + Otherwise, the string is supposed to be a URL. If it is an invalid URL, an IllegalArgumentException is thrown.- Overrides:
resolveURLin classAbstractRenderingAccuracyTest
-
buildSVGURL
Gives a chance to the subclass to prepend a prefix to the svgFile name. The svgURL is built as: getSVGURLPrefix() + svgDir + svgFile + SVG_EXTENSION + "#" + parameter -
buildRefImgURL
Gives a chance to the subclass to control the construction of the reference PNG file from the svgFile name The refImgURL is built as: getRefImagePrefix() + svgDir + getRefImageSuffix() + svgFile- Overrides:
buildRefImgURLin classParametrizedRenderingAccuracyTest
-
buildVariationURLs
Gives a chance to the subclass to control the construction of the variation URL, which is built as: getVariationPrefix() + svgDir + getVariationSuffix() + svgFile + parameter + PNG_EXTENSION- Overrides:
buildVariationURLsin classParametrizedRenderingAccuracyTest
-
buildSaveVariationFile
Gives a chance to the subclass to control the construction of the saveVariation URL, which is built as: getSaveVariationPrefix() + svgDir + getSaveVariationSuffix() + svgFile + parameter + PNG_EXTENSION- Overrides:
buildSaveVariationFilein classParametrizedRenderingAccuracyTest
-
buildCandidateReferenceFile
Gives a chance to the subclass to control the construction of the candidateReference URL, which is built as: getSaveVariationPrefix() + svgDir + getSaveVariationSuffix() + svgFile + parameter + PNG_EXTENSION- Overrides:
buildCandidateReferenceFilein classParametrizedRenderingAccuracyTest
-