diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2014-04-04 15:52:30 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2014-04-04 15:52:30 +0000 |
commit | 5cae15e0accf7bb753111394ba9870f5b815ab29 (patch) | |
tree | 88932201329ff59d7f7be340b54e2a5d6704dc8f /test/java | |
parent | f8dd89a164228d28afd6080fb37e1f94b3e30a09 (diff) | |
download | xmlgraphics-fop-5cae15e0accf7bb753111394ba9870f5b815ab29.tar.gz xmlgraphics-fop-5cae15e0accf7bb753111394ba9870f5b815ab29.zip |
FOP-2363: Better error message when PDF/A enabled and SVG contains bitmap with transparency
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1584765 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java')
-rw-r--r-- | test/java/org/apache/fop/events/EventChecker.java | 2 | ||||
-rw-r--r-- | test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java | 24 |
2 files changed, 20 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; + } + } |