You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2002/05/03 14:47:09 UTC

cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/types PathTest.java

bodewig     02/05/03 05:47:09

  Modified:    .        Tag: ANT_15_BRANCH WHATSNEW
               src/main/org/apache/tools/ant Tag: ANT_15_BRANCH
                        PathTokenizer.java
               src/testcases/org/apache/tools/ant/types Tag: ANT_15_BRANCH
                        PathTest.java
  Log:
  Correctly handle paths that are colon separated on NetWare.
  
  PR: 8756
  Submitted by:	Jeff Tulley <jt...@novell.com>
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.263.2.2 +4 -1      jakarta-ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
  retrieving revision 1.263.2.1
  retrieving revision 1.263.2.2
  diff -u -r1.263.2.1 -r1.263.2.2
  --- WHATSNEW	2 May 2002 15:41:46 -0000	1.263.2.1
  +++ WHATSNEW	3 May 2002 12:47:09 -0000	1.263.2.2
  @@ -4,7 +4,10 @@
   Fixed bugs:
   -----------
   
  -* runant.pl now supports Netware.
  +* paths that have been separated by would be incorrectly parsed on
  +NetWare.
  +
  +* runant.pl now supports NetWare.
   
   Changes from Ant 1.4.1 to 1.5beta1
   ==================================
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.12.2.1  +2 -1      jakarta-ant/src/main/org/apache/tools/ant/PathTokenizer.java
  
  Index: PathTokenizer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/PathTokenizer.java,v
  retrieving revision 1.12
  retrieving revision 1.12.2.1
  diff -u -r1.12 -r1.12.2.1
  --- PathTokenizer.java	9 Apr 2002 15:27:07 -0000	1.12
  +++ PathTokenizer.java	3 May 2002 12:47:09 -0000	1.12.2.1
  @@ -165,7 +165,7 @@
           } else {
               // we are on NetWare, tokenizing is handled a little differently,
               // due to the fact that NetWare has multiple-character volume names.
  -            if (token.equals(File.pathSeparator)) {
  +            if (token.equals(File.pathSeparator) || token.equals(":")) {
                   // ignore ";" and get the next token
                   token = tokenizer.nextToken().trim();
               }
  @@ -184,6 +184,7 @@
                                   token += ":" + oneMore;
                               } else {
                                   token += ":";
  +                                lookahead = oneMore;
                               }
                           }
                           // implicit else: ignore the ':' since we have either a
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.15.2.1  +26 -0     jakarta-ant/src/testcases/org/apache/tools/ant/types/PathTest.java
  
  Index: PathTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/types/PathTest.java,v
  retrieving revision 1.15
  retrieving revision 1.15.2.1
  diff -u -r1.15 -r1.15.2.1
  --- PathTest.java	3 Apr 2002 10:54:54 -0000	1.15
  +++ PathTest.java	3 May 2002 12:47:09 -0000	1.15.2.1
  @@ -282,6 +282,32 @@
               assertTrue("temp resolved relative to project\'s basedir", 
                      l[3].endsWith("\\temp"));
            }
  +
  +        // try a multi-part netware-volume length path with UNIX
  +        // separator (this testcase if from an actual bug that was
  +        // found, in AvailableTest, which uses PathTokenizer)
  +        p = new Path(project, 
  +                     "SYS:\\JAVA/lib/rt.jar:SYS:\\JAVA/lib/classes.zip");
  +        l = p.list();
  +        if (isUnixStyle) {
  +            assertEquals("no drives on Unix", 3, l.length);
  +            assertTrue("sys resolved relative to project\'s basedir", 
  +                   l[0].endsWith("/SYS"));
  +            assertEquals("/JAVA/lib/rt.jar", l[1]);
  +            assertEquals("/JAVA/lib/classes.zip", l[2]);
  +        } else if (isNetWare) {
  +            assertEquals("volumes on NetWare", 2, l.length);
  +            assertEquals("sys:\\java\\lib\\rt.jar", l[0].toLowerCase(Locale.US));
  +            assertEquals("sys:\\java\\lib\\classes.zip", l[1].toLowerCase(Locale.US));
  +        } else {
  +            assertEquals("no multiple character-length volumes on Windows", 3, l.length);
  +            assertTrue("sys resolved relative to project\'s basedir", 
  +                   l[0].endsWith("\\SYS"));
  +            assertTrue("java/lib/rt.jar resolved relative to project\'s basedir", 
  +                   l[1].endsWith("\\JAVA\\lib\\rt.jar"));
  +            assertTrue("java/lib/classes.zip resolved relative to project\'s basedir", 
  +                   l[2].endsWith("\\JAVA\\lib\\classes.zip"));
  +        }
       }
   
       public void testConstructorMixedStyle() {
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>