diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-01-24 14:04:29 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-01-24 14:04:29 +0000 |
commit | 14eb43bbd636739b440a616f9205aab39e9020b0 (patch) | |
tree | d6662bb0352249babab6b0e62b4653edeb0dab65 | |
parent | 0a3e53b3e080d8b5d8659579dec67187bb2377f8 (diff) | |
download | xmlgraphics-fop-14eb43bbd636739b440a616f9205aab39e9020b0.tar.gz xmlgraphics-fop-14eb43bbd636739b440a616f9205aab39e9020b0.zip |
Set base URL so relative URLs work in tests
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198308 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | test/java/org/apache/fop/layoutengine/LayoutEngineTester.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java b/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java index 00a966aee..f8ac4b9e4 100644 --- a/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java +++ b/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java @@ -20,6 +20,7 @@ package org.apache.fop.layoutengine; import java.io.File; import java.lang.reflect.Constructor; +import java.net.MalformedURLException; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -101,8 +102,10 @@ public class LayoutEngineTester { * @param testFile Test case to run * @throws TransformerException In case of an XSLT/JAXP problem * @throws FOPException In case of a FOP problem + * @throws MalformedURLException if the base URL cannot be set */ - public void runTest(File testFile) throws TransformerException, FOPException { + public void runTest(File testFile) + throws TransformerException, FOPException, MalformedURLException { //Setup Transformer to convert the testcase XML to XSL-FO Transformer transformer = getTestcase2FOStylesheet().newTransformer(); Source src = new StreamSource(testFile); @@ -114,6 +117,7 @@ public class LayoutEngineTester { //Setup FOP for area tree rendering FOUserAgent ua = new FOUserAgent(); + ua.setBaseURL(testFile.getParentFile().toURL().toString()); XMLRenderer atrenderer = new XMLRenderer(); atrenderer.setUserAgent(ua); atrenderer.setTransformerHandler(athandler); |