From: Jeremias Maerki Date: Mon, 24 Jan 2005 14:04:29 +0000 (+0000) Subject: Set base URL so relative URLs work in tests X-Git-Tag: Root_Temp_KnuthStylePageBreaking~199 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=14eb43bbd636739b440a616f9205aab39e9020b0;p=xmlgraphics-fop.git 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 --- 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);