From 471322b9aea3d2a0275becb959ce4c01f4d99245 Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Sat, 13 Oct 2001 02:00:17 +0000 Subject: [PATCH] =?UTF-8?q?I=20made=20a=20lot=20of=20changes=20here,=20to?= =?UTF-8?q?=20almost=20every=20test=20case=20in=20the=20"testConstructor"?= =?UTF-8?q?=20test.=20=EF=BF=BDPartly=20this=20code=20is=20system-dependen?= =?UTF-8?q?t,=20but=20it=20is=20also=20testing=20that=20the=20paths=20are?= =?UTF-8?q?=20tokenized=20or=20split=20into=20individual=20paths=20correct?= =?UTF-8?q?ly,=20so=20that=20system=20dependence=20is=20probably=20ok=20he?= =?UTF-8?q?re.=20=EF=BF=BDI=20simply=20added=20in=20a=20NetWare=20case=20e?= =?UTF-8?q?verywhere=20there=20was=20a=20UNIX=20and=20Windows(really,=20"e?= =?UTF-8?q?lse")=20case.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Submitted By: Jeff Tulley �(jtulley@novell.com) git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269788 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/types/PathTest.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/testcases/org/apache/tools/ant/types/PathTest.java b/src/testcases/org/apache/tools/ant/types/PathTest.java index 1093fb49e..55b9e64dd 100644 --- a/src/testcases/org/apache/tools/ant/types/PathTest.java +++ b/src/testcases/org/apache/tools/ant/types/PathTest.java @@ -71,6 +71,7 @@ import java.io.File; 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 @@ public class PathTest extends TestCase { 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 @@ public class PathTest extends TestCase { 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 @@ public class PathTest extends TestCase { 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 @@ public class PathTest extends TestCase { 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 @@ public class PathTest extends TestCase { 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 @@ public class PathTest extends TestCase { 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 @@ public class PathTest extends TestCase { 1, l.length); if (isUnixStyle) { assertEquals("/a", l[0]); + } else if (isNetWare) { + assertEquals("\\a", l[0]); } else { assertEquals(":\\a", l[0].substring(1)); }