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 Details

    • ERROR_CANNOT_TRANSCODE_SVG

      public static final 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:
    • VALIDATING_PARSER

      public static final 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 String userLanguage
      The userLanguage for which the document should be tested.
  • Constructor Details

    • SVGRenderingAccuracyTest

      public SVGRenderingAccuracyTest(String svgURL, 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 Details

    • setValidating

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

      public boolean getValidating()
    • setUserLanguage

      public void setUserLanguage(String userLanguage)
      Sets the userLanguage
    • getUserLanguage

      public String getUserLanguage()
    • manipulateSVGDocument

      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. For example, this can be useful to test the alternate stylesheet support.
    • encode

      public TestReport encode(URL srcURL, FileOutputStream fos)
      Specified by:
      encode in class AbstractRenderingAccuracyTest
    • getTestImageTranscoder

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