diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-11-12 15:58:07 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-11-12 15:58:07 +0000 |
commit | b4af2746c8d5d3c356ef5c0efc146e5f6c27687a (patch) | |
tree | 274bb5a0785ab0cfee6ee96a3925c9270de48a9a /test/java/org/apache/fop | |
parent | 67cf81215052e47ab2028c67dc5611a8e942fa5a (diff) | |
download | xmlgraphics-fop-b4af2746c8d5d3c356ef5c0efc146e5f6c27687a.tar.gz xmlgraphics-fop-b4af2746c8d5d3c356ef5c0efc146e5f6c27687a.zip |
Deprecated constructors Fop(int) and Fop(int, FOUserAgent).
Deprecated Fop.getVersion() in favor for Version.getVersion().
Changed every place the newly deprecated methods were called.
Ant task and TestConverter changed to fully use MIME types.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@332791 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java/org/apache/fop')
10 files changed, 26 insertions, 22 deletions
diff --git a/test/java/org/apache/fop/BasicDriverTestCase.java b/test/java/org/apache/fop/BasicDriverTestCase.java index 350a76195..100f1eaeb 100644 --- a/test/java/org/apache/fop/BasicDriverTestCase.java +++ b/test/java/org/apache/fop/BasicDriverTestCase.java @@ -29,6 +29,7 @@ import javax.xml.transform.stream.StreamSource; import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.fop.apps.Fop; +import org.apache.fop.apps.MimeConstants; import org.apache.fop.cli.InputHandler; /** @@ -51,7 +52,7 @@ public class BasicDriverTestCase extends AbstractFOPTestCase { public void testFO2PDFWithJAXP() throws Exception { File foFile = new File(getBaseDir(), "test/xml/bugtests/block.fo"); ByteArrayOutputStream baout = new ByteArrayOutputStream(); - Fop fop = new Fop(Fop.RENDER_PDF); + Fop fop = new Fop(MimeConstants.MIME_PDF); fop.setOutputStream(baout); TransformerFactory factory = TransformerFactory.newInstance(); @@ -70,7 +71,7 @@ public class BasicDriverTestCase extends AbstractFOPTestCase { public void testFO2PSWithJAXP() throws Exception { File foFile = new File(getBaseDir(), "test/xml/bugtests/block.fo"); ByteArrayOutputStream baout = new ByteArrayOutputStream(); - Fop fop = new Fop(Fop.RENDER_PS); + Fop fop = new Fop(MimeConstants.MIME_POSTSCRIPT); fop.setOutputStream(baout); TransformerFactory factory = TransformerFactory.newInstance(); @@ -89,7 +90,7 @@ public class BasicDriverTestCase extends AbstractFOPTestCase { public void testFO2RTFWithJAXP() throws Exception { File foFile = new File(getBaseDir(), "test/xml/bugtests/block.fo"); ByteArrayOutputStream baout = new ByteArrayOutputStream(); - Fop fop = new Fop(Fop.RENDER_RTF); + Fop fop = new Fop(MimeConstants.MIME_RTF); fop.setOutputStream(baout); TransformerFactory factory = TransformerFactory.newInstance(); @@ -109,7 +110,7 @@ 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(); - Fop fop = new Fop(Fop.RENDER_PDF); + Fop fop = new Fop(MimeConstants.MIME_PDF); fop.setOutputStream(baout); InputHandler handler = new InputHandler(xmlFile, xsltFile, null); diff --git a/test/java/org/apache/fop/GenericFOPTestCase.java b/test/java/org/apache/fop/GenericFOPTestCase.java index 538649664..7c8a65f4d 100644 --- a/test/java/org/apache/fop/GenericFOPTestCase.java +++ b/test/java/org/apache/fop/GenericFOPTestCase.java @@ -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.MimeConstants; import org.apache.fop.util.DigestFilter; import org.xml.sax.InputSource; @@ -114,7 +115,7 @@ public final class GenericFOPTestCase extends TestCase { MessageDigest outDigest = MessageDigest.getInstance("MD5"); DigestOutputStream out = new DigestOutputStream(new ByteArrayOutputStream(), outDigest); - Fop fop = new Fop(Fop.RENDER_PDF, foUserAgent); + Fop fop = new Fop(MimeConstants.MIME_PDF, foUserAgent); fop.setOutputStream(out); InputSource source = new InputSource(new StringReader(fo)); DigestFilter filter = new DigestFilter("MD5"); diff --git a/test/java/org/apache/fop/URIResolutionTestCase.java b/test/java/org/apache/fop/URIResolutionTestCase.java index e6f45bcef..a6d5a4191 100644 --- a/test/java/org/apache/fop/URIResolutionTestCase.java +++ b/test/java/org/apache/fop/URIResolutionTestCase.java @@ -40,6 +40,7 @@ import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.Fop; +import org.apache.fop.apps.MimeConstants; import org.apache.fop.image.ImageFactory; import org.apache.fop.render.xml.XMLRenderer; import org.apache.xpath.XPathAPI; @@ -115,7 +116,7 @@ public class URIResolutionTestCase extends AbstractFOPTestCase { ua.setURIResolver(resolver); ua.setBaseURL(foFile.getParentFile().toURL().toString()); - Fop fop = new Fop(Fop.RENDER_PDF, ua); + Fop fop = new Fop(MimeConstants.MIME_PDF, ua); ByteArrayOutputStream baout = new ByteArrayOutputStream(); fop.setOutputStream(baout); @@ -155,7 +156,7 @@ public class URIResolutionTestCase extends AbstractFOPTestCase { atrenderer.setTransformerHandler(athandler); ua.setRendererOverride(atrenderer); - Fop fop = new Fop(Fop.RENDER_XML, ua); + Fop fop = new Fop(MimeConstants.MIME_FOP_AREA_TREE, ua); Transformer transformer = tfactory.newTransformer(); //Identity transf. Source src = new StreamSource(fo); diff --git a/test/java/org/apache/fop/fotreetest/FOTreeTester.java b/test/java/org/apache/fop/fotreetest/FOTreeTester.java index f749f2aab..0a79aea61 100644 --- a/test/java/org/apache/fop/fotreetest/FOTreeTester.java +++ b/test/java/org/apache/fop/fotreetest/FOTreeTester.java @@ -29,7 +29,7 @@ import javax.xml.transform.stream.StreamSource; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.Fop; -import org.apache.fop.fo.Constants; +import org.apache.fop.apps.MimeConstants; import org.apache.fop.fotreetest.ext.TestElementMapping; @@ -59,7 +59,7 @@ public class FOTreeTester { ua.setBaseURL(testFile.getParentFile().toURL().toString()); ua.setFOEventHandlerOverride(new DummyFOEventHandler(ua)); ua.addElementMapping(new TestElementMapping()); - Fop fop = new Fop(Constants.RENDER_XML, ua); + Fop fop = new Fop(MimeConstants.MIME_FOP_AREA_TREE, ua); SAXResult fores = new SAXResult(fop.getDefaultHandler()); transformer.transform(src, fores); diff --git a/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java b/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java index 47ae47924..9fd105ab7 100644 --- a/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java +++ b/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java @@ -42,7 +42,7 @@ import javax.xml.transform.stream.StreamSource; import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.Fop; -import org.apache.fop.fo.Constants; +import org.apache.fop.apps.MimeConstants; import org.apache.fop.layoutmgr.ElementListObserver; import org.apache.fop.render.xml.XMLRenderer; import org.w3c.dom.Document; @@ -129,7 +129,7 @@ public class LayoutEngineTester { atrenderer.setUserAgent(ua); atrenderer.setTransformerHandler(athandler); ua.setRendererOverride(atrenderer); - Fop fop = new Fop(Constants.RENDER_XML, ua); + Fop fop = new Fop(MimeConstants.MIME_FOP_AREA_TREE, ua); SAXResult fores = new SAXResult(fop.getDefaultHandler()); transformer.transform(src, fores); diff --git a/test/java/org/apache/fop/threading/FOProcessorImpl.java b/test/java/org/apache/fop/threading/FOProcessorImpl.java index eed8f73e0..51c76584a 100644 --- a/test/java/org/apache/fop/threading/FOProcessorImpl.java +++ b/test/java/org/apache/fop/threading/FOProcessorImpl.java @@ -37,7 +37,7 @@ import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.fop.apps.Fop; import org.apache.fop.apps.FOPException; -import org.apache.fop.fo.Constants; +import org.apache.fop.apps.MimeConstants; import org.apache.avalon.framework.activity.Initializable; public class FOProcessorImpl extends AbstractLogEnabled @@ -84,7 +84,7 @@ public class FOProcessorImpl extends AbstractLogEnabled public void process(InputStream in, Templates templates, OutputStream out) throws org.apache.fop.apps.FOPException, java.io.IOException { - Fop fop = new Fop(Constants.RENDER_PDF); + Fop fop = new Fop(MimeConstants.MIME_PDF); fop.setOutputStream(out); try { diff --git a/test/java/org/apache/fop/visual/AbstractPSPDFBitmapProducer.java b/test/java/org/apache/fop/visual/AbstractPSPDFBitmapProducer.java index 3899b6dee..655643877 100644 --- a/test/java/org/apache/fop/visual/AbstractPSPDFBitmapProducer.java +++ b/test/java/org/apache/fop/visual/AbstractPSPDFBitmapProducer.java @@ -99,9 +99,9 @@ public abstract class AbstractPSPDFBitmapProducer extends AbstractBitmapProducer protected abstract String getTargetExtension(); /** - * @return the output format constant for the FOP renderer, i.e. one of Constants.RENDER_*. + * @return the output format for the FOP renderer, i.e. a MIME type. */ - protected abstract int getTargetFormat(); + protected abstract String getTargetFormat(); /** @see org.apache.fop.visual.BitmapProducer */ public BufferedImage produce(File src, ProducerContext context) { diff --git a/test/java/org/apache/fop/visual/BitmapProducerJava2D.java b/test/java/org/apache/fop/visual/BitmapProducerJava2D.java index f2894850d..3fd4cef3a 100644 --- a/test/java/org/apache/fop/visual/BitmapProducerJava2D.java +++ b/test/java/org/apache/fop/visual/BitmapProducerJava2D.java @@ -34,6 +34,7 @@ import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.commons.io.IOUtils; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.Fop; +import org.apache.fop.apps.MimeConstants; import org.apache.fop.fo.Constants; /** @@ -69,7 +70,7 @@ public class BitmapProducerJava2D extends AbstractBitmapProducer implements Conf OutputStream out = new FileOutputStream(outputFile); out = new BufferedOutputStream(out); try { - Fop fop = new Fop(Constants.RENDER_PNG, userAgent); + Fop fop = new Fop(MimeConstants.MIME_PNG, userAgent); fop.setOutputStream(out); SAXResult res = new SAXResult(fop.getDefaultHandler()); diff --git a/test/java/org/apache/fop/visual/BitmapProducerPDF.java b/test/java/org/apache/fop/visual/BitmapProducerPDF.java index 1901d21a8..d5a7b1be8 100644 --- a/test/java/org/apache/fop/visual/BitmapProducerPDF.java +++ b/test/java/org/apache/fop/visual/BitmapProducerPDF.java @@ -18,7 +18,7 @@ package org.apache.fop.visual; -import org.apache.fop.fo.Constants; +import org.apache.fop.apps.MimeConstants; /** * BitmapProducer implementation that uses the PDFRenderer and an external converter @@ -34,8 +34,8 @@ public class BitmapProducerPDF extends AbstractPSPDFBitmapProducer { } /** @see org.apache.fop.visual.AbstractPSPDFBitmapProducer#getTargetFormat() */ - protected int getTargetFormat() { - return Constants.RENDER_PDF; + protected String getTargetFormat() { + return MimeConstants.MIME_PDF; } } diff --git a/test/java/org/apache/fop/visual/BitmapProducerPS.java b/test/java/org/apache/fop/visual/BitmapProducerPS.java index 8db26dea9..b4da31ba5 100644 --- a/test/java/org/apache/fop/visual/BitmapProducerPS.java +++ b/test/java/org/apache/fop/visual/BitmapProducerPS.java @@ -18,7 +18,7 @@ package org.apache.fop.visual; -import org.apache.fop.fo.Constants; +import org.apache.fop.apps.MimeConstants; /** * BitmapProducer implementation that uses the PSRenderer and an external converter @@ -34,8 +34,8 @@ public class BitmapProducerPS extends AbstractPSPDFBitmapProducer { } /** @see org.apache.fop.visual.AbstractPSPDFBitmapProducer#getTargetFormat() */ - protected int getTargetFormat() { - return Constants.RENDER_PS; + protected String getTargetFormat() { + return MimeConstants.MIME_POSTSCRIPT; } |