commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r1228554 - /commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsDirectoryContainsTestCase.java
Date Sat, 07 Jan 2012 02:33:33 GMT
Author: niallp
Date: Sat Jan  7 02:33:33 2012
New Revision: 1228554

URL: http://svn.apache.org/viewvc?rev=1228554&view=rev
Log:
IO-291 Add test case which shows FileUtils.directoryContains() returns true for a file which
doesn't exist

Modified:
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsDirectoryContainsTestCase.java

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsDirectoryContainsTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsDirectoryContainsTestCase.java?rev=1228554&r1=1228553&r2=1228554&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsDirectoryContainsTestCase.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsDirectoryContainsTestCase.java
Sat Jan  7 02:33:33 2012
@@ -145,6 +145,18 @@ public class FileUtilsDirectoryContainsT
         assertFalse(FileUtils.directoryContains(top, file));
     }
 
+    /**
+     * Test to demonstrate a file which does not exist returns true
+     * @throws IOException
+     */
+    @Test
+    public void testFileDoesNotExistBug() throws IOException {
+        final File file = new File(top, "DOESNOTEXIST");
+        assertTrue("Check directory exists", top.exists());
+        assertFalse("Check file does not exist", file.exists());
+        assertTrue("Show Bug", FileUtils.directoryContains(top, file)); /** should be false
*/
+    }
+
     @Test
     public void testUnrealizedContainment() throws IOException {
         final File dir = new File("DOESNOTEXIST");



Mime
View raw message