jeremias    2005/01/24 06:04:29

  Modified:    test/java/org/apache/fop/layoutengine
                        LayoutEngineTester.java
  Log:
  Set base URL so relative URLs work in tests
  
  Revision  Changes    Path
  1.5       +6 -2      
xml-fop/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java
  
  Index: LayoutEngineTester.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LayoutEngineTester.java   17 Jan 2005 14:21:10 -0000      1.4
  +++ LayoutEngineTester.java   24 Jan 2005 14:04:29 -0000      1.5
  @@ -20,6 +20,7 @@
   
   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 @@
        * @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 @@
           
           //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);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to