aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2004-06-25 23:35:00 +0000
committerGlen Mazza <gmazza@apache.org>2004-06-25 23:35:00 +0000
commit8a045dbc8d61f3ae7750715cd61c626fb48f775b (patch)
tree19184827a664695aca312b9f5e8f5f371cb8de0d /test
parentf575d5d538b1e9d2ff86a44f81247466d78ee77c (diff)
downloadxmlgraphics-fop-8a045dbc8d61f3ae7750715cd61c626fb48f775b.tar.gz
xmlgraphics-fop-8a045dbc8d61f3ae7750715cd61c626fb48f775b.zip
1.) Moved the CommandLineOptions' InputHandler object into FOUserAgent, allowing
for a no-parameter constructor for AWTRenderer (like the other renderers). (Code is not yet ideal in AWTRenderer, but will do the task.) 2.) AWT renderer handling now more similar to the other renderers (simplifications in Driver, Fop). 3.) Driver.getRenderer() removed from API. (Renderer configuration now mostly done through FOUserAgent, and setup of renderer prior to calling setRenderer().) 4.) Validity checking added to region-after, -start, -end, and -before. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197744 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r--test/java/org/apache/fop/BasicDriverTestCase.java11
-rw-r--r--test/java/org/apache/fop/GenericFOPTestCase.java5
2 files changed, 4 insertions, 12 deletions
diff --git a/test/java/org/apache/fop/BasicDriverTestCase.java b/test/java/org/apache/fop/BasicDriverTestCase.java
index ab158a396..c512a50ec 100644
--- a/test/java/org/apache/fop/BasicDriverTestCase.java
+++ b/test/java/org/apache/fop/BasicDriverTestCase.java
@@ -33,7 +33,6 @@ import javax.xml.transform.stream.StreamSource;
import org.xml.sax.InputSource;
-import org.apache.commons.logging.impl.NoOpLog;
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.fop.apps.Driver;
import org.apache.fop.apps.InputHandler;
@@ -47,8 +46,6 @@ import org.w3c.dom.Document;
*/
public class BasicDriverTestCase extends AbstractFOPTestCase {
- private NoOpLog logger = new NoOpLog();
-
/**
* @see junit.framework.TestCase#TestCase(String)
*/
@@ -67,7 +64,6 @@ public class BasicDriverTestCase extends AbstractFOPTestCase {
new InputSource(foFile.toURL().toExternalForm()),
baout);
- driver.setLogger(this.logger);
driver.setRenderer(Driver.RENDER_PDF);
driver.run();
assertTrue("Generated PDF has zero length", baout.size() > 0);
@@ -82,7 +78,6 @@ public class BasicDriverTestCase extends AbstractFOPTestCase {
ByteArrayOutputStream baout = new ByteArrayOutputStream();
Driver driver = new Driver();
- driver.setLogger(this.logger);
driver.setInputSource(new InputSource(foFile.toURL().toExternalForm()));
driver.setOutputStream(baout);
driver.setRenderer(Driver.RENDER_PDF);
@@ -109,7 +104,6 @@ public class BasicDriverTestCase extends AbstractFOPTestCase {
ByteArrayOutputStream baout = new ByteArrayOutputStream();
Driver driver = new Driver();
- driver.setLogger(this.logger);
driver.setOutputStream(baout);
driver.setRenderer(Driver.RENDER_PDF);
driver.render(loadDocument(foFile));
@@ -125,7 +119,6 @@ public class BasicDriverTestCase extends AbstractFOPTestCase {
ByteArrayOutputStream baout = new ByteArrayOutputStream();
Driver driver = new Driver();
- driver.setLogger(this.logger);
driver.setOutputStream(baout);
driver.setRenderer(Driver.RENDER_PDF);
SAXParserFactory factory = SAXParserFactory.newInstance();
@@ -145,7 +138,6 @@ public class BasicDriverTestCase extends AbstractFOPTestCase {
File foFile = new File(getBaseDir(), "test/xml/bugtests/block.fo");
ByteArrayOutputStream baout = new ByteArrayOutputStream();
Driver driver = new Driver();
- driver.setLogger(this.logger);
driver.setOutputStream(baout);
driver.setRenderer(Driver.RENDER_PDF);
@@ -166,7 +158,6 @@ public class BasicDriverTestCase extends AbstractFOPTestCase {
File foFile = new File(getBaseDir(), "test/xml/bugtests/block.fo");
ByteArrayOutputStream baout = new ByteArrayOutputStream();
Driver driver = new Driver();
- driver.setLogger(this.logger);
driver.setOutputStream(baout);
driver.setRenderer(Driver.RENDER_PS);
@@ -187,7 +178,6 @@ public class BasicDriverTestCase extends AbstractFOPTestCase {
File foFile = new File(getBaseDir(), "test/xml/bugtests/block.fo");
ByteArrayOutputStream baout = new ByteArrayOutputStream();
Driver driver = new Driver();
- driver.setLogger(this.logger);
driver.setOutputStream(baout);
driver.setRenderer(Driver.RENDER_RTF);
@@ -209,7 +199,6 @@ public class BasicDriverTestCase extends AbstractFOPTestCase {
File xsltFile = new File(getBaseDir(), "test/xsl/doc.xsl");
ByteArrayOutputStream baout = new ByteArrayOutputStream();
Driver driver = new Driver();
- driver.setLogger(this.logger);
driver.setOutputStream(baout);
driver.setRenderer(Driver.RENDER_PDF);
diff --git a/test/java/org/apache/fop/GenericFOPTestCase.java b/test/java/org/apache/fop/GenericFOPTestCase.java
index 568855849..370b012a9 100644
--- a/test/java/org/apache/fop/GenericFOPTestCase.java
+++ b/test/java/org/apache/fop/GenericFOPTestCase.java
@@ -31,6 +31,7 @@ import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.fop.apps.Driver;
+import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.render.pdf.PDFRenderer;
import org.apache.fop.util.DigestFilter;
import org.xml.sax.InputSource;
@@ -112,7 +113,9 @@ public final class GenericFOPTestCase extends TestCase {
private void renderPDF(String fo, String digestIn, String digestOut)
throws Exception {
PDFRenderer renderer = new PDFRenderer();
- renderer.setCreationDate(new Date(10000));
+ FOUserAgent foUserAgent = new FOUserAgent();
+ foUserAgent.setCreationDate(new Date(10000));
+ renderer.setUserAgent(foUserAgent);
MessageDigest outDigest = MessageDigest.getInstance("MD5");
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DigestOutputStream out =