diff options
author | Simon Steiner <ssteiner@apache.org> | 2020-02-11 13:41:06 +0000 |
---|---|---|
committer | Simon Steiner <ssteiner@apache.org> | 2020-02-11 13:41:06 +0000 |
commit | 43219348518d68482fdb7f92eeedb5b6102fef57 (patch) | |
tree | 9df7df003129a305f917038ddc14f52d73ce01aa /fop-core/src/test | |
parent | d1022f8e33ad8c234c13e7109fba2fe5797f5a64 (diff) | |
download | xmlgraphics-fop-43219348518d68482fdb7f92eeedb5b6102fef57.tar.gz xmlgraphics-fop-43219348518d68482fdb7f92eeedb5b6102fef57.zip |
FOP-2911: Add endpage event for FO to IF
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1873909 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'fop-core/src/test')
-rw-r--r-- | fop-core/src/test/java/org/apache/fop/render/intermediate/IFSerializerTestCase.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fop-core/src/test/java/org/apache/fop/render/intermediate/IFSerializerTestCase.java b/fop-core/src/test/java/org/apache/fop/render/intermediate/IFSerializerTestCase.java index 0340c190e..0dbcddbdf 100644 --- a/fop-core/src/test/java/org/apache/fop/render/intermediate/IFSerializerTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/render/intermediate/IFSerializerTestCase.java @@ -20,6 +20,9 @@ package org.apache.fop.render.intermediate; import java.awt.Rectangle; +import java.io.File; +import java.util.HashMap; +import java.util.Map; import javax.xml.transform.sax.SAXResult; @@ -38,6 +41,9 @@ import org.apache.xmlgraphics.image.loader.ImageManager; import org.apache.xmlgraphics.image.loader.ImageSessionContext; import org.apache.fop.apps.FOUserAgent; +import org.apache.fop.apps.FopFactory; +import org.apache.fop.events.EventChecker; +import org.apache.fop.render.afp.AFPDocumentHandler; public class IFSerializerTestCase { @@ -90,4 +96,16 @@ public class IFSerializerTestCase { verify(imageManager).closeImage(eq(IMAGE), any(ImageSessionContext.class)); } + @Test + public void testPageEvent() throws IFException { + FOUserAgent userAgent = FopFactory.newInstance(new File(".").toURI()).newFOUserAgent(); + Map<String, Object> params = new HashMap<String, Object>(); + params.put("number", 1); + EventChecker eventChecker = new EventChecker("org.apache.fop.render.RendererEventProducer.endPage", params); + userAgent.getEventBroadcaster().addEventListener(eventChecker); + sut.mimicDocumentHandler(new AFPDocumentHandler(new IFContext(userAgent))); + sut.setResult(new SAXResult(new DefaultHandler())); + sut.endPage(); + eventChecker.end(); + } } |