You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by an...@apache.org on 2005/12/20 22:56:35 UTC

svn commit: r358117 - /ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java

Author: antoine
Date: Tue Dec 20 13:56:31 2005
New Revision: 358117

URL: http://svn.apache.org/viewcvs?rev=358117&view=rev
Log:
Make the tests pass on Gump.

Modified:
    ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java

Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java?rev=358117&r1=358116&r2=358117&view=diff
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java (original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java Tue Dec 20 13:56:31 2005
@@ -3,6 +3,7 @@
 import org.apache.tools.ant.taskdefs.XSLTLiaison;
 import org.apache.tools.ant.taskdefs.XSLTLogger;
 import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.util.JAXPUtils;
 
 import java.io.File;
 
@@ -86,8 +87,8 @@
         } else {
             file = new File("/user/local/bin");
         }
-        String systemid = ((TraXLiaison)liaison).getSystemId(file);
-        assertTrue("SystemIDs should start by file:///", systemid.startsWith("file:///"));
+        String systemid = JAXPUtils.getSystemId(file);
+        assertTrue("SystemIDs should start by file:/", systemid.startsWith("file:/"));
         assertTrue("SystemIDs should not start with file:////", !systemid.startsWith("file:////"));
     }
 



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


Re: svn commit: r358117 - /ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello,

I would be inclined to revert the changes in FileUtils.toURI
where we are using URI.toASCIIString(). Since the new encoding and 
decoding routines do the right thing to encode non ASCII characters,
we should be on the safe side.

@Jesse : thoughts ?

Cheers,

Antoine
> --- Ursprüngliche Nachricht ---
> Von: Stefan Bodewig <bo...@apache.org>
> An: dev@ant.apache.org
> Betreff: Re: svn commit: r358117 -
>
/ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java
> Datum: Wed, 21 Dec 2005 06:03:05 +0100
> 
> On Tue, 20 Dec 2005, Antoine Levy-Lambert <an...@gmx.de> wrote:
> 
> > 2) what worries me is that what we now get by calling
> > FileUtils.toURI seems to start with file:/// under JDK 1.5 and
> > file:/ under JDK 1.4.  Is this good or bad ? or indifferent ? Not
> > sure. Jesse Glick wrote [1] that file URIs should start with file:/
> > . the extra double slash being not needed.
> 
> file is a hierarchical URL protocol, so in general it takes the form
> file://host/path, the three slash form is the special case of host
> being localhost.  It may be true that the Java runtime doesn't need
> three slashes, but I'm not sure this applies to file URLs in general.
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 

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


Re: svn commit: r358117 - /ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 20 Dec 2005, Antoine Levy-Lambert <an...@gmx.de> wrote:

> 2) what worries me is that what we now get by calling
> FileUtils.toURI seems to start with file:/// under JDK 1.5 and
> file:/ under JDK 1.4.  Is this good or bad ? or indifferent ? Not
> sure. Jesse Glick wrote [1] that file URIs should start with file:/
> . the extra double slash being not needed.

file is a hierarchical URL protocol, so in general it takes the form
file://host/path, the three slash form is the special case of host
being localhost.  It may be true that the Java runtime doesn't need
three slashes, but I'm not sure this applies to file URLs in general.

Stefan

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


Re: svn commit: r358117 - /ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java

Posted by Antoine Levy-Lambert <an...@gmx.de>.
2 comments :
1) we could remove this particular test called testSystemId in
TraXLiaisonTest, because it was calling a deprecated method, and
JaxpUtils has its own test cases.

2) what worries me is that what we now get by calling FileUtils.toURI
seems to start with file:/// under JDK 1.5 and file:/ under JDK 1.4.
Is this good or bad ? or indifferent ? Not sure. Jesse Glick wrote [1]
that file URIs should start with file:/ . the extra double slash being
not needed.


Antoine

[1]http://issues.apache.org/bugzilla/show_bug.cgi?id=8031



antoine@apache.org wrote:

>Author: antoine
>Date: Tue Dec 20 13:56:31 2005
>New Revision: 358117
>
>URL: http://svn.apache.org/viewcvs?rev=358117&view=rev
>Log:
>Make the tests pass on Gump.
>
>Modified:
>    ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java
>
>Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java
>URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java?rev=358117&r1=358116&r2=358117&view=diff
>==============================================================================
>--- ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java (original)
>+++ ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java Tue Dec 20 13:56:31 2005
>@@ -3,6 +3,7 @@
> import org.apache.tools.ant.taskdefs.XSLTLiaison;
> import org.apache.tools.ant.taskdefs.XSLTLogger;
> import org.apache.tools.ant.BuildException;
>+import org.apache.tools.ant.util.JAXPUtils;
> 
> import java.io.File;
> 
>@@ -86,8 +87,8 @@
>         } else {
>             file = new File("/user/local/bin");
>         }
>-        String systemid = ((TraXLiaison)liaison).getSystemId(file);
>-        assertTrue("SystemIDs should start by file:///", systemid.startsWith("file:///"));
>+        String systemid = JAXPUtils.getSystemId(file);
>+        assertTrue("SystemIDs should start by file:/", systemid.startsWith("file:/"));
>         assertTrue("SystemIDs should not start with file:////", !systemid.startsWith("file:////"));
>     }
> 
>
>
>
>  
>


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