From: Andreas L. Delmelle Date: Mon, 27 Mar 2006 18:43:40 +0000 (+0000) Subject: Tweak: reuse the FopFactory instance. X-Git-Tag: fop-0_92-beta~41 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a01b9b97262a0a57ab4d1ec154c2843966cc5599;p=xmlgraphics-fop.git Tweak: reuse the FopFactory instance. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@389222 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/java/org/apache/fop/fotreetest/FOTreeTester.java b/test/java/org/apache/fop/fotreetest/FOTreeTester.java index 323990303..ef0deea4d 100644 --- a/test/java/org/apache/fop/fotreetest/FOTreeTester.java +++ b/test/java/org/apache/fop/fotreetest/FOTreeTester.java @@ -37,7 +37,16 @@ import org.xml.sax.helpers.XMLFilterImpl; * Test driver class for FO tree tests. */ public class FOTreeTester { + + private FopFactory fopFactory = FopFactory.newInstance(); + /** + * Main constructor + */ + public FOTreeTester() { + fopFactory.addElementMapping(new TestElementMapping()); + } + /** * Runs a test. * @param testFile the test file. @@ -52,11 +61,7 @@ public class FOTreeTester { spf.setValidating(false); SAXParser parser = spf.newSAXParser(); XMLReader reader = parser.getXMLReader(); - - //Setup FOP for area tree rendering - FopFactory fopFactory = FopFactory.newInstance(); - fopFactory.addElementMapping(new TestElementMapping()); - + FOUserAgent ua = fopFactory.newFOUserAgent(); ua.setBaseURL(testFile.getParentFile().toURL().toString()); ua.setFOEventHandlerOverride(new DummyFOEventHandler(ua));