https://issues.apache.org/bugzilla/show_bug.cgi?id=52754

             Bug #: 52754
           Summary: XMLCatalog.ExternalResolver handles CWD differently
                    than InternalResolver
           Product: Ant
           Version: 1.8.3
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Core tasks
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified


cd /tmp && ant -f .../build.xml
-Dtestcase='org.apache.tools.ant.types.XMLCatalogTest' test

fails:

junit.framework.AssertionFailedError: Empty catalog should return input with a
system ID like file:/.../i/dont/exist.dtd but was tmp/i/dont/exist.dtd
    at junit.framework.Assert.fail(Assert.java:47)
    at junit.framework.Assert.assertTrue(Assert.java:20)
    at
org.apache.tools.ant.types.XMLCatalogTest.testEmptyCatalog(XMLCatalogTest.java:94)

junit.framework.AssertionFailedError: Nonexistent Catalog entry return input
with a system ID like file:/tmp/file:/.../i/dont/exist.dtd but was
tmp/i/dont/exist.dtd
    at junit.framework.Assert.fail(Assert.java:47)
    at junit.framework.Assert.assertTrue(Assert.java:20)
    at
org.apache.tools.ant.types.XMLCatalogTest.testNonExistentEntry(XMLCatalogTest.java:139)

In XMLCatalog.resolve, getCatalogResolver() is an ExternalCatalog and resolving
 a relative path with a null base is done against the JVM's CWD rather than the
project's basedir.

If you force the resolver to be an InternalResolver, the test passes. Seems
that the external resolver when encountering an href with no matching entry
fails to use the basedir as a URL base.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to