ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject locator fun
Date Fri, 27 Apr 2007 12:26:13 GMT

an ant-user problem has thrown me into the depts of java's URI to file 

     public void testTripleForwardSlashNetworkURI() throws Exception {

     [junit]     FAILED
     [junit] file:///PC03/jclasses/lib/ant-1.7.0.jar 
expected:</[/]PC03/jclasses/lib/an...> but was:</[]PC03/jclasses/lib/an...>
     [junit] junit.framework.ComparisonFailure: 
expected:</[/]PC03/jclasses/lib/an...> but was:</[]PC03/jclasses/lib/an...>
     [junit]     at junit.framework.Assert.assertEquals(


     public void testUnixNetworkPath() throws Exception {
         resolveTo("file://cluster/home/ant/lib", "//cluster/home/ant/lib");

fails with

     [junit] Bad URI file://cluster/home/ant/lib:URI has an authority 
     [junit] java.lang.IllegalArgumentException: Bad URI 
file://cluster/home/ant/lib:URI has an authority component
     [junit]     at
     [junit]     at 
[junit]     at
     [junit]     at

In Ant1.7.0, it means you cant set ant up with a file: classpath mapped 
to a network path; I've got a commit that will catch and skip such a 
failure. But it also means, well, we have a problem. And it is not one 
that lives in our java1.3 and earlier code:

     public void testUnixNetworkPath13() throws Exception {

this passes. Which means we may be better off abandoning the new 
File(URI) stuff and sticking with our own code. At least that way, we 
are consistent across machines.

I'm going to commit my changes with the test failing, for others to look 
at.  Before you run the tests, do a bootstrap to rebuild locator.class 
in the boostrap JVM.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message