Package org.apache.batik.test.svg
Class SVGRenderingAccuracyTestValidator
- java.lang.Object
-
- org.apache.batik.test.AbstractTest
-
- org.apache.batik.test.DefaultTestSuite
-
- org.apache.batik.test.svg.SVGRenderingAccuracyTestValidator
-
public class SVGRenderingAccuracyTestValidator extends DefaultTestSuite
Validates the operation ofSVGRenderingAccuracyTest
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 $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
SVGRenderingAccuracyTestValidator.AccurateRendering
(package private) static class
SVGRenderingAccuracyTestValidator.AccurateRenderingWithVariation
Validates that test passes if proper variation is given(package private) static class
SVGRenderingAccuracyTestValidator.DefaultConfigTest
Validates that the default parameters computation is working as expected.(package private) static class
SVGRenderingAccuracyTestValidator.DifferentSizes
(package private) static class
SVGRenderingAccuracyTestValidator.InexistingReferenceImage
Creates anSVGRenderingAccuracyTest
with an valid URL for the source SVG valid URL for the reference image, but the reference image, but the reference image does not exist(package private) static class
SVGRenderingAccuracyTestValidator.InvalidReferenceImageURL
Creates anSVGRenderingAccuracyTest
with an valid URL for the source SVG but with an invalid URL for the reference image.(package private) static class
SVGRenderingAccuracyTestValidator.InvalidSVGContent
Creates anSVGRenderingAccuracyTest
with a valid URL pointing to an invalid SVG document.(package private) static class
SVGRenderingAccuracyTestValidator.InvalidSVGURL
Creates anSVGRenderingAccuracyTest
with an invalid URL for the source SVG.(package private) static class
SVGRenderingAccuracyTestValidator.SameSizeDifferentContent
-
Field Summary
Fields Modifier and Type Field Description private static 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.private static java.lang.String
validRedSVG
Simple valid SVG content used for this test, red rectangleprivate static java.lang.String
validSmallSVG
Simple valid SVG content used for this test, small sizeprivate static java.lang.String
validSVG
Simple valid SVG content used for this testprivate static java.lang.String
validSVGVariation
Simple valid SVG content used for this test-
Fields inherited from class org.apache.batik.test.DefaultTestSuite
tests
-
Fields inherited from class org.apache.batik.test.AbstractTest
id, parent
-
-
Constructor Summary
Constructors Constructor Description 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).
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.net.URL
createSVGSourceURL(java.lang.String svgContent)
Creates a SVG source URL for the given svg contentstatic java.net.URL
createValidReferenceImage(java.lang.String svgContent)
Helper method: creates a valid reference image-
Methods inherited from class org.apache.batik.test.DefaultTestSuite
addTest, getChildrenCount, getChildrenTests, getName, removeTest, runImpl, setName
-
Methods inherited from class org.apache.batik.test.AbstractTest
assertEquals, assertEquals, assertNull, assertTrue, error, getId, getParent, getQualifiedId, reportError, reportException, reportSuccess, run, runImplBasic, setId, setParent
-
-
-
-
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
-
-