ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <je...@apache.org>
Subject Re: [PATCH] XMLCatalog testcase fix
Date Tue, 03 Dec 2002 07:12:59 GMT
On Mon, Dec 02, 2002 at 05:33:52PM +0100, Stefan Bodewig wrote:
> On Sun, 1 Dec 2002, Jeff Turner <jefft@apache.org> wrote:
> 
> > Poking around the XMLCatalog stuff, I've found: - The external
> > catalog support isn't tested when 'build.sh test' is run, because
> > resolver.jar isn't in the test classpath.
> 
> XmlValidateTest is run in either case for me - I don't see how and why
> it should be excluded.

Yes it is always run, but the test targets are a bit unusual.  Eg
src/etc/testcases/taskdefs/optional/xmlvalidate.xml:

  <target name="xmlcatalogfiles">
    <xmlvalidate warn="false">
      <fileset dir="xml" includes="**/about.xml"/>
      <xmlcatalog classpath="xml">
        <catalogfiles dir="xml" includes="catalog"/>
        <dtd publicID="-//stevo//DTD doc 1.0//EN"
             location="doc.dtd"/>
      </xmlcatalog>
    </xmlvalidate>
  </target>

This passes regardless of whether catalog support is present, because the
<dtd> is used, and <catalogfiles> doesn't get a chance to fail.
Commenting out the <dtd> entry causes the test to fail when it should
pass (with resolver.jar present).

The attached patch should fix this, by separating the
"test external catalogs" and "test internal catalogs" tests.

The two tests can be run with:

./build.sh run-single-test -Dtestcase=org.apache.tools.ant.taskdefs.optional.XmlValidateTest

and

./build.sh run-single-test -Dtestcase=org.apache.tools.ant.taskdefs.optional.XmlValidateCatalogTest

The first should always pass, regardless of resolver.jar's presence.  The
second should initially fail with:

...
Caused by: java.net.UnknownHostException: chemical
...

That can be fixed by copying the attached catalog file to
src/etc/testcases/taskdefs/optional/xml/catalog, after which (if
resolver.jar is in the classpath) it should pass.

The patch also modifies build.xml to only run XmlValidateCatalogTest when
resolver.jar is present.


--Jeff

> Passes as is in fresh checkout - with and without resolver.jar in my
> CLASSPATH.
> 
> Stefan
> 
> --
> 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