aboutsummaryrefslogtreecommitdiffstats
path: root/test/java/org/apache/fop/GenericFOPTestCase.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2006-03-27 09:51:14 +0000
committerJeremias Maerki <jeremias@apache.org>2006-03-27 09:51:14 +0000
commit0a2d149c230858d311f6d4d776072704a0096ac2 (patch)
tree3dcbf5ed7be99ab2a93f5911ff2ff40e10364fc6 /test/java/org/apache/fop/GenericFOPTestCase.java
parent60fc6535d1a4bb48faea00e1d4793d18bc0f7f98 (diff)
downloadxmlgraphics-fop-0a2d149c230858d311f6d4d776072704a0096ac2.tar.gz
xmlgraphics-fop-0a2d149c230858d311f6d4d776072704a0096ac2.zip
Merged Temp_API_Finalization branch back into FOP Trunk:
Finalized API according to the plan in the Wiki: http://wiki.apache.org/xmlgraphics-fop/ApiDesign In addition to that: Deprecated the rest of the Fop constructors. Refactored the FopServlet a bit to make it more versatile and still easy to understand. The FopPrintServlet is now a subclass of FopServlet. Some further cleanup on the way. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@389086 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java/org/apache/fop/GenericFOPTestCase.java')
-rw-r--r--test/java/org/apache/fop/GenericFOPTestCase.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/java/org/apache/fop/GenericFOPTestCase.java b/test/java/org/apache/fop/GenericFOPTestCase.java
index 7c8a65f4d..25f18b819 100644
--- a/test/java/org/apache/fop/GenericFOPTestCase.java
+++ b/test/java/org/apache/fop/GenericFOPTestCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright 1999-2005 The Apache Software Foundation.
+ * Copyright 1999-2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,7 @@ import junit.framework.TestSuite;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FOUserAgent;
+import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.util.DigestFilter;
import org.xml.sax.InputSource;
@@ -46,6 +47,9 @@ import org.xml.sax.InputSource;
*/
public final class GenericFOPTestCase extends TestCase {
+ // configure fopFactory as desired
+ private FopFactory fopFactory = FopFactory.newInstance();
+
protected SAXParserFactory parserFactory;
public static Test suite() {
@@ -110,13 +114,12 @@ public final class GenericFOPTestCase extends TestCase {
private void renderPDF(String fo, String digestIn, String digestOut)
throws Exception {
- FOUserAgent foUserAgent = new FOUserAgent();
+ FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
foUserAgent.setCreationDate(new Date(10000));
MessageDigest outDigest = MessageDigest.getInstance("MD5");
DigestOutputStream out =
new DigestOutputStream(new ByteArrayOutputStream(), outDigest);
- Fop fop = new Fop(MimeConstants.MIME_PDF, foUserAgent);
- fop.setOutputStream(out);
+ Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
InputSource source = new InputSource(new StringReader(fo));
DigestFilter filter = new DigestFilter("MD5");
filter.setParent(parserFactory.newSAXParser().getXMLReader());