ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/types PathTest.java
Date Sat, 13 Oct 2001 02:00:17 GMT
donaldp     01/10/12 19:00:17

  Modified:    src/testcases/org/apache/tools/ant/types PathTest.java
  Log:
  I made a lot of changes here, to almost every test case in the "testConstructor" test.  Partly
this code is system-dependent, but it is also testing that the paths are tokenized or split
into individual paths correctly, so that system dependence is probably ok here.  I simply
added in a NetWare case everywhere there was a UNIX and Windows(really, "else") case.
  
  Submitted By: Jeff Tulley  (jtulley@novell.com)
  
  Revision  Changes    Path
  1.9       +22 -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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PathTest.java	2001/01/03 14:18:51	1.8
  +++ PathTest.java	2001/10/13 02:00:17	1.9
  @@ -71,6 +71,7 @@
   public class PathTest extends TestCase {
   
       public static boolean isUnixStyle = File.pathSeparatorChar == ':';
  +    public static boolean isNetWare = (System.getProperty("os.name").toLowerCase().indexOf("netware")
> -1);
   
       private Project project;
   
  @@ -91,6 +92,9 @@
           if (isUnixStyle) {
               assertEquals("/a", l[0]);
               assertEquals("/b", l[1]);
  +        } else if (isNetWare) {
  +            assertEquals("\\a", l[0]);
  +            assertEquals("\\b", l[1]);
           } else {
               assertEquals(":\\a", l[0].substring(1));
               assertEquals(":\\b", l[1].substring(1));
  @@ -102,6 +106,9 @@
           if (isUnixStyle) {
               assertEquals("/a", l[0]);
               assertEquals("/b", l[1]);
  +        } else if (isNetWare) {
  +            assertEquals("\\a", l[0]);
  +            assertEquals("\\b", l[1]);
           } else {
               assertEquals(":\\a", l[0].substring(1));
               assertEquals(":\\b", l[1].substring(1));
  @@ -114,6 +121,10 @@
               assertEquals("/a", l[0]);
               assertEquals("/b", l[1]);
               assertEquals("/c", l[2]);
  +        } else if (isNetWare) {
  +            assertEquals("\\a", l[0]);
  +            assertEquals("\\b", l[1]);
  +            assertEquals("\\c", l[2]);
           } else {
               assertEquals(":\\a", l[0].substring(1));
               assertEquals(":\\b", l[1].substring(1));
  @@ -127,6 +138,9 @@
               assert("c resolved relative to project\'s basedir", 
                      l[0].endsWith("/c"));
               assertEquals("/test", l[1]);
  +        } else if (isNetWare) {
  +            assertEquals("volumes on NetWare", 1, l.length);
  +            assertEquals("c:\\test", l[0].toLowerCase());
           } else {
               assertEquals("drives on DOS", 1, l.length);
               assertEquals("c:\\test", l[0].toLowerCase());
  @@ -139,6 +153,9 @@
               assert("c resolved relative to project\'s basedir", 
                      l[0].endsWith("/c"));
               assertEquals("/test", l[1]);
  +        } else if (isNetWare) {
  +            assertEquals("volumes on NetWare", 1, l.length);
  +            assertEquals("c:\\test", l[0].toLowerCase());
           } else {
               assertEquals("drives on DOS", 1, l.length);
               assertEquals("c:\\test", l[0].toLowerCase());
  @@ -152,6 +169,9 @@
           if (isUnixStyle) {
               assertEquals(1, l.length);
               assertEquals("/a", l[0]);
  +        } else if (isNetWare) {
  +            assertEquals(1, l.length);
  +            assertEquals("\\a", l[0]);
           } else {
               assertEquals(1, l.length);
               assertEquals(":\\a", l[0].substring(1));
  @@ -313,6 +333,8 @@
                        1, l.length);
           if (isUnixStyle) {
               assertEquals("/a", l[0]);
  +        } else if (isNetWare) {
  +            assertEquals("\\a", l[0]);
           } else {
               assertEquals(":\\a", l[0].substring(1));
           }
  
  
  

Mime
View raw message