public class SVGRenderingAccuracyTest extends AbstractRenderingAccuracyTest
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).Modifier and Type | Class and Description |
---|---|
protected class |
SVGRenderingAccuracyTest.InternalPNGTranscoder
Inner class which derives from the PNGTranscoder and calls the
manipulateSVGDocument just before encoding happens.
|
Modifier and Type | Field and Description |
---|---|
static String |
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.
|
protected String |
userLanguage
The userLanguage for which the document should be tested.
|
protected boolean |
validate
Controls whether or not the SVG file should be
validated.
|
static String |
VALIDATING_PARSER
Validating parser class name
|
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
id, name, parent
Modifier | Constructor and Description |
---|---|
protected |
SVGRenderingAccuracyTest()
For subclasses
|
|
SVGRenderingAccuracyTest(String svgURL,
String refImgURL)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
TestReport |
encode(URL srcURL,
FileOutputStream fos) |
ImageTranscoder |
getTestImageTranscoder()
Returns the
ImageTranscoder the Test should
use |
String |
getUserLanguage() |
boolean |
getValidating() |
protected Document |
manipulateSVGDocument(Document doc)
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 userLanguage
|
void |
setValidating(Boolean validate)
If true, this test will use validation
|
addVariationURL, buildDiffImage, compare, getCandidateReference, getImage, getImage, getName, getNextTempFileName, getNextTempFileName, getSaveVariation, getTempDirectory, getURLFile, getVariationURLs, imageToFile, makeCompareImage, makeRandomFileName, makeTempFileName, resolveURL, run, saveImage, saveImage, setCandidateReference, setConfig, setSaveVariation
assertEquals, assertEquals, assertNull, assertTrue, error, getId, getParent, getQualifiedId, reportError, reportException, reportSuccess, runImpl, runImplBasic, setId, setName, setParent
public static final String ERROR_CANNOT_TRANSCODE_SVG
public static final String VALIDATING_PARSER
protected boolean validate
protected String userLanguage
public SVGRenderingAccuracyTest(String svgURL, String refImgURL)
svgURL
- the URL String for the SVG document being tested.refImgURL
- the URL for the reference image.protected SVGRenderingAccuracyTest()
public void setValidating(Boolean validate)
public boolean getValidating()
public void setUserLanguage(String userLanguage)
public String getUserLanguage()
protected Document manipulateSVGDocument(Document doc)
public TestReport encode(URL srcURL, FileOutputStream fos)
encode
in class AbstractRenderingAccuracyTest
public ImageTranscoder getTestImageTranscoder()
ImageTranscoder
the Test should
useCopyright © 2000–2023 Apache Software Foundation. All rights reserved.