aboutsummaryrefslogtreecommitdiffstats
path: root/test/java/org/apache/fop/URIResolutionTestCase.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-08-16 06:51:40 +0000
committerJeremias Maerki <jeremias@apache.org>2005-08-16 06:51:40 +0000
commitcdef475945e30620d029fcb91813b2d681077a17 (patch)
treef9b75294722e50365ab72931f3366e28e6892f9f /test/java/org/apache/fop/URIResolutionTestCase.java
parentbd3680a1e25d8c1a916fa9f58c5ab8d125bd6797 (diff)
downloadxmlgraphics-fop-cdef475945e30620d029fcb91813b2d681077a17.tar.gz
xmlgraphics-fop-cdef475945e30620d029fcb91813b2d681077a17.zip
Bugzilla #36082
Renamed FOUserAgent.getStream() to FOUserAgent.resolveURI() which now simply returns a Source instance which the ImageFactory uses to get at an InputStream somehow. Submitted by: Manuel Mall <mm.at.arcus.com.au> git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@232949 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java/org/apache/fop/URIResolutionTestCase.java')
-rw-r--r--test/java/org/apache/fop/URIResolutionTestCase.java20
1 files changed, 9 insertions, 11 deletions
diff --git a/test/java/org/apache/fop/URIResolutionTestCase.java b/test/java/org/apache/fop/URIResolutionTestCase.java
index 5da3e4932..b19595aed 100644
--- a/test/java/org/apache/fop/URIResolutionTestCase.java
+++ b/test/java/org/apache/fop/URIResolutionTestCase.java
@@ -19,7 +19,6 @@
package org.apache.fop;
import java.io.File;
-import java.io.FileNotFoundException;
import java.io.OutputStream;
import javax.xml.transform.Result;
@@ -75,8 +74,10 @@ public class URIResolutionTestCase extends AbstractFOPTestCase {
Document doc = createAreaTree(foFile, ua);
//Check how many times the resolver was consulted
- assertEquals(1, resolver.successCount);
- assertEquals(0, resolver.failureCount);
+ assertEquals("Expected resolver to do 1 successful URI resolution",
+ 1, resolver.successCount);
+ assertEquals("Expected resolver to do 0 failed URI resolution",
+ 0, resolver.failureCount);
//Additional XPath checking on the area tree
assertEquals("viewport for external-graphic is missing",
"true", evalXPath(doc, "boolean(//flow/block[1]/lineArea/viewport)"));
@@ -89,6 +90,7 @@ public class URIResolutionTestCase extends AbstractFOPTestCase {
* @throws Exception if anything fails
*/
public void testFO2() throws Exception {
+ //TODO This will only work when we can do URI resolution inside Batik!
File foFile = new File(getBaseDir(), "test/xml/uri-resolution2.fo");
FOUserAgent ua = new FOUserAgent();
@@ -115,8 +117,10 @@ public class URIResolutionTestCase extends AbstractFOPTestCase {
}
//Check how many times the resolver was consulted
- assertEquals(1, resolver.successCount);
- assertEquals(0, resolver.failureCount);
+ assertEquals("Expected resolver to do 1 successful URI resolution",
+ 1, resolver.successCount);
+ assertEquals("Expected resolver to do 0 failed URI resolutions",
+ 0, resolver.failureCount);
//Test using PDF as the area tree doesn't invoke Batik so we could check
//if the resolver is actually passed to Batik by FOP
assertTrue("Generated PDF has zero length", baout.size() > 0);
@@ -185,12 +189,6 @@ public class URIResolutionTestCase extends AbstractFOPTestCase {
if ("myimage123".equals(name)) {
File image = new File(getBaseDir(), "test/resources/images/bgimg300dpi.jpg");
StreamSource src = new StreamSource(image);
- try {
- //TODO The next line should not be necessary!!!
- src.setInputStream(new java.io.FileInputStream(image));
- } catch (FileNotFoundException e) {
- throw new TransformerException(e.getMessage(), e);
- }
successCount++;
return src;
} else {