aboutsummaryrefslogtreecommitdiffstats
path: root/test/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'test/java/org')
-rw-r--r--test/java/org/apache/fop/fotreetest/FOTreeTester.java15
1 files 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,8 +37,17 @@ 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.
* @throws Exception if a test or FOP itself fails
@@ -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));