curcuru     00/12/19 07:01:46

  Modified:    test/java/src/org/apache/qetest/trax TemplatesAPITest.java
                        TransformerAPITest.java
                        TransformerFactoryAPITest.java
               test/java/src/org/apache/qetest/trax/dom
                        DOMResultAPITest.java DOMSourceAPITest.java
  Log:
  Updates to properly use URL's instead of String filenames
  
  Revision  Changes    Path
  1.5       +3 -3      
xml-xalan/test/java/src/org/apache/qetest/trax/TemplatesAPITest.java
  
  Index: TemplatesAPITest.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/test/java/src/org/apache/qetest/trax/TemplatesAPITest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TemplatesAPITest.java     2000/12/12 21:05:50     1.4
  +++ TemplatesAPITest.java     2000/12/19 15:01:34     1.5
  @@ -177,10 +177,10 @@
           String goldBasePath = goldDir + File.separator + TRAX_SUBDIR
                                 + File.separator;
   
  -        simpleTest.xmlName = testBasePath + "TransformerAPIParam.xml";
  -        simpleTest.inputName = testBasePath + "TransformerAPIParam.xsl";
  +        simpleTest.xmlName = filenameToURL(testBasePath + 
"TransformerAPIParam.xml");
  +        simpleTest.inputName = filenameToURL(testBasePath + 
"TransformerAPIParam.xsl");
           simpleTest.goldName = goldBasePath + "TransformerAPIParam.out";
  -        outputFormatXSL = testBasePath + "TransformerAPIOutputFormat.xsl";
  +        outputFormatXSL = filenameToURL(testBasePath + 
"TransformerAPIOutputFormat.xsl");
   
           // Cache trax system property
           saveXSLTProp = System.getProperty(TRAX_PROCESSOR_XSLT);
  
  
  
  1.7       +6 -6      
xml-xalan/test/java/src/org/apache/qetest/trax/TransformerAPITest.java
  
  Index: TransformerAPITest.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/test/java/src/org/apache/qetest/trax/TransformerAPITest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TransformerAPITest.java   2000/12/12 19:57:32     1.6
  +++ TransformerAPITest.java   2000/12/19 15:01:34     1.7
  @@ -199,16 +199,16 @@
           String goldBasePath = goldDir + File.separator + TRAX_SUBDIR
                                 + File.separator;
   
  -        simpleTest.xmlName = testBasePath + "identity.xml";
  -        simpleTest.inputName = testBasePath + "identity.xsl";
  +        simpleTest.xmlName = filenameToURL(testBasePath + "identity.xml");
  +        simpleTest.inputName = filenameToURL(testBasePath + "identity.xsl");
           simpleTest.goldName = goldBasePath + "identity.out";
   
  -        paramTest.xmlName = testBasePath + "TransformerAPIParam.xml";
  -        paramTest.inputName = testBasePath + "TransformerAPIParam.xsl";
  +        paramTest.xmlName = filenameToURL(testBasePath + 
"TransformerAPIParam.xml");
  +        paramTest.inputName = filenameToURL(testBasePath + 
"TransformerAPIParam.xsl");
           paramTest.goldName = goldBasePath + "TransformerAPIParam.out";
           
  -        outputFormatTest.xmlName = testBasePath + 
"TransformerAPIOutputFormat.xml";
  -        outputFormatTest.inputName = testBasePath + 
"TransformerAPIOutputFormat.xsl";
  +        outputFormatTest.xmlName = filenameToURL(testBasePath + 
"TransformerAPIOutputFormat.xml");
  +        outputFormatTest.inputName = filenameToURL(testBasePath + 
"TransformerAPIOutputFormat.xsl");
           outputFormatTest.goldName = goldBasePath + 
"TransformerAPIOutputFormatUTF16.out";
           outputFormatTestUTF8 = goldBasePath + 
"TransformerAPIOutputFormatUTF8.out";
   
  
  
  
  1.3       +4 -4      
xml-xalan/test/java/src/org/apache/qetest/trax/TransformerFactoryAPITest.java
  
  Index: TransformerFactoryAPITest.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/test/java/src/org/apache/qetest/trax/TransformerFactoryAPITest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TransformerFactoryAPITest.java    2000/12/12 22:05:14     1.2
  +++ TransformerFactoryAPITest.java    2000/12/19 15:01:34     1.3
  @@ -82,7 +82,7 @@
   /**
    * API Coverage test for TransformerFactory class of TRAX.
    * @author [EMAIL PROTECTED]
  - * @version $Id: TransformerFactoryAPITest.java,v 1.2 2000/12/12 22:05:14 
curcuru Exp $
  + * @version $Id: TransformerFactoryAPITest.java,v 1.3 2000/12/19 15:01:34 
curcuru Exp $
    */
   public class TransformerFactoryAPITest extends XSLProcessorTestBase
   {
  @@ -148,11 +148,11 @@
                                 + TRAX_SUBDIR
                                 + File.separator;
   
  -        testFileInfo.inputName = testBasePath + "identity.xsl";
  -        testFileInfo.xmlName = testBasePath + "identity.xml";
  +        testFileInfo.inputName = filenameToURL(testBasePath + 
"identity.xsl");
  +        testFileInfo.xmlName = filenameToURL(testBasePath + "identity.xml");
           testFileInfo.goldName = goldBasePath + "identity.out";
   
  -        embeddedFileInfo.xmlName = testBasePath + "embeddedIdentity.xml";
  +        embeddedFileInfo.xmlName = filenameToURL(testBasePath + 
"embeddedIdentity.xml");
           embeddedFileInfo.goldName = goldBasePath + "embeddedIdentity.out";
   
           // Cache the system property
  
  
  
  1.5       +5 -5      
xml-xalan/test/java/src/org/apache/qetest/trax/dom/DOMResultAPITest.java
  
  Index: DOMResultAPITest.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/test/java/src/org/apache/qetest/trax/dom/DOMResultAPITest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DOMResultAPITest.java     2000/12/18 21:37:37     1.4
  +++ DOMResultAPITest.java     2000/12/19 15:01:43     1.5
  @@ -88,7 +88,7 @@
   /**
    * API Coverage test for the DOMResult class of TRAX.
    * @author [EMAIL PROTECTED]
  - * @version $Id: DOMResultAPITest.java,v 1.4 2000/12/18 21:37:37 curcuru Exp 
$
  + * @version $Id: DOMResultAPITest.java,v 1.5 2000/12/19 15:01:43 curcuru Exp 
$
    */
   public class DOMResultAPITest extends XSLProcessorTestBase
   {
  @@ -148,12 +148,12 @@
                                 + TRAX_DOM_SUBDIR
                                 + File.separator;
   
  -        testFileInfo.inputName = testBasePath + "DOMTest.xsl";
  -        testFileInfo.xmlName = testBasePath + "DOMTest.xml";
  +        testFileInfo.inputName = filenameToURL(testBasePath + "DOMTest.xsl");
  +        testFileInfo.xmlName = filenameToURL(testBasePath + "DOMTest.xml");
           testFileInfo.goldName = goldBasePath + "DOMTest.out";
   
  -        impInclFileInfo.inputName = testBasePath + "DOMImpIncl.xsl";
  -        impInclFileInfo.xmlName = testBasePath + "DOMImpIncl.xml";
  +        impInclFileInfo.inputName = filenameToURL(testBasePath + 
"DOMImpIncl.xsl");
  +        impInclFileInfo.xmlName = filenameToURL(testBasePath + 
"DOMImpIncl.xml");
           impInclFileInfo.goldName = testBasePath + "DOMImpIncl.out";
           try
           {
  
  
  
  1.6       +10 -29    
xml-xalan/test/java/src/org/apache/qetest/trax/dom/DOMSourceAPITest.java
  
  Index: DOMSourceAPITest.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/test/java/src/org/apache/qetest/trax/dom/DOMSourceAPITest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DOMSourceAPITest.java     2000/12/18 17:47:37     1.5
  +++ DOMSourceAPITest.java     2000/12/19 15:01:43     1.6
  @@ -88,7 +88,7 @@
   /**
    * API Coverage test for the DOMSource class of TRAX.
    * @author [EMAIL PROTECTED]
  - * @version $Id: DOMSourceAPITest.java,v 1.5 2000/12/18 17:47:37 curcuru Exp 
$
  + * @version $Id: DOMSourceAPITest.java,v 1.6 2000/12/19 15:01:43 curcuru Exp 
$
    */
   public class DOMSourceAPITest extends XSLProcessorTestBase
   {
  @@ -148,12 +148,12 @@
                                 + TRAX_DOM_SUBDIR
                                 + File.separator;
   
  -        testFileInfo.inputName = testBasePath + "DOMTest.xsl";
  -        testFileInfo.xmlName = testBasePath + "DOMTest.xml";
  +        testFileInfo.inputName = filenameToURL(testBasePath + "DOMTest.xsl");
  +        testFileInfo.xmlName = filenameToURL(testBasePath + "DOMTest.xml");
           testFileInfo.goldName = goldBasePath + "DOMTest.out";
   
  -        impInclFileInfo.inputName = testBasePath + "DOMImpIncl.xsl";
  -        impInclFileInfo.xmlName = testBasePath + "DOMImpIncl.xml";
  +        impInclFileInfo.inputName = filenameToURL(testBasePath + 
"DOMImpIncl.xsl");
  +        impInclFileInfo.xmlName = filenameToURL(testBasePath + 
"DOMImpIncl.xml");
           impInclFileInfo.goldName = goldBasePath + "DOMImpIncl.out";
   
           try
  @@ -350,11 +350,12 @@
           {
               // Setting SystemId with imports/inclues
               DOMSource xslDOM = new DOMSource(xslImpInclNode);
  -            xslDOM.setSystemId(filenameToURI(impInclFileInfo.inputName));
  +            // Note that inputName, xmlName are already URL'd
  +            xslDOM.setSystemId(impInclFileInfo.inputName);
               transformerXSL = factory.newTransformer(xslDOM);
               DOMSource xmlDOM = new DOMSource(xmlImpInclNode);
               // Do we really need to set SystemId on both XML and XSL?
  -            xmlDOM.setSystemId(filenameToURI(impInclFileInfo.xmlName));
  +            xmlDOM.setSystemId(impInclFileInfo.xmlName);
               DOMResult emptyResult = new DOMResult();
               reporter.logTraceMsg("About to transformXSLImpIncl(xmlDOM, 
emptyResult)");
               transformerXSL.transform(xmlDOM, emptyResult);
  @@ -479,9 +480,9 @@
   
               // Use same Sources, but change Nodes for xml,xsl
               xmlSource.setNode(xmlImpInclNode);
  -            xmlSource.setSystemId(filenameToURI(impInclFileInfo.xmlName));
  +            xmlSource.setSystemId(impInclFileInfo.xmlName);
               xslSource.setNode(xslImpInclNode);
  -            xslSource.setSystemId(filenameToURI(impInclFileInfo.inputName));
  +            xslSource.setSystemId(impInclFileInfo.inputName);
               Transformer transformer2 = factory.newTransformer(xslSource);
               DOMResult result2 = new DOMResult(docBuilder.newDocument());
               transformer2.transform(xmlSource, result2);
  @@ -555,26 +556,6 @@
           DocumentBuilderFactory dfactory = 
DocumentBuilderFactory.newInstance();
           dfactory.setNamespaceAware(true);
           d = dfactory.newDocumentBuilder();
  -    }
  -
  -
  -    /**
  -     * Worker method to translate String to URI.  
  -     * Note: Xerces and Crimson appear to handle some URI references 
  -     * differently - this method needs further work once we figure out 
  -     * exactly what kind of format each parser wants (esp. considering 
  -     * relative vs. absolute references).
  -     * @param String path\filename of test file
  -     * @return URL to pass to SystemId
  -     */
  -    public String filenameToURI(String filename)
  -    {
  -        File f = new File(filename);
  -        String tmp = f.getAbsolutePath();
  -         if (File.separatorChar == '\\') {
  -             tmp = tmp.replace('\\', '/');
  -         }
  -        return "file:///" + tmp;
       }
   
   
  
  
  

Reply via email to