Package org.apache.batik.test.svg
Class PreconfiguredRenderingTest
- 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
-
- All Implemented Interfaces:
Test
- Direct Known Subclasses:
BERenderingTest
,SamplesRenderingTest
public abstract class PreconfiguredRenderingTest extends SVGRenderingAccuracyTest
Convenience class for creating a SVGRenderingAccuracyTest with predefined rules for the various configuration parameters.- Version:
- $Id: PreconfiguredRenderingTest.java 1804130 2017-08-04 14:41:11Z ssteiner $
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.batik.test.svg.SVGRenderingAccuracyTest
SVGRenderingAccuracyTest.InternalPNGTranscoder
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]
DEFAULT_VARIATION_PLATFORMS
static char
PATH_SEPARATOR
static java.lang.String
PNG_EXTENSION
Generic constantsstatic java.lang.String
SVG_EXTENSION
static java.lang.String
SVGZ_EXTENSION
-
Fields inherited from class org.apache.batik.test.svg.SVGRenderingAccuracyTest
ERROR_CANNOT_TRANSCODE_SVG, userLanguage, validate, VALIDATING_PARSER
-
Fields 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
Constructors Constructor Description PreconfiguredRenderingTest()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.lang.String[]
breakSVGFile(java.lang.String svgFile)
java.lang.String
buildCandidateReferenceFile(java.lang.String svgDir, java.lang.String svgFile)
Gives a chance to the subclass to control the construction of the candidateReference URL, which is built as: getCandidatereferencePrefix() + svgDir + getCandidatereferenceSuffix() + svgFile + PNG_EXTENSIONprotected java.lang.String
buildRefImgURL(java.lang.String svgDir, java.lang.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() + svgFilejava.lang.String
buildSaveVariationFile(java.lang.String svgDir, java.lang.String svgFile)
Gives a chance to the subclass to control the construction of the saveVariation URL, which is built as: getSaveVariationPrefix() + svgDir + getSaveVariationSuffix() + svgFile + PNG_EXTENSIONprotected java.lang.String
buildSVGURL(java.lang.String svgDir, java.lang.String svgFile, java.lang.String svgExt)
Gives a chance to the subclass to prepend a prefix to the svgFile name.java.lang.String[]
buildVariationURLs(java.lang.String svgDir, java.lang.String svgFile)
Gives a chance to the subclass to control the construction of the variation URL, which is built as: getVariationPrefix() + svgDir + getVariationSuffix() + svgFile + PNG_EXTENSIONprotected abstract java.lang.String
getCandidateReferencePrefix()
protected abstract java.lang.String
getCandidateReferenceSuffix()
java.lang.String
getName()
Make the name as simple as possible.protected abstract java.lang.String
getRefImagePrefix()
protected abstract java.lang.String
getRefImageSuffix()
protected abstract java.lang.String
getSaveVariationPrefix()
protected abstract java.lang.String
getSaveVariationSuffix()
protected abstract java.lang.String
getSVGURLPrefix()
protected abstract java.lang.String[]
getVariationPlatforms()
protected abstract java.lang.String
getVariationPrefix()
protected abstract java.lang.String
getVariationSuffix()
void
setFile(java.lang.String id)
void
setId(java.lang.String id)
For preconfigured tests, the configuration has to be derived from the test identifier.-
Methods inherited from class org.apache.batik.test.svg.SVGRenderingAccuracyTest
encode, getTestImageTranscoder, getUserLanguage, getValidating, manipulateSVGDocument, setUserLanguage, setValidating
-
Methods 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, 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, setName, setParent
-
-
-
-
Field Detail
-
PNG_EXTENSION
public static final java.lang.String PNG_EXTENSION
Generic constants- See Also:
- Constant Field Values
-
SVG_EXTENSION
public static final java.lang.String SVG_EXTENSION
- See Also:
- Constant Field Values
-
SVGZ_EXTENSION
public static final java.lang.String SVGZ_EXTENSION
- See Also:
- Constant Field Values
-
PATH_SEPARATOR
public static final char PATH_SEPARATOR
- See Also:
- Constant Field Values
-
DEFAULT_VARIATION_PLATFORMS
public static final java.lang.String[] DEFAULT_VARIATION_PLATFORMS
-
-
Method Detail
-
setId
public void setId(java.lang.String id)
For preconfigured tests, the configuration has to be derived from the test identifier. The identifier should characterize the SVG file to be tested.- Specified by:
setId
in interfaceTest
- Overrides:
setId
in classAbstractTest
-
setFile
public void setFile(java.lang.String id)
-
getName
public java.lang.String getName()
Make the name as simple as possible. For preconfigured SVG files, we use the test id, which is the relevant identifier for the test user.- Specified by:
getName
in interfaceTest
- Overrides:
getName
in classAbstractRenderingAccuracyTest
-
buildSVGURL
protected java.lang.String buildSVGURL(java.lang.String svgDir, java.lang.String svgFile, java.lang.String svgExt)
Gives a chance to the subclass to prepend a prefix to the svgFile name. The svgURL is built as: getSVGURLPrefix() + svgDir + svgFile
-
getSVGURLPrefix
protected abstract java.lang.String getSVGURLPrefix()
-
buildRefImgURL
protected java.lang.String buildRefImgURL(java.lang.String svgDir, java.lang.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() + svgFile
-
getRefImagePrefix
protected abstract java.lang.String getRefImagePrefix()
-
getRefImageSuffix
protected abstract java.lang.String getRefImageSuffix()
-
buildVariationURLs
public java.lang.String[] buildVariationURLs(java.lang.String svgDir, java.lang.String svgFile)
Gives a chance to the subclass to control the construction of the variation URL, which is built as: getVariationPrefix() + svgDir + getVariationSuffix() + svgFile + PNG_EXTENSION
-
getVariationPrefix
protected abstract java.lang.String getVariationPrefix()
-
getVariationSuffix
protected abstract java.lang.String getVariationSuffix()
-
getVariationPlatforms
protected abstract java.lang.String[] getVariationPlatforms()
-
buildSaveVariationFile
public java.lang.String buildSaveVariationFile(java.lang.String svgDir, java.lang.String svgFile)
Gives a chance to the subclass to control the construction of the saveVariation URL, which is built as: getSaveVariationPrefix() + svgDir + getSaveVariationSuffix() + svgFile + PNG_EXTENSION
-
getSaveVariationPrefix
protected abstract java.lang.String getSaveVariationPrefix()
-
getSaveVariationSuffix
protected abstract java.lang.String getSaveVariationSuffix()
-
buildCandidateReferenceFile
public java.lang.String buildCandidateReferenceFile(java.lang.String svgDir, java.lang.String svgFile)
Gives a chance to the subclass to control the construction of the candidateReference URL, which is built as: getCandidatereferencePrefix() + svgDir + getCandidatereferenceSuffix() + svgFile + PNG_EXTENSION
-
getCandidateReferencePrefix
protected abstract java.lang.String getCandidateReferencePrefix()
-
getCandidateReferenceSuffix
protected abstract java.lang.String getCandidateReferenceSuffix()
-
breakSVGFile
protected java.lang.String[] breakSVGFile(java.lang.String svgFile)
-
-