Class SVGReferenceRenderingAccuracyTest

  • All Implemented Interfaces:
    Test

    public class SVGReferenceRenderingAccuracyTest
    extends ParametrizedRenderingAccuracyTest
    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 $
    • Field Detail

      • alias

        protected java.lang.String alias
    • Constructor Detail

      • SVGReferenceRenderingAccuracyTest

        public SVGReferenceRenderingAccuracyTest()
    • Method Detail

      • setId

        public void setId​(java.lang.String id)
        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:
        setId in interface Test
        Overrides:
        setId in class ParametrizedRenderingAccuracyTest
      • resolveURL

        protected java.net.URL resolveURL​(java.lang.String url)
        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:
        resolveURL in class AbstractRenderingAccuracyTest
      • buildSVGURL

        protected java.lang.String buildSVGURL​(java.lang.String svgDir,
                                               java.lang.String svgFile)
        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

        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
        Overrides:
        buildRefImgURL in class ParametrizedRenderingAccuracyTest
      • 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 + parameter + PNG_EXTENSION
        Overrides:
        buildVariationURLs in class ParametrizedRenderingAccuracyTest
      • 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 + parameter + PNG_EXTENSION
        Overrides:
        buildSaveVariationFile in class ParametrizedRenderingAccuracyTest
      • 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: getSaveVariationPrefix() + svgDir + getSaveVariationSuffix() + svgFile + parameter + PNG_EXTENSION
        Overrides:
        buildCandidateReferenceFile in class ParametrizedRenderingAccuracyTest