diff options
author | Peter Hancock <phancock@apache.org> | 2012-09-13 12:45:27 +0000 |
---|---|---|
committer | Peter Hancock <phancock@apache.org> | 2012-09-13 12:45:27 +0000 |
commit | d99dc75ffa1d37817ce18cff188fdabc29f9f73e (patch) | |
tree | 57e54bc96b79ce2980a5ed00afb0bd5ff313aab6 /test/java | |
parent | 03bedaf0caa6c39823437e43b2f8547d476d24e7 (diff) | |
download | xmlgraphics-fop-d99dc75ffa1d37817ce18cff188fdabc29f9f73e.tar.gz xmlgraphics-fop-d99dc75ffa1d37817ce18cff188fdabc29f9f73e.zip |
Bugzilla #53865: Add Rows per Strip configuration for Tiff renderer
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1384310 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java')
3 files changed, 29 insertions, 3 deletions
diff --git a/test/java/org/apache/fop/apps/TIFFRendererConfBuilder.java b/test/java/org/apache/fop/apps/TIFFRendererConfBuilder.java index 8b72a558d..f39df2988 100644 --- a/test/java/org/apache/fop/apps/TIFFRendererConfBuilder.java +++ b/test/java/org/apache/fop/apps/TIFFRendererConfBuilder.java @@ -20,7 +20,7 @@ package org.apache.fop.apps; import static org.apache.fop.render.bitmap.TIFFRendererConfig.TIFFRendererOption.COMPRESSION; - +import static org.apache.fop.render.bitmap.TIFFRendererConfig.TIFFRendererOption.SINGLE_STRIP; public class TIFFRendererConfBuilder extends BitmapRendererConfBuilder { public TIFFRendererConfBuilder() { @@ -31,4 +31,9 @@ public class TIFFRendererConfBuilder extends BitmapRendererConfBuilder { createTextElement(COMPRESSION, mode); return this; } + + public TIFFRendererConfBuilder setSingleStrip(boolean single) { + createTextElement(SINGLE_STRIP, String.valueOf(single)); + return this; + } } diff --git a/test/java/org/apache/fop/render/bitmap/TIFFRendererConfigParserTestCase.java b/test/java/org/apache/fop/render/bitmap/TIFFRendererConfigParserTestCase.java index 487b8cb9f..69326559e 100644 --- a/test/java/org/apache/fop/render/bitmap/TIFFRendererConfigParserTestCase.java +++ b/test/java/org/apache/fop/render/bitmap/TIFFRendererConfigParserTestCase.java @@ -26,9 +26,11 @@ import org.apache.fop.apps.TIFFRendererConfBuilder; import org.apache.fop.render.bitmap.TIFFRendererConfig.TIFFRendererConfigParser; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; public class TIFFRendererConfigParserTestCase - extends AbstractBitmapRendererConfigParserTester { +extends AbstractBitmapRendererConfigParserTester { public TIFFRendererConfigParserTestCase() { super(new TIFFRendererConfigParser()); @@ -52,4 +54,12 @@ public class TIFFRendererConfigParserTestCase assertEquals(value, getConfig().getCompressionType()); } } + + @Test + public void testSingleStrip() throws Exception { + parseConfig(createRenderer().setSingleStrip(true)); + assertTrue(getConfig().isSingleStrip()); + parseConfig(createRenderer().setSingleStrip(false)); + assertFalse(getConfig().isSingleStrip()); + } } diff --git a/test/java/org/apache/fop/render/bitmap/TIFFRendererConfiguratorTestCase.java b/test/java/org/apache/fop/render/bitmap/TIFFRendererConfiguratorTestCase.java index c97d73333..3e6c951a6 100644 --- a/test/java/org/apache/fop/render/bitmap/TIFFRendererConfiguratorTestCase.java +++ b/test/java/org/apache/fop/render/bitmap/TIFFRendererConfiguratorTestCase.java @@ -23,7 +23,6 @@ import java.awt.image.BufferedImage; import org.junit.Test; -import static org.junit.Assert.assertEquals; import org.apache.fop.apps.FopConfBuilder; import org.apache.fop.apps.MimeConstants; @@ -32,6 +31,9 @@ import org.apache.fop.render.bitmap.TIFFRendererConfig.TIFFRendererConfigParser; import static org.apache.fop.render.bitmap.TIFFCompressionValue.CCITT_T4; import static org.apache.fop.render.bitmap.TIFFCompressionValue.CCITT_T6; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; public class TIFFRendererConfiguratorTestCase extends AbstractBitmapRendererConfiguratorTest { @@ -61,4 +63,13 @@ public class TIFFRendererConfiguratorTestCase extends AbstractBitmapRendererConf } } } + + @Test + public void testSingleStrip() throws Exception { + parseConfig(createBuilder().setSingleStrip(true)); + assertTrue(settings.getWriterParams().isSingleStrip()); + parseConfig(createBuilder().setSingleStrip(false)); + assertFalse(settings.getWriterParams().isSingleStrip()); + } + } |