Class 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 Detail

      • validSVG

        private static final java.lang.String validSVG
        Simple valid SVG content used for this test
        See Also:
        Constant Field Values
      • validSVGVariation

        private static final java.lang.String validSVGVariation
        Simple valid SVG content used for this test
        See Also:
        Constant Field Values
      • validSmallSVG

        private static final java.lang.String validSmallSVG
        Simple valid SVG content used for this test, small size
        See Also:
        Constant Field Values
      • validRedSVG

        private static final java.lang.String validRedSVG
        Simple valid SVG content used for this test, red rectangle
        See Also:
        Constant Field Values
      • invalidSVG

        private static final java.lang.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:
        Constant Field Values
    • Constructor Detail

      • 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 Detail

      • createSVGSourceURL

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

        public static java.net.URL createValidReferenceImage​(java.lang.String svgContent)
                                                      throws java.lang.Exception
        Helper method: creates a valid reference image
        Throws:
        java.lang.Exception