From a01b9b97262a0a57ab4d1ec154c2843966cc5599 Mon Sep 17 00:00:00 2001 From: "Andreas L. Delmelle" Date: Mon, 27 Mar 2006 18:43:40 +0000 Subject: [PATCH] Tweak: reuse the FopFactory instance. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@389222 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/fotreetest/FOTreeTester.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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)); -- 2.39.5