Class SVGRenderingAccuracyTest

  • All Implemented Interfaces:
    Test
    Direct Known Subclasses:
    PreconfiguredRenderingTest

    public class SVGRenderingAccuracyTest
    extends AbstractRenderingAccuracyTest
    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: SVGRenderingAccuracyTest.java 1804130 2017-08-04 14:41:11Z ssteiner $
    • Field Detail

      • ERROR_CANNOT_TRANSCODE_SVG

        public static final java.lang.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.
        See Also:
        Constant Field Values
      • VALIDATING_PARSER

        public static final java.lang.String VALIDATING_PARSER
        Validating parser class name
      • validate

        protected boolean validate
        Controls whether or not the SVG file should be validated. By default, no validation is used.
      • userLanguage

        protected java.lang.String userLanguage
        The userLanguage for which the document should be tested.
    • Constructor Detail

      • SVGRenderingAccuracyTest

        public SVGRenderingAccuracyTest​(java.lang.String svgURL,
                                        java.lang.String refImgURL)
        Constructor.
        Parameters:
        svgURL - the URL String for the SVG document being tested.
        refImgURL - the URL for the reference image.
      • SVGRenderingAccuracyTest

        protected SVGRenderingAccuracyTest()
        For subclasses
    • Method Detail

      • setValidating

        public void setValidating​(java.lang.Boolean validate)
        If true, this test will use validation
      • getValidating

        public boolean getValidating()
      • setUserLanguage

        public void setUserLanguage​(java.lang.String userLanguage)
        Sets the userLanguage
      • getUserLanguage

        public java.lang.String getUserLanguage()
      • manipulateSVGDocument

        protected org.w3c.dom.Document manipulateSVGDocument​(org.w3c.dom.Document doc)
        Template method which subclasses can override if they need to manipulate the DOM in some way before running the accuracy test. For example, this can be useful to test the alternate stylesheet support.
      • getTestImageTranscoder

        public ImageTranscoder getTestImageTranscoder()
        Returns the ImageTranscoder the Test should use