aboutsummaryrefslogtreecommitdiffstats
path: root/test/java
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2009-08-14 10:44:29 +0000
committerVincent Hennebert <vhennebert@apache.org>2009-08-14 10:44:29 +0000
commit13c85d5622ee46c032acbf2e3e1204706499a734 (patch)
tree310b6b40dd534410104d067f72e9611d3a22ef87 /test/java
parent40af8ffb2a374456d335f96770bba02fc17ae0d8 (diff)
downloadxmlgraphics-fop-13c85d5622ee46c032acbf2e3e1204706499a734.tar.gz
xmlgraphics-fop-13c85d5622ee46c032acbf2e3e1204706499a734.zip
Added tests for 2, 3, 4 values specified in the page boundaries properties.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@804159 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java')
-rw-r--r--test/java/org/apache/fop/render/extensions/prepress/PageBoundariesTest.java52
1 files changed, 51 insertions, 1 deletions
diff --git a/test/java/org/apache/fop/render/extensions/prepress/PageBoundariesTest.java b/test/java/org/apache/fop/render/extensions/prepress/PageBoundariesTest.java
index 73c8136c0..5cd23c17e 100644
--- a/test/java/org/apache/fop/render/extensions/prepress/PageBoundariesTest.java
+++ b/test/java/org/apache/fop/render/extensions/prepress/PageBoundariesTest.java
@@ -41,7 +41,6 @@ public class PageBoundariesTest extends TestCase {
* Default constructor.
*/
public PageBoundariesTest() {
- throw new UnsupportedOperationException("Not implemented"); // TODO
}
/**
@@ -86,6 +85,57 @@ public class PageBoundariesTest extends TestCase {
assertEquals(bleedBox, boundaries.getMediaBox());
}
+ /** Two values for the properties. */
+ public void testBoundaries2Values() {
+ PageBoundaries boundaries = new PageBoundaries(
+ TEST_AREA_SIZE, "5pt 10pt", "6pt \t 12pt", null);
+ Rectangle bleedBox = boundaries.getBleedBox();
+ assertEquals(-10000, bleedBox.x);
+ assertEquals(-5000, bleedBox.y);
+ assertEquals(40000, bleedBox.width);
+ assertEquals(25000, bleedBox.height);
+
+ Rectangle mediaBox = boundaries.getMediaBox();
+ assertEquals(-12000, mediaBox.x);
+ assertEquals(-6000, mediaBox.y);
+ assertEquals(44000, mediaBox.width);
+ assertEquals(27000, mediaBox.height);
+ }
+
+ /** Three values for the properties. */
+ public void testBoundaries3Values() {
+ PageBoundaries boundaries = new PageBoundaries(
+ TEST_AREA_SIZE, "5pt 10pt 7pt", "6pt \t 12pt 14pt", null);
+ Rectangle bleedBox = boundaries.getBleedBox();
+ assertEquals(-10000, bleedBox.x);
+ assertEquals(-5000, bleedBox.y);
+ assertEquals(40000, bleedBox.width);
+ assertEquals(27000, bleedBox.height);
+
+ Rectangle mediaBox = boundaries.getMediaBox();
+ assertEquals(-12000, mediaBox.x);
+ assertEquals(-6000, mediaBox.y);
+ assertEquals(44000, mediaBox.width);
+ assertEquals(35000, mediaBox.height);
+ }
+
+ /** Four values for the properties. */
+ public void testBoundaries4Values() {
+ PageBoundaries boundaries = new PageBoundaries(
+ TEST_AREA_SIZE, "5pt 6pt 7pt 8pt", "9pt 10pt 11pt 12pt", null);
+ Rectangle bleedBox = boundaries.getBleedBox();
+ assertEquals(-8000, bleedBox.x);
+ assertEquals(-5000, bleedBox.y);
+ assertEquals(34000, bleedBox.width);
+ assertEquals(27000, bleedBox.height);
+
+ Rectangle mediaBox = boundaries.getMediaBox();
+ assertEquals(-12000, mediaBox.x);
+ assertEquals(-9000, mediaBox.y);
+ assertEquals(42000, mediaBox.width);
+ assertEquals(35000, mediaBox.height);
+ }
+
/** Test for the different values of crop-box. */
public void testCropBox() {
PageBoundaries boundaries = new PageBoundaries(TEST_AREA_SIZE, BLEED, CROP_OFFSET, null);