Class SVGRenderingAccuracyTestValidator

java.lang.Object
org.apache.batik.test.AbstractTest
org.apache.batik.test.DefaultTestSuite
org.apache.batik.test.svg.SVGRenderingAccuracyTestValidator
All Implemented Interfaces:
Test, TestSuite

public class SVGRenderingAccuracyTestValidator extends DefaultTestSuite
Validates the operation of SVGRenderingAccuracyTest by forcing specific test case situations and checking that they are handled properly by the class.
Version:
$Id: SVGRenderingAccuracyTestValidator.java 1803263 2017-07-28 10:51:01Z ssteiner $
  • Field Details

    • validSVG

      private static final String validSVG
      Simple valid SVG content used for this test
      See Also:
    • validSVGVariation

      private static final String validSVGVariation
      Simple valid SVG content used for this test
      See Also:
    • validSmallSVG

      private static final String validSmallSVG
      Simple valid SVG content used for this test, small size
      See Also:
    • validRedSVG

      private static final String validRedSVG
      Simple valid SVG content used for this test, red rectangle
      See Also:
    • invalidSVG

      private static final String invalidSVG
      Simple invalid SVG content used for this test (the error is that a double quote is missing at the end of the width attribute value.
      See Also:
  • Constructor Details

    • SVGRenderingAccuracyTestValidator

      public SVGRenderingAccuracyTestValidator()
      This test creates a sample SVG file dynamically and valides that errors are generated for the following cases: + invalid SVG URL + corrupted SVG image (i.e., cannot be transcoded to an image). + invalid reference image URL + valid reference image URL, but inexisting resource. + reference image of different size than generated image. + reference image different than the generated image This test finally validates that the test passes if the reference image corresponds to the newly generated image.
  • Method Details

    • createSVGSourceURL

      public static URL createSVGSourceURL(String svgContent) throws Exception
      Creates a SVG source URL for the given svg content
      Throws:
      Exception
    • createValidReferenceImage

      public static URL createValidReferenceImage(String svgContent) throws Exception
      Helper method: creates a valid reference image
      Throws:
      Exception