]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Tweak: reuse the FopFactory instance.
authorAndreas L. Delmelle <adelmelle@apache.org>
Mon, 27 Mar 2006 18:43:40 +0000 (18:43 +0000)
committerAndreas L. Delmelle <adelmelle@apache.org>
Mon, 27 Mar 2006 18:43:40 +0000 (18:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@389222 13f79535-47bb-0310-9956-ffa450edef68

test/java/org/apache/fop/fotreetest/FOTreeTester.java

index 3239903039bfc70705e5da188e5914f7cb622e24..ef0deea4d9367f6b9a5ee40b3ace5e90d4b62527 100644 (file)
@@ -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));