aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas L. Delmelle <adelmelle@apache.org>2006-03-27 18:43:40 +0000
committerAndreas L. Delmelle <adelmelle@apache.org>2006-03-27 18:43:40 +0000
commita01b9b97262a0a57ab4d1ec154c2843966cc5599 (patch)
tree38ab77057e741f78e1bc6cee93ec9866f9257370
parent385c5eef153de8f3368a87915a3553a73a833835 (diff)
downloadxmlgraphics-fop-a01b9b97262a0a57ab4d1ec154c2843966cc5599.tar.gz
xmlgraphics-fop-a01b9b97262a0a57ab4d1ec154c2843966cc5599.zip
Tweak: reuse the FopFactory instance.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@389222 13f79535-47bb-0310-9956-ffa450edef68
-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));