ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r703537 - /ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/unix/SymlinkTest.java
Date Fri, 10 Oct 2008 17:56:54 GMT
Author: mbenson
Date: Fri Oct 10 10:56:54 2008
New Revision: 703537

URL: http://svn.apache.org/viewvc?rev=703537&view=rev
Log:
make symlink junit test pass on OS X

Modified:
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/unix/SymlinkTest.java

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/unix/SymlinkTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/unix/SymlinkTest.java?rev=703537&r1=703536&r2=703537&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/unix/SymlinkTest.java
(original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/unix/SymlinkTest.java
Fri Oct 10 10:56:54 2008
@@ -254,13 +254,15 @@
             assertFalse(su.isDanglingSymbolicLink(f.getParentFile(),
                                                   f.getName()));
 
+            //apparently OS X knows a symlink is a symlink even if the target is missing:
+            boolean mac = Os.isFamily(Os.FAMILY_MAC);
+
             f = getProject().resolveFile("test-working/file.notthere");
             assertFalse(f.exists());
             assertFalse(f.isDirectory());
             assertFalse(f.isFile());
-            assertFalse(su.isSymbolicLink(f.getAbsolutePath()));
-            assertFalse(su.isSymbolicLink(f.getParentFile(),
-                                          f.getName()));
+            assertTrue(su.isSymbolicLink(f.getAbsolutePath()) == mac);
+            assertTrue(su.isSymbolicLink(f.getParentFile(), f.getName()) == mac);
             assertTrue(su.isDanglingSymbolicLink(f.getAbsolutePath()));
             assertTrue(su.isDanglingSymbolicLink(f.getParentFile(),
                                                  f.getName()));
@@ -269,9 +271,8 @@
             assertFalse(f.exists());
             assertFalse(f.isDirectory());
             assertFalse(f.isFile());
-            assertFalse(su.isSymbolicLink(f.getAbsolutePath()));
-            assertFalse(su.isSymbolicLink(f.getParentFile(),
-                                          f.getName()));
+            assertTrue(su.isSymbolicLink(f.getAbsolutePath()) == mac);
+            assertTrue(su.isSymbolicLink(f.getParentFile(), f.getName()) == mac);
             assertTrue(su.isDanglingSymbolicLink(f.getAbsolutePath()));
             assertTrue(su.isDanglingSymbolicLink(f.getParentFile(),
                                                  f.getName()));



Mime
View raw message