aboutsummaryrefslogtreecommitdiffstats
path: root/test/java/org/apache/fop
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2004-07-19 05:33:35 +0000
committerGlen Mazza <gmazza@apache.org>2004-07-19 05:33:35 +0000
commitaf81f828c5b7a480bf9d0674bbfefb9a60524ac5 (patch)
treefe5043083a7ab19c6c5285c351ebd49b23d9a045 /test/java/org/apache/fop
parent74955dc126dccccf831748573270d111e5ca5923 (diff)
downloadxmlgraphics-fop-af81f828c5b7a480bf9d0674bbfefb9a60524ac5.tar.gz
xmlgraphics-fop-af81f828c5b7a480bf9d0674bbfefb9a60524ac5.zip
1.) Driver constructor modified to require RenderType, and setter functions
for RenderType and FOUserAgent removed, to allow for better checking of a valid Driver object at time of construction. (Also, will reduce need to validate Driver object should it be a parameter to a method.) 2.) Added validity checking of renderType to FOTreeBuilder as well, in effect decoupling Driver from FOTreeBuilder (the latter can work on its own now.) 3.) Updated the various examples and the documentation to indicate the new API. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197801 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java/org/apache/fop')
-rw-r--r--test/java/org/apache/fop/BasicDriverTestCase.java18
-rw-r--r--test/java/org/apache/fop/GenericFOPTestCase.java4
2 files changed, 7 insertions, 15 deletions
diff --git a/test/java/org/apache/fop/BasicDriverTestCase.java b/test/java/org/apache/fop/BasicDriverTestCase.java
index 5f722fbc1..fa004e487 100644
--- a/test/java/org/apache/fop/BasicDriverTestCase.java
+++ b/test/java/org/apache/fop/BasicDriverTestCase.java
@@ -71,9 +71,8 @@ public class BasicDriverTestCase extends AbstractFOPTestCase {
public void testFO2PDFWithDOM() throws Exception {
File foFile = new File(getBaseDir(), "test/xml/bugtests/block.fo");
ByteArrayOutputStream baout = new ByteArrayOutputStream();
- Driver driver = new Driver();
+ Driver driver = new Driver(Driver.RENDER_PDF);
driver.setOutputStream(baout);
- driver.setRenderer(Driver.RENDER_PDF);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(); //Identity transf.
@@ -91,10 +90,9 @@ public class BasicDriverTestCase extends AbstractFOPTestCase {
public void testFO2PDFWithXMLReader() throws Exception {
File foFile = new File(getBaseDir(), "test/xml/bugtests/block.fo");
ByteArrayOutputStream baout = new ByteArrayOutputStream();
- Driver driver = new Driver();
+ Driver driver = new Driver(Driver.RENDER_PDF);
driver.setOutputStream(baout);
- driver.setRenderer(Driver.RENDER_PDF);
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setNamespaceAware(true);
factory.setValidating(false);
@@ -111,9 +109,8 @@ public class BasicDriverTestCase extends AbstractFOPTestCase {
public void testFO2PDFWithJAXP() throws Exception {
File foFile = new File(getBaseDir(), "test/xml/bugtests/block.fo");
ByteArrayOutputStream baout = new ByteArrayOutputStream();
- Driver driver = new Driver();
+ Driver driver = new Driver(Driver.RENDER_PDF);
driver.setOutputStream(baout);
- driver.setRenderer(Driver.RENDER_PDF);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(); //Identity transf.
@@ -131,9 +128,8 @@ public class BasicDriverTestCase extends AbstractFOPTestCase {
public void testFO2PSWithJAXP() throws Exception {
File foFile = new File(getBaseDir(), "test/xml/bugtests/block.fo");
ByteArrayOutputStream baout = new ByteArrayOutputStream();
- Driver driver = new Driver();
+ Driver driver = new Driver(Driver.RENDER_PS);
driver.setOutputStream(baout);
- driver.setRenderer(Driver.RENDER_PS);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(); //Identity transf.
@@ -151,9 +147,8 @@ public class BasicDriverTestCase extends AbstractFOPTestCase {
public void testFO2RTFWithJAXP() throws Exception {
File foFile = new File(getBaseDir(), "test/xml/bugtests/block.fo");
ByteArrayOutputStream baout = new ByteArrayOutputStream();
- Driver driver = new Driver();
+ Driver driver = new Driver(Driver.RENDER_RTF);
driver.setOutputStream(baout);
- driver.setRenderer(Driver.RENDER_RTF);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(); //Identity transf.
@@ -172,9 +167,8 @@ public class BasicDriverTestCase extends AbstractFOPTestCase {
File xmlFile = new File(getBaseDir(), "test/xml/1.xml");
File xsltFile = new File(getBaseDir(), "test/xsl/doc.xsl");
ByteArrayOutputStream baout = new ByteArrayOutputStream();
- Driver driver = new Driver();
+ Driver driver = new Driver(Driver.RENDER_PDF);
driver.setOutputStream(baout);
- driver.setRenderer(Driver.RENDER_PDF);
InputHandler handler = new XSLTInputHandler(xmlFile, xsltFile);
driver.render(handler);
diff --git a/test/java/org/apache/fop/GenericFOPTestCase.java b/test/java/org/apache/fop/GenericFOPTestCase.java
index dc78a3173..85a5a4d44 100644
--- a/test/java/org/apache/fop/GenericFOPTestCase.java
+++ b/test/java/org/apache/fop/GenericFOPTestCase.java
@@ -118,9 +118,7 @@ public final class GenericFOPTestCase extends TestCase {
ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
DigestOutputStream out =
new DigestOutputStream(new ByteArrayOutputStream(), outDigest);
- Driver driver = new Driver();
- driver.setUserAgent(foUserAgent);
- driver.setRenderer(Driver.RENDER_PDF);
+ Driver driver = new Driver(Driver.RENDER_PDF, foUserAgent);
driver.setOutputStream(out);
InputSource source = new InputSource(new StringReader(fo));
DigestFilter filter = new DigestFilter("MD5");