aboutsummaryrefslogtreecommitdiffstats
path: root/test/java/org/apache/fop
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2003-11-08 15:14:34 +0000
committerJeremias Maerki <jeremias@apache.org>2003-11-08 15:14:34 +0000
commita54d46b762f24f3702e695850a9d21257f7574d9 (patch)
tree9c93ade94cbd32663500385103e44fda37da90fc /test/java/org/apache/fop
parente126f7335d85f0507b016f28db616bbd1ef7b959 (diff)
downloadxmlgraphics-fop-a54d46b762f24f3702e695850a9d21257f7574d9.tar.gz
xmlgraphics-fop-a54d46b762f24f3702e695850a9d21257f7574d9.zip
Basic functionality tests for PS and RTF besides PDF. Still no detailed output checking, only checking that no exception is thrown.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196997 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java/org/apache/fop')
-rw-r--r--test/java/org/apache/fop/BasicDriverTestCase.java44
1 files changed, 43 insertions, 1 deletions
diff --git a/test/java/org/apache/fop/BasicDriverTestCase.java b/test/java/org/apache/fop/BasicDriverTestCase.java
index 0838ef1ad..ce8bddd11 100644
--- a/test/java/org/apache/fop/BasicDriverTestCase.java
+++ b/test/java/org/apache/fop/BasicDriverTestCase.java
@@ -172,7 +172,7 @@ public class BasicDriverTestCase extends AbstractFOPTestCase {
}
/**
- * Tests Driver with JAXP and OutputStream.
+ * Tests Driver with JAXP and OutputStream generating PDF.
* @throws Exception if anything fails
*/
public void testFO2PDFWithJAXP() throws Exception {
@@ -193,6 +193,48 @@ public class BasicDriverTestCase extends AbstractFOPTestCase {
}
/**
+ * Tests Driver with JAXP and OutputStream generating PostScript.
+ * @throws Exception if anything fails
+ */
+ public void testFO2PSWithJAXP() throws Exception {
+ File foFile = new File(getBaseDir(), "test/xml/bugtests/block.fo");
+ ByteArrayOutputStream baout = new ByteArrayOutputStream();
+ Driver driver = new Driver();
+ ContainerUtil.enableLogging(driver, this.logger);
+ driver.setOutputStream(baout);
+ driver.setRenderer(Driver.RENDER_PS);
+
+ TransformerFactory factory = TransformerFactory.newInstance();
+ Transformer transformer = factory.newTransformer(); //Identity transf.
+ Source src = new StreamSource(foFile);
+ Result res = new SAXResult(driver.getContentHandler());
+ transformer.transform(src, res);
+
+ assertTrue("Generated PostScript has zero length", baout.size() > 0);
+ }
+
+ /**
+ * Tests Driver with JAXP and OutputStream generating RTF.
+ * @throws Exception if anything fails
+ */
+ public void testFO2RTFWithJAXP() throws Exception {
+ File foFile = new File(getBaseDir(), "test/xml/bugtests/block.fo");
+ ByteArrayOutputStream baout = new ByteArrayOutputStream();
+ Driver driver = new Driver();
+ ContainerUtil.enableLogging(driver, this.logger);
+ driver.setOutputStream(baout);
+ driver.setRenderer(Driver.RENDER_RTF);
+
+ TransformerFactory factory = TransformerFactory.newInstance();
+ Transformer transformer = factory.newTransformer(); //Identity transf.
+ Source src = new StreamSource(foFile);
+ Result res = new SAXResult(driver.getContentHandler());
+ transformer.transform(src, res);
+
+ assertTrue("Generated RTF has zero length", baout.size() > 0);
+ }
+
+ /**
* Tests Driver with XsltInputHandler and OutputStream.
* @throws Exception if anything fails
*/