diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2010-08-25 15:43:55 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2010-08-25 15:43:55 +0000 |
commit | 26393f0e181ca1c71c83e594fa67cc7c26b49df3 (patch) | |
tree | 6cd752956d970f04c9f0ff8892c820014423a1e5 /test/java/org/apache/fop/render | |
parent | b35843cb0d2d655a20929b96737ee736924afe5e (diff) | |
download | xmlgraphics-fop-26393f0e181ca1c71c83e594fa67cc7c26b49df3.tar.gz xmlgraphics-fop-26393f0e181ca1c71c83e594fa67cc7c26b49df3.zip |
Removed old Renderer implementations for AFP, PCL, PDF, PS.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@989178 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java/org/apache/fop/render')
3 files changed, 9 insertions, 76 deletions
diff --git a/test/java/org/apache/fop/render/RendererFactoryTest.java b/test/java/org/apache/fop/render/RendererFactoryTest.java index 4a40ac7c1..6b8e8f5f3 100644 --- a/test/java/org/apache/fop/render/RendererFactoryTest.java +++ b/test/java/org/apache/fop/render/RendererFactoryTest.java @@ -33,7 +33,6 @@ import org.apache.fop.render.intermediate.IFContext; import org.apache.fop.render.intermediate.IFDocumentHandler; import org.apache.fop.render.intermediate.IFRenderer; import org.apache.fop.render.pdf.PDFDocumentHandler; -import org.apache.fop.render.pdf.PDFRenderer; import org.apache.fop.render.rtf.RTFHandler; /** @@ -73,29 +72,15 @@ public class RendererFactoryTest extends TestCase { RendererFactory factory = fopFactory.getRendererFactory(); FOUserAgent ua; Renderer renderer; - Renderer overrideRenderer; ua = fopFactory.newFOUserAgent(); renderer = factory.createRenderer(ua, MimeConstants.MIME_PDF); assertTrue(renderer instanceof IFRenderer); - factory.setRendererPreferred(true); //Test legacy setting - ua = fopFactory.newFOUserAgent(); - renderer = factory.createRenderer(ua, MimeConstants.MIME_PDF); - assertTrue(renderer instanceof PDFRenderer); - ua = fopFactory.newFOUserAgent(); renderer = factory.createRenderer(ua, MimeConstants.MIME_FOP_IF); assertTrue(renderer instanceof IFRenderer); - factory.setRendererPreferred(false); - ua = fopFactory.newFOUserAgent(); - overrideRenderer = new PDFRenderer(); - overrideRenderer.setUserAgent(ua); - ua.setRendererOverride(overrideRenderer); - renderer = factory.createRenderer(ua, null); - assertTrue(renderer == overrideRenderer); - ua = fopFactory.newFOUserAgent(); IFDocumentHandler overrideHandler; overrideHandler = new PDFDocumentHandler(); diff --git a/test/java/org/apache/fop/render/ps/ImageHandlingTestCase.java b/test/java/org/apache/fop/render/ps/ImageHandlingTestCase.java index 7f0462a75..72c677a0c 100644 --- a/test/java/org/apache/fop/render/ps/ImageHandlingTestCase.java +++ b/test/java/org/apache/fop/render/ps/ImageHandlingTestCase.java @@ -43,52 +43,22 @@ import org.apache.fop.render.intermediate.IFContext; public class ImageHandlingTestCase extends AbstractPostScriptTestCase { /** - * Tests JPEG handling with the {@link PSRenderer}. + * Tests JPEG handling. * @throws Exception if an error occurs */ - public void testJPEGImageWithRendererLevel3() throws Exception { - innerTestJPEGImageWithRenderer(3); + public void testJPEGImageLevel3() throws Exception { + innerTestJPEGImage(3); } /** - * Tests JPEG handling with the {@link PSRenderer}. + * Tests JPEG handling. * @throws Exception if an error occurs */ - public void testJPEGImageWithRendererLevel2() throws Exception { - innerTestJPEGImageWithRenderer(2); + public void testJPEGImageLevel2() throws Exception { + innerTestJPEGImage(2); } - /** - * Tests JPEG handling with the {@link PSDocumentHandler}. - * @throws Exception if an error occurs - */ - public void testJPEGImageWithIFLevel3() throws Exception { - innerTestJPEGImageWithIF(3); - } - - /** - * Tests JPEG handling with the {@link PSDocumentHandler}. - * @throws Exception if an error occurs - */ - public void testJPEGImageWithIFLevel2() throws Exception { - innerTestJPEGImageWithIF(2); - } - - private void innerTestJPEGImageWithRenderer(int level) throws Exception { - FOUserAgent ua = fopFactory.newFOUserAgent(); - PSRenderer renderer = new PSRenderer(); - renderer.setUserAgent(ua); - PSRenderingUtil psUtil = renderer.getPSUtil(); - psUtil.setLanguageLevel(level); - psUtil.setOptimizeResources(true); - ua.setRendererOverride(renderer); - - // Prepare output file - File outputFile = renderFile(ua, "ps-jpeg-image.fo", "-rend-l" + psUtil.getLanguageLevel()); - verifyPostScriptFile(outputFile, psUtil.getLanguageLevel()); - } - - private void innerTestJPEGImageWithIF(int level) throws Exception { + private void innerTestJPEGImage(int level) throws Exception { FOUserAgent ua = fopFactory.newFOUserAgent(); PSDocumentHandler handler = new PSDocumentHandler(); handler.setContext(new IFContext(ua)); @@ -159,10 +129,6 @@ public class ImageHandlingTestCase extends AbstractPostScriptTestCase { } } - private void assertMatches(String text, String regex) { - assertTrue("Text didn't match '" + regex + "'", text.matches(regex)); - } - private void assertContains(String text, String searchString) { assertTrue("Text doesn't contain '" + searchString + "'", text.indexOf(searchString) >= 0); } diff --git a/test/java/org/apache/fop/render/ps/ResourceOptimizationTestCase.java b/test/java/org/apache/fop/render/ps/ResourceOptimizationTestCase.java index e5b9a4d27..862ad5205 100644 --- a/test/java/org/apache/fop/render/ps/ResourceOptimizationTestCase.java +++ b/test/java/org/apache/fop/render/ps/ResourceOptimizationTestCase.java @@ -54,28 +54,10 @@ import org.apache.fop.render.intermediate.IFContext; public class ResourceOptimizationTestCase extends AbstractPostScriptTestCase { /** - * Tests resource optimization with the {@link PSRenderer}. + * Tests resource optimization. * @throws Exception if an error occurs */ - public void testResourceOptimizationWithRenderer() throws Exception { - FOUserAgent ua = fopFactory.newFOUserAgent(); - PSRenderer renderer = new PSRenderer(); - renderer.setUserAgent(ua); - // This is the important part: we're enabling resource optimization - renderer.getPSUtil().setOptimizeResources(true); - ua.setRendererOverride(renderer); - - // Prepare output file - File outputFile = renderFile(ua, "ps-resources.fo", - "-rend-l" + renderer.getPSUtil().getLanguageLevel()); - verifyPostScriptFile(outputFile); - } - - /** - * Tests resource optimization with the {@link PSDocumentHandler}. - * @throws Exception if an error occurs - */ - public void testResourceOptimizationWithIF() throws Exception { + public void testResourceOptimization() throws Exception { FOUserAgent ua = fopFactory.newFOUserAgent(); PSDocumentHandler handler = new PSDocumentHandler(); handler.setContext(new IFContext(ua)); |