ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/types XMLCatalogTest.java
Date Sun, 26 May 2002 01:03:58 GMT
ehatcher    02/05/25 18:03:58

  Modified:    src/testcases/org/apache/tools/ant/types Tag: ANT_15_BRANCH
                        XMLCatalogTest.java
  Log:
  Craeg's patch to fix the test case.  Ah, much better!
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +16 -75    jakarta-ant/src/testcases/org/apache/tools/ant/types/Attic/XMLCatalogTest.java
  
  Index: XMLCatalogTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/types/Attic/XMLCatalogTest.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- XMLCatalogTest.java	24 May 2002 15:47:57 -0000	1.1.2.1
  +++ XMLCatalogTest.java	26 May 2002 01:03:58 -0000	1.1.2.2
  @@ -57,6 +57,7 @@
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.DefaultLogger;
   import org.apache.tools.ant.Project;
  +import org.apache.tools.ant.util.FileUtils;
   
   import junit.framework.TestCase;
   
  @@ -74,12 +75,13 @@
    * JUnit testcases for org.apache.tools.ant.types.XMLCatalog
    *
    * @author <a href="mailto:cstrong@arielpartners.com">Craeg Strong</a> 
  - * @version $Id: XMLCatalogTest.java,v 1.1.2.1 2002/05/24 15:47:57 ehatcher Exp $
  + * @version $Id: XMLCatalogTest.java,v 1.1.2.2 2002/05/26 01:03:58 ehatcher Exp $
    */
   public class XMLCatalogTest extends TestCase {
   
       private Project project;
       private XMLCatalog catalog;
  +    private FileUtils fileUtils = FileUtils.newFileUtils();
   
       private XMLCatalog newCatalog() {
           XMLCatalog cat = new XMLCatalog();
  @@ -87,6 +89,10 @@
           return cat;
       }
   
  +    private String toURLString(File file) throws MalformedURLException {
  +		  return fileUtils.getFileURL(file).toString();
  +    }
  +
       public XMLCatalogTest(String name) {
           super(name);
       }
  @@ -240,18 +246,8 @@
               InputSource result = catalog.resolveEntity("-//stevo//DTD doc 1.0//EN",
                                                          "nap:chemical+brothers");
               assertNotNull(result);
  -/*
  -The following is failing with this:
  -
  -Testcase: testSimpleEntry took 0 sec
  -        FAILED
  -expected:<file:/C:/ant1.5Beta/jakarta-ant/src/etc/testcases/taskdefs/optional/xm
  -l/doc.dtd> but was:<file:C:/ant1.5Beta/jakarta-ant/src/etc/testcases/taskdefs/op
  -tional/xml/doc.dtd>
  -
  -            assertEquals(dtdFile.toURL().toString(),
  +            assertEquals(toURLString(dtdFile),
                            result.getSystemId());
  -*/
           } catch (Exception e) {
               fail("resolveEntity() failed!" + e.toString());
           }
  @@ -293,18 +289,8 @@
                                                           "nap:chemical+brothers");
   
               assertNotNull(result);
  -/*
  -The following is failing with this:
  -
  -Testcase: testEntryReference took 0 sec
  -        FAILED
  -expected:<file:/C:/ant1.5Beta/jakarta-ant/src/etc/testcases/taskdefs/optional/xm
  -l/doc.dtd> but was:<file:C:/ant1.5Beta/jakarta-ant/src/etc/testcases/taskdefs/op
  -tional/xml/doc.dtd>
  -
  -            assertEquals(dtdFile.toURL().toString(),
  +            assertEquals(toURLString(dtdFile),
                            result.getSystemId());
  -*/
           } catch (Exception e) {
               fail("resolveEntity() failed!" + e.toString());
           }
  @@ -312,18 +298,8 @@
           try {
               Source result = catalog.resolve(uri, null);
               assertNotNull(result);
  -/*
  -The following is failing with:
  -
  -Testcase: testEntryReference took 0 sec
  -        FAILED
  -expected:<file:/C:/ant1.5Beta/jakarta-ant/src/etc/testcases/taskdefs/optional/xm
  -l/doc.dtd> but was:<file:C:/ant1.5Beta/jakarta-ant/src/etc/testcases/taskdefs/op
  -tional/xml/doc.dtd>
  -
  -            assertEquals(xmlFile.toURL().toString(),
  +            assertEquals(toURLString(xmlFile),
                            result.getSystemId());
  -*/
           } catch (Exception e) {
               fail("resolve() failed!" + e.toString());
           }
  @@ -356,17 +332,8 @@
               InputSource result = catalog1.resolveEntity(publicId,
                                                           "nap:chemical+brothers");
               assertNotNull(result);
  -/*
  -The following is failing with:
  -Testcase: testNestedCatalog took 0 sec
  -        FAILED
  -expected:<file:/C:/ant1.5Beta/jakarta-ant/src/etc/testcases/taskdefs/optional/xm
  -l/doc.dtd> but was:<file:C:/ant1.5Beta/jakarta-ant/src/etc/testcases/taskdefs/op
  -tional/xml/doc.dtd>
  -
  -            assertEquals(dtdFile.toURL().toString(),
  +            assertEquals(toURLString(dtdFile),
                            result.getSystemId());
  -*/
           } catch (Exception e) {
               fail("resolveEntity() failed!" + e.toString());
           }
  @@ -374,17 +341,8 @@
           try {
               Source result = catalog.resolve(uri, null);
               assertNotNull(result);
  -/*
  -The following is failing with:
  -Testcase: testNestedCatalog took 0.01 sec
  -        FAILED
  -expected:<file:/C:/ant1.5Beta/jakarta-ant/src/etc/testcases/taskdefs/optional/xm
  -l/about.xml> but was:<file:C:/ant1.5Beta/jakarta-ant/src/etc/testcases/taskdefs/
  -optional/xml/about.xml>
  -
  -            assertEquals(xmlFile.toURL().toString(),
  +            assertEquals(toURLString(xmlFile),
                            result.getSystemId());
  -*/
           } catch (Exception e) {
               fail("resolve() failed!" + e.toString());
           }
  @@ -397,7 +355,7 @@
           String uriLoc = "etc/testcases/taskdefs/optional/xml/about.xml";
           String base = null;
           try {
  -            base = project.getBaseDir().toURL().toString() + "src/";
  +            base = toURLString(project.getBaseDir()) + "src/";
           } catch (MalformedURLException ex) {
               fail (ex.toString());
           }
  @@ -411,7 +369,7 @@
           try {
               Source result = catalog.resolve(uri, base);
               assertNotNull(result);
  -            assertEquals(xmlFile.toURL().toString(),
  +            assertEquals(toURLString(xmlFile),
                            result.getSystemId());
           } catch (Exception e) {
               fail("resolve() failed!" + e.toString());
  @@ -449,16 +407,8 @@
               InputSource result = catalog.resolveEntity(publicId,
                                                          "nap:chemical+brothers");
               assertNotNull(result);
  -/*
  -The following failed with:
  -Testcase: testClasspath took 0.01 sec
  -        FAILED
  -expected:<file:/C:/ant1.5Beta/jakarta-ant/src/etc/testcases/taskdefs/optional/xm
  -l/doc.dtd> but was:<file:C:/ant1.5Beta/jakarta-ant/src/etc/testcases/taskdefs/op
  -tional/xml/doc.dtd>
  -            assertEquals(dtdFile.toURL().toString(),
  +            assertEquals(toURLString(dtdFile),
                            result.getSystemId());
  -*/
           } catch (Exception e) {
               fail("resolveEntity() failed!" + e.toString());
           }
  @@ -466,17 +416,8 @@
           try {
               Source result = catalog.resolve(uri, null);
               assertNotNull(result);
  -/*
  -The following failed with:
  -Testcase: testClasspath took 0.01 sec
  -        FAILED
  -expected:<file:/C:/ant1.5Beta/jakarta-ant/src/etc/testcases/taskdefs/optional/xm
  -l/about.xml> but was:<file:C:/ant1.5Beta/jakarta-ant/src/etc/testcases/taskdefs/
  -optional/xml/about.xml>
  -
  -            assertEquals(xmlFile.toURL().toString(),
  +            assertEquals(toURLString(xmlFile),
                            result.getSystemId());
  -*/
           } catch (Exception e) {
               fail("resolve() failed!" + e.toString());
           }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message