diff options
Diffstat (limited to 'test/java/org/apache/fop/intermediate/AbstractIntermediateTestCase.java')
-rw-r--r-- | test/java/org/apache/fop/intermediate/AbstractIntermediateTestCase.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/java/org/apache/fop/intermediate/AbstractIntermediateTestCase.java b/test/java/org/apache/fop/intermediate/AbstractIntermediateTestCase.java index 63e293afe..465e1405c 100644 --- a/test/java/org/apache/fop/intermediate/AbstractIntermediateTestCase.java +++ b/test/java/org/apache/fop/intermediate/AbstractIntermediateTestCase.java @@ -22,6 +22,7 @@ package org.apache.fop.intermediate; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; +import java.io.IOException; import java.io.OutputStream; import java.net.MalformedURLException; @@ -41,6 +42,8 @@ import javax.xml.transform.stream.StreamSource; import org.custommonkey.xmlunit.XMLTestCase; import org.w3c.dom.Document; +import org.xml.sax.SAXException; + import org.apache.commons.io.IOUtils; import org.apache.commons.io.output.ByteArrayOutputStream; @@ -94,6 +97,7 @@ public abstract class AbstractIntermediateTestCase extends XMLTestCase { saveDOM(intermediate, new File(outputDir, getName() + ".1" + getIntermediateFileExtension())); } + validate(intermediate); } /** {@inheritDoc} */ @@ -117,6 +121,16 @@ public abstract class AbstractIntermediateTestCase extends XMLTestCase { } /** + * Validates the intermediate format file. + * @param doc the intermediate file + * @throws IOException if an IO error occurs while loading the schema + * @throws SAXException if a SAX-related exception (including a validation error) occurs + */ + protected void validate(Document doc) throws SAXException, IOException { + //nop by default + } + + /** * Builds an intermediate format document from a source file. * @param source the source file * @param templates the (optional) stylesheet |