ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 24887] New: - Junit forked task can't find ant libraries
Date Fri, 21 Nov 2003 11:43:15 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24887>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24887

Junit forked task can't find ant libraries

           Summary: Junit forked task can't find ant libraries
           Product: Ant
           Version: 1.5.4
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Optional Tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: artonx@yahoo.co.jp


When Ant was installed on the path that contains white space, Junit forked task 
may failto resolve Ant's lib, because Junit reolves lib path with 
Class#getResource. So the path name contains urlencoded space %20 instead 
of ' '.

running example)
>ant -verbose
...
junit:
   [junit] Implicitly adding C:\Program%20Files\junit3.8.1\junit.jar;C:\Program%
20Files\Apache%20Group\apache-ant-1.5.3-1\lib\ant.jar;C:\Program%20Files\Apache%
20Group\apache-ant-1.5.3-1\lib\optional.jar to CLASSPATH
   [junit] Running HogeHoge
dropping C:\Program%20Files\junit3.8.1\junit.jar from path as it doesn't exist

Here is the patch.
--- JUnitTask.java.org  Fri Nov 21 19:48:18 2003
+++ JUnitTask.java      Fri Nov 21 19:49:16 2003
@@ -80,6 +80,7 @@
import java.net.URL;
+import java.net.URLDecoder;

@@ -943,7 +944,7 @@
    protected void addClasspathEntry(String resource) {
        URL url = getClass().getResource(resource);
        if (url != null) {
-            String u = url.toString();
+            String u = URLDecoder.decode(url.toString());
            if (u.startsWith("jar:file:")) {

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


Mime
View raw message