commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerem...@apache.org
Subject cvs commit: jakarta-commons-sandbox/io/src/test/org/apache/commons/io FileUtilsListFilesTestCase.java
Date Thu, 25 Dec 2003 11:03:35 GMT
jeremias    2003/12/25 03:03:35

  Modified:    io/src/test/org/apache/commons/io
                        FileUtilsListFilesTestCase.java
  Log:
  Improved test: Test listFiles with extensions = null
  
  Revision  Changes    Path
  1.2       +16 -2     jakarta-commons-sandbox/io/src/test/org/apache/commons/io/FileUtilsListFilesTestCase.java
  
  Index: FileUtilsListFilesTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/io/src/test/org/apache/commons/io/FileUtilsListFilesTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FileUtilsListFilesTestCase.java	22 Nov 2003 20:47:30 -0000	1.1
  +++ FileUtilsListFilesTestCase.java	25 Dec 2003 11:03:35 -0000	1.2
  @@ -32,6 +32,8 @@
           dir.mkdirs();
           File file = new File(dir, "dummy-build.xml");
           FileUtils.touch(file);
  +        file = new File(dir, "README");
  +        FileUtils.touch(file);
           
           dir = new File(dir, "subdir1");
           dir.mkdirs();
  @@ -74,16 +76,28 @@
       }
       
       public void testListFilesByExtension() throws Exception {
  -        String[] extensions = {"xml", "txt"};
  +        final String[] extensions = {"xml", "txt"};
  +        
           Collection files = FileUtils.listFiles(getLocalTestDirectory(), extensions, false);
           assertEquals(1, files.size());
           Collection filenames = filesToFilenames(files);
           assertTrue(filenames.contains("dummy-build.xml"));
  +        assertFalse(filenames.contains("README"));
  +        assertFalse(filenames.contains("dummy-file.txt"));
  +        
           files = FileUtils.listFiles(getLocalTestDirectory(), extensions, true);
           filenames = filesToFilenames(files);
           assertEquals(4, filenames.size());
           assertTrue(filenames.contains("dummy-file.txt"));
  -        assertFalse(filenames.contains("dumy-index.html"));
  +        assertFalse(filenames.contains("dummy-index.html"));
  +        
  +        files = FileUtils.listFiles(getLocalTestDirectory(), null, false);
  +        assertEquals(2, files.size());
  +        filenames = filesToFilenames(files);
  +        assertTrue(filenames.contains("dummy-build.xml"));
  +        assertTrue(filenames.contains("README"));
  +        assertFalse(filenames.contains("dummy-file.txt"));
  +        
       }
   
       public void testListFiles() throws Exception {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message