aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2014-04-30 18:20:40 +0000
committerVincent Hennebert <vhennebert@apache.org>2014-04-30 18:20:40 +0000
commitac6fc935d8a34b9933b80093473344aba22bb488 (patch)
tree6a48bdae910696f7c3233f96bec34f114625f791 /test
parent57ccdb8751394586dd27a057feba7ff4039aba38 (diff)
parent25460e0663a0c6dd9ecd5d5f9fc219190ad88a5d (diff)
downloadxmlgraphics-fop-ac6fc935d8a34b9933b80093473344aba22bb488.tar.gz
xmlgraphics-fop-ac6fc935d8a34b9933b80093473344aba22bb488.zip
Brought the branch in sync with rev. 1590916 of trunkTemp_WhitespaceManagement
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_WhitespaceManagement@1591437 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r--test/java/org/apache/fop/events/EventChecker.java2
-rw-r--r--test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java24
-rw-r--r--test/xml/pdf-a/svg-with-transparent-image.fo24
3 files changed, 44 insertions, 6 deletions
diff --git a/test/java/org/apache/fop/events/EventChecker.java b/test/java/org/apache/fop/events/EventChecker.java
index 506658467..c2d5fcfd6 100644
--- a/test/java/org/apache/fop/events/EventChecker.java
+++ b/test/java/org/apache/fop/events/EventChecker.java
@@ -46,7 +46,7 @@ public class EventChecker implements EventListener {
if (id.equals(expectedEventID)) {
eventReceived = true;
for (Map.Entry<String, Object> param : expectedParams.entrySet()) {
- assertEquals(event.getParam(param.getKey()), param.getValue());
+ assertEquals(param.getValue(), event.getParam(param.getKey()));
}
}
}
diff --git a/test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java b/test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java
index b2b77e842..752d666c5 100644
--- a/test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java
+++ b/test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java
@@ -115,15 +115,29 @@ public class PDFAConformanceTestCase extends BasePDFTest {
@Test
public void svgTransparency() throws Exception {
- Map<String, Object> params = new HashMap<String, Object>();
- params.put("pdfProfile", PDFAMode.PDFA_1B);
- EventChecker eventChecker = new EventChecker(SVGEventProducer.class.getName()
- + ".transparencyIgnored", params);
FOUserAgent ua = getUserAgent();
- ua.getEventBroadcaster().addEventListener(eventChecker);
+ EventChecker eventChecker = setupEventChecker(ua, "transparencyIgnored");
File foFile = new File(foBaseDir, "svg-transparency.fo");
convertFO(foFile, ua, dumpPDF);
eventChecker.end();
}
+ @Test
+ public void svgContainingBitmapWithTransparency() throws Exception {
+ FOUserAgent ua = getUserAgent();
+ EventChecker eventChecker = setupEventChecker(ua, "bitmapWithTransparency");
+ File foFile = new File(foBaseDir, "svg-with-transparent-image.fo");
+ convertFO(foFile, ua, dumpPDF);
+ eventChecker.end();
+ }
+
+ private EventChecker setupEventChecker(FOUserAgent ua, String expectedEvent) {
+ Map<String, Object> params = new HashMap<String, Object>();
+ params.put("pdfProfile", PDFAMode.PDFA_1B);
+ EventChecker eventChecker = new EventChecker(SVGEventProducer.class.getName()
+ + "." + expectedEvent, params);
+ ua.getEventBroadcaster().addEventListener(eventChecker);
+ return eventChecker;
+ }
+
}
diff --git a/test/xml/pdf-a/svg-with-transparent-image.fo b/test/xml/pdf-a/svg-with-transparent-image.fo
new file mode 100644
index 000000000..503872224
--- /dev/null
+++ b/test/xml/pdf-a/svg-with-transparent-image.fo
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="Gladiator">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page"
+ page-height="320pt" page-width="420pt" margin="10pt">
+ <fo:region-body display-align="center"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body" text-align="center">
+ <fo:block start-indent="50pt" end-indent="50pt" font-size="15pt" space-after="10pt">SVG
+ referencing a bitmap image that has transparency</fo:block>
+ <fo:block><fo:instream-foreign-object>
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
+ width="100" height="100">
+ <rect x="0" y="0" width="100%" height="100%" fill="none" stroke="black"
+ stroke-width="2"/>
+ <image x="0" y="0" width="100%" height="100%"
+ xlink:href="resources/images/list-item.png"/>
+ </svg>
+ </fo:instream-foreign-object></fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>