From 360f509474a210793d4449793d93aa119de6e17e Mon Sep 17 00:00:00 2001 From: Glen Mazza Date: Tue, 20 Jul 2004 03:39:24 +0000 Subject: 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 --- test/java/org/apache/fop/BasicDriverTestCase.java | 21 +-------------------- test/java/org/apache/fop/GenericFOPTestCase.java | 3 ++- 2 files changed, 3 insertions(+), 21 deletions(-) (limited to 'test/java/org/apache/fop') 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 @@ -83,25 +83,6 @@ public class BasicDriverTestCase extends AbstractFOPTestCase { assertTrue("Generated PostScript has zero length", baout.size() > 0); } - /** - * 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); -- cgit v1.2.3