diff options
author | Glen Mazza <gmazza@apache.org> | 2004-07-20 03:39:24 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2004-07-20 03:39:24 +0000 |
commit | 360f509474a210793d4449793d93aa119de6e17e (patch) | |
tree | 71d981c860ffdad98fd741ada268c8e78b2b864d /test/java/org/apache/fop | |
parent | b1c93550a81a4fe1efdb21767913b52b2bf41d79 (diff) | |
download | xmlgraphics-fop-360f509474a210793d4449793d93aa119de6e17e.tar.gz xmlgraphics-fop-360f509474a210793d4449793d93aa119de6e17e.zip |
1.) render() methods moved from Driver to XSLTInputHandler and FOFileHandler.
2.) -param command line switch implemented for xml->xslt->pdf processes
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197803 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java/org/apache/fop')
-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); |