diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/java/org/apache/fop/BasicDriverTestCase.java | 21 | ||||
-rw-r--r-- | test/java/org/apache/fop/GenericFOPTestCase.java | 3 |
2 files changed, 3 insertions, 21 deletions
diff --git a/test/java/org/apache/fop/BasicDriverTestCase.java b/test/java/org/apache/fop/BasicDriverTestCase.java index 80b70d3ef..2a4f4ce00 100644 --- a/test/java/org/apache/fop/BasicDriverTestCase.java +++ b/test/java/org/apache/fop/BasicDriverTestCase.java @@ -84,25 +84,6 @@ public class BasicDriverTestCase extends AbstractFOPTestCase { } /** - * Tests Driver with XMLReader, InputSource and OutputStream. - * @throws Exception if anything fails - */ - public void testFO2PDFWithXMLReader() throws Exception { - File foFile = new File(getBaseDir(), "test/xml/bugtests/block.fo"); - ByteArrayOutputStream baout = new ByteArrayOutputStream(); - Driver driver = new Driver(Driver.RENDER_PDF); - - driver.setOutputStream(baout); - SAXParserFactory factory = SAXParserFactory.newInstance(); - factory.setNamespaceAware(true); - factory.setValidating(false); - SAXParser parser = factory.newSAXParser(); - driver.render(parser.getXMLReader(), - new InputSource(foFile.toURL().toExternalForm())); - assertTrue("Generated PDF has zero length", baout.size() > 0); - } - - /** * Tests Driver with JAXP and OutputStream generating PDF. * @throws Exception if anything fails */ @@ -171,7 +152,7 @@ public class BasicDriverTestCase extends AbstractFOPTestCase { driver.setOutputStream(baout); InputHandler handler = new XSLTInputHandler(xmlFile, xsltFile); - driver.render(handler); + handler.render(driver); assertTrue("Generated PDF has zero length", baout.size() > 0); } diff --git a/test/java/org/apache/fop/GenericFOPTestCase.java b/test/java/org/apache/fop/GenericFOPTestCase.java index 85a5a4d44..39803329f 100644 --- a/test/java/org/apache/fop/GenericFOPTestCase.java +++ b/test/java/org/apache/fop/GenericFOPTestCase.java @@ -123,7 +123,8 @@ public final class GenericFOPTestCase extends TestCase { InputSource source = new InputSource(new StringReader(fo)); DigestFilter filter = new DigestFilter("MD5"); filter.setParent(parserFactory.newSAXParser().getXMLReader()); - driver.render(filter, source); + filter.setContentHandler(driver.getDefaultHandler()); + filter.parse(source); String digestInActual = digestToString(filter.getDigestValue()); if (!digestIn.equals(digestInActual)) { fail("input MD5: was " + digestInActual + ", expected " + digestIn); |