aboutsummaryrefslogtreecommitdiffstats
path: root/fop-core/src/test
diff options
context:
space:
mode:
authorSimon Steiner <ssteiner@apache.org>2022-05-16 11:30:52 +0000
committerSimon Steiner <ssteiner@apache.org>2022-05-16 11:30:52 +0000
commit0b15f2e0999a587727ac23a707512046dfb1fec8 (patch)
tree9bbe0f51ccfc11021665bde344e29609bfb554cc /fop-core/src/test
parentc2922dc45884758f516eca126e669c6e98c491e2 (diff)
downloadxmlgraphics-fop-0b15f2e0999a587727ac23a707512046dfb1fec8.tar.gz
xmlgraphics-fop-0b15f2e0999a587727ac23a707512046dfb1fec8.zip
FOP-3071: Write mediummap before pagegroup
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1900949 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'fop-core/src/test')
-rw-r--r--fop-core/src/test/java/org/apache/fop/afp/DataStreamTestCase.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/fop-core/src/test/java/org/apache/fop/afp/DataStreamTestCase.java b/fop-core/src/test/java/org/apache/fop/afp/DataStreamTestCase.java
index 4c6eae921..702126989 100644
--- a/fop-core/src/test/java/org/apache/fop/afp/DataStreamTestCase.java
+++ b/fop-core/src/test/java/org/apache/fop/afp/DataStreamTestCase.java
@@ -108,4 +108,20 @@ public class DataStreamTestCase {
Assert.assertEquals((byte)data.read(), InvokeMediumMap.Type.MAP);
Assert.assertEquals((byte)data.read(), InvokeMediumMap.Category.MEDIUM_MAP);
}
+
+ @Test
+ public void testMediumMapBeforePageGroupOnDocument() throws Exception {
+ ds = new DataStream(new Factory(), paintState, outStream);
+ ds.startDocument();
+ ds.createInvokeMediumMap("test");
+ ds.startPageGroup();
+ ds.startPage(1, 1, 0, 1, 1);
+ ds.endPage();
+ ds.endPageGroup();
+ ds.endDocument();
+ ByteArrayInputStream data = new ByteArrayInputStream(outStream.toByteArray());
+ data.skip(21);
+ Assert.assertEquals((byte)data.read(), InvokeMediumMap.Type.MAP);
+ Assert.assertEquals((byte)data.read(), InvokeMediumMap.Category.MEDIUM_MAP);
+ }
}