commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1302017 - in /commons/proper/io/trunk/src/test/java/org/apache/commons/io: ./ filefilter/ output/
Date Sat, 17 Mar 2012 21:36:06 GMT
Author: sebb
Date: Sat Mar 17 21:36:05 2012
New Revision: 1302017

URL: http://svn.apache.org/viewvc?rev=1302017&view=rev
Log:
Simplify and avoid boxing

Modified:
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCaseJava4.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileCleaningTrackerTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileDeleteStrategyTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsWildcardTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOCaseTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/filefilter/FileFilterTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/FileWriterWithEncodingTest.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/LockableFileWriterTest.java

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCase.java?rev=1302017&r1=1302016&r2=1302017&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCase.java Sat Mar 17 21:36:05 2012
@@ -509,7 +509,7 @@ public class DirectoryWalkerTestCase ext
         @Override
         protected void handleDirectoryEnd(File directory, int depth, Collection<File> results) throws IOException {
             results.add(directory);
-            assertEquals(false, cancelled);
+            assertFalse(cancelled);
             if (cancelFileName.equals(directory.getName())) {
                 cancelled = true;
             }
@@ -519,7 +519,7 @@ public class DirectoryWalkerTestCase ext
         @Override
         protected void handleFile(File file, int depth, Collection<File> results) throws IOException {
             results.add(file);
-            assertEquals(false, cancelled);
+            assertFalse(cancelled);
             if (cancelFileName.equals(file.getName())) {
                 cancelled = true;
             }

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCaseJava4.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCaseJava4.java?rev=1302017&r1=1302016&r2=1302017&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCaseJava4.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCaseJava4.java Sat Mar 17 21:36:05 2012
@@ -497,7 +497,7 @@ public class DirectoryWalkerTestCaseJava
         @Override
         protected void handleDirectoryEnd(File directory, int depth, Collection results) throws IOException {
             results.add(directory);
-            assertEquals(false, cancelled);
+            assertFalse(cancelled);
             if (cancelFileName.equals(directory.getName())) {
                 cancelled = true;
             }
@@ -507,7 +507,7 @@ public class DirectoryWalkerTestCaseJava
         @Override
         protected void handleFile(File file, int depth, Collection results) throws IOException {
             results.add(file);
-            assertEquals(false, cancelled);
+            assertFalse(cancelled);
             if (cancelFileName.equals(file.getName())) {
                 cancelled = true;
             }

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileCleaningTrackerTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileCleaningTrackerTestCase.java?rev=1302017&r1=1302016&r2=1302017&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileCleaningTrackerTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileCleaningTrackerTestCase.java Sat Mar 17 21:36:05 2012
@@ -78,9 +78,9 @@ public class FileCleaningTrackerTestCase
     public void testFileCleanerFile() throws Exception {
         String path = testFile.getPath();
         
-        assertEquals(false, testFile.exists());
+        assertFalse(testFile.exists());
         RandomAccessFile r = new RandomAccessFile(testFile, "rw");
-        assertEquals(true, testFile.exists());
+        assertTrue(testFile.exists());
         
         assertEquals(0, theInstance.getTrackCount());
         theInstance.track(path, r);
@@ -99,8 +99,8 @@ public class FileCleaningTrackerTestCase
 
     public void testFileCleanerDirectory() throws Exception {
         createFile(testFile, 100);
-        assertEquals(true, testFile.exists());
-        assertEquals(true, getTestDirectory().exists());
+        assertTrue(testFile.exists());
+        assertTrue(getTestDirectory().exists());
         
         Object obj = new Object();
         assertEquals(0, theInstance.getTrackCount());
@@ -112,14 +112,14 @@ public class FileCleaningTrackerTestCase
         waitUntilTrackCount();
 
         assertEquals(0, theInstance.getTrackCount());
-        assertEquals(true, testFile.exists());  // not deleted, as dir not empty
-        assertEquals(true, testFile.getParentFile().exists());  // not deleted, as dir not empty
+        assertTrue(testFile.exists());  // not deleted, as dir not empty
+        assertTrue(testFile.getParentFile().exists());  // not deleted, as dir not empty
     }
 
     public void testFileCleanerDirectory_NullStrategy() throws Exception {
         createFile(testFile, 100);
-        assertEquals(true, testFile.exists());
-        assertEquals(true, getTestDirectory().exists());
+        assertTrue(testFile.exists());
+        assertTrue(getTestDirectory().exists());
         
         Object obj = new Object();
         assertEquals(0, theInstance.getTrackCount());
@@ -131,14 +131,14 @@ public class FileCleaningTrackerTestCase
         waitUntilTrackCount();
         
         assertEquals(0, theInstance.getTrackCount());
-        assertEquals(true, testFile.exists());  // not deleted, as dir not empty
-        assertEquals(true, testFile.getParentFile().exists());  // not deleted, as dir not empty
+        assertTrue(testFile.exists());  // not deleted, as dir not empty
+        assertTrue(testFile.getParentFile().exists());  // not deleted, as dir not empty
     }
 
     public void testFileCleanerDirectory_ForceStrategy() throws Exception {
         createFile(testFile, 100);
-        assertEquals(true, testFile.exists());
-        assertEquals(true, getTestDirectory().exists());
+        assertTrue(testFile.exists());
+        assertTrue(getTestDirectory().exists());
         
         Object obj = new Object();
         assertEquals(0, theInstance.getTrackCount());
@@ -183,22 +183,22 @@ public class FileCleaningTrackerTestCase
     }
 
     public void testFileCleanerExitWhenFinishedFirst() throws Exception {
-        assertEquals(false, theInstance.exitWhenFinished);
+        assertFalse(theInstance.exitWhenFinished);
         theInstance.exitWhenFinished();
-        assertEquals(true, theInstance.exitWhenFinished);
+        assertTrue(theInstance.exitWhenFinished);
         assertEquals(null, theInstance.reaper);
         
         waitUntilTrackCount();
         
         assertEquals(0, theInstance.getTrackCount());
-        assertEquals(true, theInstance.exitWhenFinished);
+        assertTrue(theInstance.exitWhenFinished);
         assertEquals(null, theInstance.reaper);
     }
 
     public void testFileCleanerExitWhenFinished_NoTrackAfter() throws Exception {
-        assertEquals(false, theInstance.exitWhenFinished);
+        assertFalse(theInstance.exitWhenFinished);
         theInstance.exitWhenFinished();
-        assertEquals(true, theInstance.exitWhenFinished);
+        assertTrue(theInstance.exitWhenFinished);
         assertEquals(null, theInstance.reaper);
         
         String path = testFile.getPath();
@@ -209,7 +209,7 @@ public class FileCleaningTrackerTestCase
         } catch (IllegalStateException ex) {
             // expected
         }
-        assertEquals(true, theInstance.exitWhenFinished);
+        assertTrue(theInstance.exitWhenFinished);
         assertEquals(null, theInstance.reaper);
     }
 
@@ -247,15 +247,15 @@ public class FileCleaningTrackerTestCase
     public void testFileCleanerExitWhenFinished2() throws Exception {
         String path = testFile.getPath();
         
-        assertEquals(false, testFile.exists());
+        assertFalse(testFile.exists());
         RandomAccessFile r = new RandomAccessFile(testFile, "rw");
-        assertEquals(true, testFile.exists());
+        assertTrue(testFile.exists());
         
         assertEquals(0, theInstance.getTrackCount());
         theInstance.track(path, r);
         assertEquals(1, theInstance.getTrackCount());
-        assertEquals(false, theInstance.exitWhenFinished);
-        assertEquals(true, theInstance.reaper.isAlive());
+        assertFalse(theInstance.exitWhenFinished);
+        assertTrue(theInstance.reaper.isAlive());
         
         r.close();
         testFile = null;
@@ -266,16 +266,16 @@ public class FileCleaningTrackerTestCase
         
         assertEquals(0, theInstance.getTrackCount());
         assertEquals(showFailures(), false, new File(path).exists());
-        assertEquals(false, theInstance.exitWhenFinished);
-        assertEquals(true, theInstance.reaper.isAlive());
+        assertFalse(theInstance.exitWhenFinished);
+        assertTrue(theInstance.reaper.isAlive());
         
-        assertEquals(false, theInstance.exitWhenFinished);
+        assertFalse(theInstance.exitWhenFinished);
         theInstance.exitWhenFinished();
         for (int i = 0; i < 20 && theInstance.reaper.isAlive(); i++) {
             Thread.sleep(500L);  // allow reaper thread to die
         }
-        assertEquals(true, theInstance.exitWhenFinished);
-        assertEquals(false, theInstance.reaper.isAlive());
+        assertTrue(theInstance.exitWhenFinished);
+        assertFalse(theInstance.reaper.isAlive());
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileDeleteStrategyTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileDeleteStrategyTestCase.java?rev=1302017&r1=1302016&r2=1302017&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileDeleteStrategyTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileDeleteStrategyTestCase.java Sat Mar 17 21:36:05 2012
@@ -47,12 +47,12 @@ public class FileDeleteStrategyTestCase 
     public void testDeleteNormal() throws Exception {
         File baseDir = getTestDirectory();
         File subDir = new File(baseDir, "test");
-        assertEquals(true, subDir.mkdir());
+        assertTrue(subDir.mkdir());
         File subFile = new File(subDir, "a.txt");
         createFile(subFile, 16);
         
-        assertEquals(true, subDir.exists());
-        assertEquals(true, subFile.exists());
+        assertTrue(subDir.exists());
+        assertTrue(subFile.exists());
         // delete dir
         try {
             FileDeleteStrategy.NORMAL.delete(subDir);
@@ -60,61 +60,61 @@ public class FileDeleteStrategyTestCase 
         } catch (IOException ex) {
             // expected
         }
-        assertEquals(true, subDir.exists());
-        assertEquals(true, subFile.exists());
+        assertTrue(subDir.exists());
+        assertTrue(subFile.exists());
         // delete file
         FileDeleteStrategy.NORMAL.delete(subFile);
-        assertEquals(true, subDir.exists());
-        assertEquals(false, subFile.exists());
+        assertTrue(subDir.exists());
+        assertFalse(subFile.exists());
         // delete dir
         FileDeleteStrategy.NORMAL.delete(subDir);
-        assertEquals(false, subDir.exists());
+        assertFalse(subDir.exists());
         // delete dir
         FileDeleteStrategy.NORMAL.delete(subDir);  // no error
-        assertEquals(false, subDir.exists());
+        assertFalse(subDir.exists());
     }
 
     public void testDeleteQuietlyNormal() throws Exception {
         File baseDir = getTestDirectory();
         File subDir = new File(baseDir, "test");
-        assertEquals(true, subDir.mkdir());
+        assertTrue(subDir.mkdir());
         File subFile = new File(subDir, "a.txt");
         createFile(subFile, 16);
         
-        assertEquals(true, subDir.exists());
-        assertEquals(true, subFile.exists());
+        assertTrue(subDir.exists());
+        assertTrue(subFile.exists());
         // delete dir
-        assertEquals(false, FileDeleteStrategy.NORMAL.deleteQuietly(subDir));
-        assertEquals(true, subDir.exists());
-        assertEquals(true, subFile.exists());
+        assertFalse(FileDeleteStrategy.NORMAL.deleteQuietly(subDir));
+        assertTrue(subDir.exists());
+        assertTrue(subFile.exists());
         // delete file
-        assertEquals(true, FileDeleteStrategy.NORMAL.deleteQuietly(subFile));
-        assertEquals(true, subDir.exists());
-        assertEquals(false, subFile.exists());
+        assertTrue(FileDeleteStrategy.NORMAL.deleteQuietly(subFile));
+        assertTrue(subDir.exists());
+        assertFalse(subFile.exists());
         // delete dir
-        assertEquals(true, FileDeleteStrategy.NORMAL.deleteQuietly(subDir));
-        assertEquals(false, subDir.exists());
+        assertTrue(FileDeleteStrategy.NORMAL.deleteQuietly(subDir));
+        assertFalse(subDir.exists());
         // delete dir
-        assertEquals(true, FileDeleteStrategy.NORMAL.deleteQuietly(subDir));  // no error
-        assertEquals(false, subDir.exists());
+        assertTrue(FileDeleteStrategy.NORMAL.deleteQuietly(subDir));  // no error
+        assertFalse(subDir.exists());
     }
 
     public void testDeleteForce() throws Exception {
         File baseDir = getTestDirectory();
         File subDir = new File(baseDir, "test");
-        assertEquals(true, subDir.mkdir());
+        assertTrue(subDir.mkdir());
         File subFile = new File(subDir, "a.txt");
         createFile(subFile, 16);
         
-        assertEquals(true, subDir.exists());
-        assertEquals(true, subFile.exists());
+        assertTrue(subDir.exists());
+        assertTrue(subFile.exists());
         // delete dir
         FileDeleteStrategy.FORCE.delete(subDir);
-        assertEquals(false, subDir.exists());
-        assertEquals(false, subFile.exists());
+        assertFalse(subDir.exists());
+        assertFalse(subFile.exists());
         // delete dir
         FileDeleteStrategy.FORCE.delete(subDir);  // no error
-        assertEquals(false, subDir.exists());
+        assertFalse(subDir.exists());
     }
 
     public void testDeleteNull() throws Exception {
@@ -124,7 +124,7 @@ public class FileDeleteStrategyTestCase 
         } catch (NullPointerException ex) {
             // expected
         }
-        assertEquals(true, FileDeleteStrategy.NORMAL.deleteQuietly((File) null));
+        assertTrue(FileDeleteStrategy.NORMAL.deleteQuietly((File) null));
     }
 
     public void testToString() {

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java?rev=1302017&r1=1302016&r2=1302017&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java Sat Mar 17 21:36:05 2012
@@ -228,7 +228,7 @@ public class FileUtilsTestCase extends F
             } finally {
                 IOUtils.closeQuietly(out);
             }
-            assertEquals(true, file.exists());
+            assertTrue(file.exists());
         } finally {
             if (file.delete() == false) {
                 file.deleteOnExit();
@@ -255,7 +255,7 @@ public class FileUtilsTestCase extends F
         } finally {
             IOUtils.closeQuietly(out);
         }
-        assertEquals(true, file.exists());
+        assertTrue(file.exists());
     }
 
     public void test_openOutputStream_existsButIsDirectory() throws Exception {
@@ -281,7 +281,7 @@ public class FileUtilsTestCase extends F
         } finally {
             IOUtils.closeQuietly(out);
         }
-        assertEquals(true, file.exists());
+        assertTrue(file.exists());
     }
 
     public void test_openOutputStream_notExistsCannotCreate() throws Exception {
@@ -334,13 +334,13 @@ public class FileUtilsTestCase extends F
     public void testToFile1() throws Exception {
         URL url = new URL("file", null, "a/b/c/file.txt");
         File file = FileUtils.toFile(url);
-        assertEquals(true, file.toString().indexOf("file.txt") >= 0);
+        assertTrue(file.toString().indexOf("file.txt") >= 0);
     }
 
     public void testToFile2() throws Exception {
         URL url = new URL("file", null, "a/b/c/file%20n%61me%2520.tx%74");
         File file = FileUtils.toFile(url);
-        assertEquals(true, file.toString().indexOf("file name%20.txt") >= 0);
+        assertTrue(file.toString().indexOf("file name%20.txt") >= 0);
     }
 
     public void testToFile3() throws Exception {
@@ -351,7 +351,7 @@ public class FileUtilsTestCase extends F
     public void testToFile4() throws Exception {
         URL url = new URL("file", null, "a/b/c/file%%20%me.txt%");
         File file = FileUtils.toFile(url);
-        assertEquals(true, file.toString().indexOf("file% %me.txt%") >= 0);
+        assertTrue(file.toString().indexOf("file% %me.txt%") >= 0);
     }
 
     /** IO-252 */
@@ -363,7 +363,7 @@ public class FileUtilsTestCase extends F
     public void testToFileUtf8() throws Exception {
         URL url = new URL("file", null, "/home/%C3%A4%C3%B6%C3%BC%C3%9F");
         File file = FileUtils.toFile(url);
-        assertEquals(true, file.toString().indexOf("\u00E4\u00F6\u00FC\u00DF") >= 0);
+        assertTrue(file.toString().indexOf("\u00E4\u00F6\u00FC\u00DF") >= 0);
     }
 
     public void testDecodeUrl() {
@@ -448,14 +448,14 @@ public class FileUtilsTestCase extends F
         URL[] urls = FileUtils.toURLs(files);
         
         assertEquals(files.length, urls.length);
-        assertEquals(true, urls[0].toExternalForm().startsWith("file:"));
-        assertEquals(true, urls[0].toExternalForm().indexOf("file1.txt") >= 0);
-        assertEquals(true, urls[1].toExternalForm().startsWith("file:"));
-        assertEquals(true, urls[1].toExternalForm().indexOf("file2.txt") >= 0);
+        assertTrue(urls[0].toExternalForm().startsWith("file:"));
+        assertTrue(urls[0].toExternalForm().indexOf("file1.txt") >= 0);
+        assertTrue(urls[1].toExternalForm().startsWith("file:"));
+        assertTrue(urls[1].toExternalForm().indexOf("file2.txt") >= 0);
 
         // Test escaped char
-        assertEquals(true, urls[2].toExternalForm().startsWith("file:"));
-        assertEquals(true, urls[2].toExternalForm().indexOf("test%20file.txt") >= 0);
+        assertTrue(urls[2].toExternalForm().startsWith("file:"));
+        assertTrue(urls[2].toExternalForm().indexOf("test%20file.txt") >= 0);
     }
 
 //    public void testToURLs2() throws Exception {
@@ -466,8 +466,8 @@ public class FileUtilsTestCase extends F
 //        URL[] urls = FileUtils.toURLs(files);
 //        
 //        assertEquals(files.length, urls.length);
-//        assertEquals(true, urls[0].toExternalForm().startsWith("file:"));
-//        assertEquals(true, urls[0].toExternalForm().indexOf("file1.txt") > 0);
+//        assertTrue(urls[0].toExternalForm().startsWith("file:"));
+//        assertTrue(urls[0].toExternalForm().indexOf("file1.txt") > 0);
 //        assertEquals(null, urls[1]);
 //    }
 //
@@ -520,19 +520,19 @@ public class FileUtilsTestCase extends F
             getClass().getResource("/java/util/Collection.class"),
             objFile2);
 
-        assertEquals(false, FileUtils.contentEquals(objFile1, objFile2));
-        assertEquals(false, FileUtils.contentEquals(objFile1b, objFile2));
-        assertEquals(true, FileUtils.contentEquals(objFile1, objFile1b));
-
-        assertEquals(true, FileUtils.contentEquals(objFile1, objFile1));
-        assertEquals(true, FileUtils.contentEquals(objFile1b, objFile1b));
-        assertEquals(true, FileUtils.contentEquals(objFile2, objFile2));
+        assertFalse(FileUtils.contentEquals(objFile1, objFile2));
+        assertFalse(FileUtils.contentEquals(objFile1b, objFile2));
+        assertTrue(FileUtils.contentEquals(objFile1, objFile1b));
+
+        assertTrue(FileUtils.contentEquals(objFile1, objFile1));
+        assertTrue(FileUtils.contentEquals(objFile1b, objFile1b));
+        assertTrue(FileUtils.contentEquals(objFile2, objFile2));
 
         // Equal files
         file.createNewFile();
         file2.createNewFile();
-        assertEquals(true, FileUtils.contentEquals(file, file));
-        assertEquals(true, FileUtils.contentEquals(file, file2));
+        assertTrue(FileUtils.contentEquals(file, file));
+        assertTrue(FileUtils.contentEquals(file, file2));
     }
 
     public void testContentEqualsIgnoreEOL() throws Exception {
@@ -995,7 +995,7 @@ public class FileUtilsTestCase extends F
         assertTrue("Check exists", destDir.exists());
         assertTrue("Check exists", actualDestDir.exists());
         assertEquals("Check size", FileUtils.sizeOfDirectory(srcDir), FileUtils.sizeOfDirectory(actualDestDir));
-        assertEquals(true, new File(actualDestDir, "sub/A.txt").exists());
+        assertTrue(new File(actualDestDir, "sub/A.txt").exists());
         FileUtils.deleteDirectory(destDir);
     }
 
@@ -1014,7 +1014,7 @@ public class FileUtilsTestCase extends F
         
         assertTrue("Check exists", destDir.exists());
         assertEquals("Check size", FileUtils.sizeOfDirectory(srcDir), FileUtils.sizeOfDirectory(destDir));
-        assertEquals(true, new File(destDir, "sub/A.txt").exists());
+        assertTrue(new File(destDir, "sub/A.txt").exists());
         FileUtils.deleteDirectory(destDir);
     }
 
@@ -1033,7 +1033,7 @@ public class FileUtilsTestCase extends F
         FileUtils.copyDirectory(srcDir, destDir);
         
         assertEquals(FileUtils.sizeOfDirectory(srcDir), FileUtils.sizeOfDirectory(destDir));
-        assertEquals(true, new File(destDir, "sub/A.txt").exists());
+        assertTrue(new File(destDir, "sub/A.txt").exists());
     }
 
     public void testCopyDirectoryFiltered() throws Exception {

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java?rev=1302017&r1=1302016&r2=1302017&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java Sat Mar 17 21:36:05 2012
@@ -772,46 +772,46 @@ public class FilenameUtilsTestCase exten
 
     //-----------------------------------------------------------------------
     public void testEquals() {
-        assertEquals(true, FilenameUtils.equals(null, null));
-        assertEquals(false, FilenameUtils.equals(null, ""));
-        assertEquals(false, FilenameUtils.equals("", null));
-        assertEquals(true, FilenameUtils.equals("", ""));
-        assertEquals(true, FilenameUtils.equals("file.txt", "file.txt"));
-        assertEquals(false, FilenameUtils.equals("file.txt", "FILE.TXT"));
-        assertEquals(false, FilenameUtils.equals("a\\b\\file.txt", "a/b/file.txt"));
+        assertTrue(FilenameUtils.equals(null, null));
+        assertFalse(FilenameUtils.equals(null, ""));
+        assertFalse(FilenameUtils.equals("", null));
+        assertTrue(FilenameUtils.equals("", ""));
+        assertTrue(FilenameUtils.equals("file.txt", "file.txt"));
+        assertFalse(FilenameUtils.equals("file.txt", "FILE.TXT"));
+        assertFalse(FilenameUtils.equals("a\\b\\file.txt", "a/b/file.txt"));
     }
 
     public void testEqualsOnSystem() {
-        assertEquals(true, FilenameUtils.equalsOnSystem(null, null));
-        assertEquals(false, FilenameUtils.equalsOnSystem(null, ""));
-        assertEquals(false, FilenameUtils.equalsOnSystem("", null));
-        assertEquals(true, FilenameUtils.equalsOnSystem("", ""));
-        assertEquals(true, FilenameUtils.equalsOnSystem("file.txt", "file.txt"));
+        assertTrue(FilenameUtils.equalsOnSystem(null, null));
+        assertFalse(FilenameUtils.equalsOnSystem(null, ""));
+        assertFalse(FilenameUtils.equalsOnSystem("", null));
+        assertTrue(FilenameUtils.equalsOnSystem("", ""));
+        assertTrue(FilenameUtils.equalsOnSystem("file.txt", "file.txt"));
         assertEquals(WINDOWS, FilenameUtils.equalsOnSystem("file.txt", "FILE.TXT"));
-        assertEquals(false, FilenameUtils.equalsOnSystem("a\\b\\file.txt", "a/b/file.txt"));
+        assertFalse(FilenameUtils.equalsOnSystem("a\\b\\file.txt", "a/b/file.txt"));
     }
 
     //-----------------------------------------------------------------------
     public void testEqualsNormalized() {
-        assertEquals(true, FilenameUtils.equalsNormalized(null, null));
-        assertEquals(false, FilenameUtils.equalsNormalized(null, ""));
-        assertEquals(false, FilenameUtils.equalsNormalized("", null));
-        assertEquals(true, FilenameUtils.equalsNormalized("", ""));
-        assertEquals(true, FilenameUtils.equalsNormalized("file.txt", "file.txt"));
-        assertEquals(false, FilenameUtils.equalsNormalized("file.txt", "FILE.TXT"));
-        assertEquals(true, FilenameUtils.equalsNormalized("a\\b\\file.txt", "a/b/file.txt"));
-        assertEquals(false, FilenameUtils.equalsNormalized("a/b/", "a/b"));
+        assertTrue(FilenameUtils.equalsNormalized(null, null));
+        assertFalse(FilenameUtils.equalsNormalized(null, ""));
+        assertFalse(FilenameUtils.equalsNormalized("", null));
+        assertTrue(FilenameUtils.equalsNormalized("", ""));
+        assertTrue(FilenameUtils.equalsNormalized("file.txt", "file.txt"));
+        assertFalse(FilenameUtils.equalsNormalized("file.txt", "FILE.TXT"));
+        assertTrue(FilenameUtils.equalsNormalized("a\\b\\file.txt", "a/b/file.txt"));
+        assertFalse(FilenameUtils.equalsNormalized("a/b/", "a/b"));
     }
 
     public void testEqualsNormalizedOnSystem() {
-        assertEquals(true, FilenameUtils.equalsNormalizedOnSystem(null, null));
-        assertEquals(false, FilenameUtils.equalsNormalizedOnSystem(null, ""));
-        assertEquals(false, FilenameUtils.equalsNormalizedOnSystem("", null));
-        assertEquals(true, FilenameUtils.equalsNormalizedOnSystem("", ""));
-        assertEquals(true, FilenameUtils.equalsNormalizedOnSystem("file.txt", "file.txt"));
+        assertTrue(FilenameUtils.equalsNormalizedOnSystem(null, null));
+        assertFalse(FilenameUtils.equalsNormalizedOnSystem(null, ""));
+        assertFalse(FilenameUtils.equalsNormalizedOnSystem("", null));
+        assertTrue(FilenameUtils.equalsNormalizedOnSystem("", ""));
+        assertTrue(FilenameUtils.equalsNormalizedOnSystem("file.txt", "file.txt"));
         assertEquals(WINDOWS, FilenameUtils.equalsNormalizedOnSystem("file.txt", "FILE.TXT"));
-        assertEquals(true, FilenameUtils.equalsNormalizedOnSystem("a\\b\\file.txt", "a/b/file.txt"));
-        assertEquals(false, FilenameUtils.equalsNormalizedOnSystem("a/b/", "a/b"));
+        assertTrue(FilenameUtils.equalsNormalizedOnSystem("a\\b\\file.txt", "a/b/file.txt"));
+        assertFalse(FilenameUtils.equalsNormalizedOnSystem("a/b/", "a/b"));
     }
 
     /**
@@ -839,119 +839,119 @@ public class FilenameUtilsTestCase exten
     }
 
     public void testEquals_fullControl() {
-        assertEquals(false, FilenameUtils.equals("file.txt", "FILE.TXT", true, IOCase.SENSITIVE));
-        assertEquals(true, FilenameUtils.equals("file.txt", "FILE.TXT", true, IOCase.INSENSITIVE));
+        assertFalse(FilenameUtils.equals("file.txt", "FILE.TXT", true, IOCase.SENSITIVE));
+        assertTrue(FilenameUtils.equals("file.txt", "FILE.TXT", true, IOCase.INSENSITIVE));
         assertEquals(WINDOWS, FilenameUtils.equals("file.txt", "FILE.TXT", true, IOCase.SYSTEM));
-        assertEquals(false, FilenameUtils.equals("file.txt", "FILE.TXT", true, null));
+        assertFalse(FilenameUtils.equals("file.txt", "FILE.TXT", true, null));
     }
 
     //-----------------------------------------------------------------------
     public void testIsExtension() {
-        assertEquals(false, FilenameUtils.isExtension(null, (String) null));
-        assertEquals(false, FilenameUtils.isExtension("file.txt", (String) null));
-        assertEquals(true, FilenameUtils.isExtension("file", (String) null));
-        assertEquals(false, FilenameUtils.isExtension("file.txt", ""));
-        assertEquals(true, FilenameUtils.isExtension("file", ""));
-        assertEquals(true, FilenameUtils.isExtension("file.txt", "txt"));
-        assertEquals(false, FilenameUtils.isExtension("file.txt", "rtf"));
-        
-        assertEquals(false, FilenameUtils.isExtension("a/b/file.txt", (String) null));
-        assertEquals(false, FilenameUtils.isExtension("a/b/file.txt", ""));
-        assertEquals(true, FilenameUtils.isExtension("a/b/file.txt", "txt"));
-        assertEquals(false, FilenameUtils.isExtension("a/b/file.txt", "rtf"));
-        
-        assertEquals(false, FilenameUtils.isExtension("a.b/file.txt", (String) null));
-        assertEquals(false, FilenameUtils.isExtension("a.b/file.txt", ""));
-        assertEquals(true, FilenameUtils.isExtension("a.b/file.txt", "txt"));
-        assertEquals(false, FilenameUtils.isExtension("a.b/file.txt", "rtf"));
-        
-        assertEquals(false, FilenameUtils.isExtension("a\\b\\file.txt", (String) null));
-        assertEquals(false, FilenameUtils.isExtension("a\\b\\file.txt", ""));
-        assertEquals(true, FilenameUtils.isExtension("a\\b\\file.txt", "txt"));
-        assertEquals(false, FilenameUtils.isExtension("a\\b\\file.txt", "rtf"));
-        
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", (String) null));
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", ""));
-        assertEquals(true, FilenameUtils.isExtension("a.b\\file.txt", "txt"));
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", "rtf"));
+        assertFalse(FilenameUtils.isExtension(null, (String) null));
+        assertFalse(FilenameUtils.isExtension("file.txt", (String) null));
+        assertTrue(FilenameUtils.isExtension("file", (String) null));
+        assertFalse(FilenameUtils.isExtension("file.txt", ""));
+        assertTrue(FilenameUtils.isExtension("file", ""));
+        assertTrue(FilenameUtils.isExtension("file.txt", "txt"));
+        assertFalse(FilenameUtils.isExtension("file.txt", "rtf"));
+        
+        assertFalse(FilenameUtils.isExtension("a/b/file.txt", (String) null));
+        assertFalse(FilenameUtils.isExtension("a/b/file.txt", ""));
+        assertTrue(FilenameUtils.isExtension("a/b/file.txt", "txt"));
+        assertFalse(FilenameUtils.isExtension("a/b/file.txt", "rtf"));
+        
+        assertFalse(FilenameUtils.isExtension("a.b/file.txt", (String) null));
+        assertFalse(FilenameUtils.isExtension("a.b/file.txt", ""));
+        assertTrue(FilenameUtils.isExtension("a.b/file.txt", "txt"));
+        assertFalse(FilenameUtils.isExtension("a.b/file.txt", "rtf"));
+        
+        assertFalse(FilenameUtils.isExtension("a\\b\\file.txt", (String) null));
+        assertFalse(FilenameUtils.isExtension("a\\b\\file.txt", ""));
+        assertTrue(FilenameUtils.isExtension("a\\b\\file.txt", "txt"));
+        assertFalse(FilenameUtils.isExtension("a\\b\\file.txt", "rtf"));
+        
+        assertFalse(FilenameUtils.isExtension("a.b\\file.txt", (String) null));
+        assertFalse(FilenameUtils.isExtension("a.b\\file.txt", ""));
+        assertTrue(FilenameUtils.isExtension("a.b\\file.txt", "txt"));
+        assertFalse(FilenameUtils.isExtension("a.b\\file.txt", "rtf"));
         
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", "TXT"));
+        assertFalse(FilenameUtils.isExtension("a.b\\file.txt", "TXT"));
     }
 
     public void testIsExtensionArray() {
-        assertEquals(false, FilenameUtils.isExtension(null, (String[]) null));
-        assertEquals(false, FilenameUtils.isExtension("file.txt", (String[]) null));
-        assertEquals(true, FilenameUtils.isExtension("file", (String[]) null));
-        assertEquals(false, FilenameUtils.isExtension("file.txt", new String[0]));
-        assertEquals(true, FilenameUtils.isExtension("file.txt", new String[] {"txt"}));
-        assertEquals(false, FilenameUtils.isExtension("file.txt", new String[] {"rtf"}));
-        assertEquals(true, FilenameUtils.isExtension("file", new String[] {"rtf", ""}));
-        assertEquals(true, FilenameUtils.isExtension("file.txt", new String[] {"rtf", "txt"}));
-        
-        assertEquals(false, FilenameUtils.isExtension("a/b/file.txt", (String[]) null));
-        assertEquals(false, FilenameUtils.isExtension("a/b/file.txt", new String[0]));
-        assertEquals(true, FilenameUtils.isExtension("a/b/file.txt", new String[] {"txt"}));
-        assertEquals(false, FilenameUtils.isExtension("a/b/file.txt", new String[] {"rtf"}));
-        assertEquals(true, FilenameUtils.isExtension("a/b/file.txt", new String[] {"rtf", "txt"}));
-        
-        assertEquals(false, FilenameUtils.isExtension("a.b/file.txt", (String[]) null));
-        assertEquals(false, FilenameUtils.isExtension("a.b/file.txt", new String[0]));
-        assertEquals(true, FilenameUtils.isExtension("a.b/file.txt", new String[] {"txt"}));
-        assertEquals(false, FilenameUtils.isExtension("a.b/file.txt", new String[] {"rtf"}));
-        assertEquals(true, FilenameUtils.isExtension("a.b/file.txt", new String[] {"rtf", "txt"}));
-        
-        assertEquals(false, FilenameUtils.isExtension("a\\b\\file.txt", (String[]) null));
-        assertEquals(false, FilenameUtils.isExtension("a\\b\\file.txt", new String[0]));
-        assertEquals(true, FilenameUtils.isExtension("a\\b\\file.txt", new String[] {"txt"}));
-        assertEquals(false, FilenameUtils.isExtension("a\\b\\file.txt", new String[] {"rtf"}));
-        assertEquals(true, FilenameUtils.isExtension("a\\b\\file.txt", new String[] {"rtf", "txt"}));
-        
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", (String[]) null));
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", new String[0]));
-        assertEquals(true, FilenameUtils.isExtension("a.b\\file.txt", new String[] {"txt"}));
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", new String[] {"rtf"}));
-        assertEquals(true, FilenameUtils.isExtension("a.b\\file.txt", new String[] {"rtf", "txt"}));
+        assertFalse(FilenameUtils.isExtension(null, (String[]) null));
+        assertFalse(FilenameUtils.isExtension("file.txt", (String[]) null));
+        assertTrue(FilenameUtils.isExtension("file", (String[]) null));
+        assertFalse(FilenameUtils.isExtension("file.txt", new String[0]));
+        assertTrue(FilenameUtils.isExtension("file.txt", new String[] {"txt"}));
+        assertFalse(FilenameUtils.isExtension("file.txt", new String[] {"rtf"}));
+        assertTrue(FilenameUtils.isExtension("file", new String[] {"rtf", ""}));
+        assertTrue(FilenameUtils.isExtension("file.txt", new String[] {"rtf", "txt"}));
+        
+        assertFalse(FilenameUtils.isExtension("a/b/file.txt", (String[]) null));
+        assertFalse(FilenameUtils.isExtension("a/b/file.txt", new String[0]));
+        assertTrue(FilenameUtils.isExtension("a/b/file.txt", new String[] {"txt"}));
+        assertFalse(FilenameUtils.isExtension("a/b/file.txt", new String[] {"rtf"}));
+        assertTrue(FilenameUtils.isExtension("a/b/file.txt", new String[] {"rtf", "txt"}));
+        
+        assertFalse(FilenameUtils.isExtension("a.b/file.txt", (String[]) null));
+        assertFalse(FilenameUtils.isExtension("a.b/file.txt", new String[0]));
+        assertTrue(FilenameUtils.isExtension("a.b/file.txt", new String[] {"txt"}));
+        assertFalse(FilenameUtils.isExtension("a.b/file.txt", new String[] {"rtf"}));
+        assertTrue(FilenameUtils.isExtension("a.b/file.txt", new String[] {"rtf", "txt"}));
+        
+        assertFalse(FilenameUtils.isExtension("a\\b\\file.txt", (String[]) null));
+        assertFalse(FilenameUtils.isExtension("a\\b\\file.txt", new String[0]));
+        assertTrue(FilenameUtils.isExtension("a\\b\\file.txt", new String[] {"txt"}));
+        assertFalse(FilenameUtils.isExtension("a\\b\\file.txt", new String[] {"rtf"}));
+        assertTrue(FilenameUtils.isExtension("a\\b\\file.txt", new String[] {"rtf", "txt"}));
+        
+        assertFalse(FilenameUtils.isExtension("a.b\\file.txt", (String[]) null));
+        assertFalse(FilenameUtils.isExtension("a.b\\file.txt", new String[0]));
+        assertTrue(FilenameUtils.isExtension("a.b\\file.txt", new String[] {"txt"}));
+        assertFalse(FilenameUtils.isExtension("a.b\\file.txt", new String[] {"rtf"}));
+        assertTrue(FilenameUtils.isExtension("a.b\\file.txt", new String[] {"rtf", "txt"}));
         
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", new String[] {"TXT"}));
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", new String[] {"TXT", "RTF"}));
+        assertFalse(FilenameUtils.isExtension("a.b\\file.txt", new String[] {"TXT"}));
+        assertFalse(FilenameUtils.isExtension("a.b\\file.txt", new String[] {"TXT", "RTF"}));
     }
 
     public void testIsExtensionCollection() {
-        assertEquals(false, FilenameUtils.isExtension(null, (Collection<String>) null));
-        assertEquals(false, FilenameUtils.isExtension("file.txt", (Collection<String>) null));
-        assertEquals(true, FilenameUtils.isExtension("file", (Collection<String>) null));
-        assertEquals(false, FilenameUtils.isExtension("file.txt", new ArrayList<String>()));
-        assertEquals(true, FilenameUtils.isExtension("file.txt", new ArrayList<String>(Arrays.asList(new String[] {"txt"}))));
-        assertEquals(false, FilenameUtils.isExtension("file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf"}))));
-        assertEquals(true, FilenameUtils.isExtension("file", new ArrayList<String>(Arrays.asList(new String[] {"rtf", ""}))));
-        assertEquals(true, FilenameUtils.isExtension("file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf", "txt"}))));
-        
-        assertEquals(false, FilenameUtils.isExtension("a/b/file.txt", (Collection<String>) null));
-        assertEquals(false, FilenameUtils.isExtension("a/b/file.txt", new ArrayList<String>()));
-        assertEquals(true, FilenameUtils.isExtension("a/b/file.txt", new ArrayList<String>(Arrays.asList(new String[] {"txt"}))));
-        assertEquals(false, FilenameUtils.isExtension("a/b/file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf"}))));
-        assertEquals(true, FilenameUtils.isExtension("a/b/file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf", "txt"}))));
-        
-        assertEquals(false, FilenameUtils.isExtension("a.b/file.txt", (Collection<String>) null));
-        assertEquals(false, FilenameUtils.isExtension("a.b/file.txt", new ArrayList<String>()));
-        assertEquals(true, FilenameUtils.isExtension("a.b/file.txt", new ArrayList<String>(Arrays.asList(new String[] {"txt"}))));
-        assertEquals(false, FilenameUtils.isExtension("a.b/file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf"}))));
-        assertEquals(true, FilenameUtils.isExtension("a.b/file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf", "txt"}))));
-        
-        assertEquals(false, FilenameUtils.isExtension("a\\b\\file.txt", (Collection<String>) null));
-        assertEquals(false, FilenameUtils.isExtension("a\\b\\file.txt", new ArrayList<String>()));
-        assertEquals(true, FilenameUtils.isExtension("a\\b\\file.txt", new ArrayList<String>(Arrays.asList(new String[] {"txt"}))));
-        assertEquals(false, FilenameUtils.isExtension("a\\b\\file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf"}))));
-        assertEquals(true, FilenameUtils.isExtension("a\\b\\file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf", "txt"}))));
-        
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", (Collection<String>) null));
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", new ArrayList<String>()));
-        assertEquals(true, FilenameUtils.isExtension("a.b\\file.txt", new ArrayList<String>(Arrays.asList(new String[] {"txt"}))));
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf"}))));
-        assertEquals(true, FilenameUtils.isExtension("a.b\\file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf", "txt"}))));
+        assertFalse(FilenameUtils.isExtension(null, (Collection<String>) null));
+        assertFalse(FilenameUtils.isExtension("file.txt", (Collection<String>) null));
+        assertTrue(FilenameUtils.isExtension("file", (Collection<String>) null));
+        assertFalse(FilenameUtils.isExtension("file.txt", new ArrayList<String>()));
+        assertTrue(FilenameUtils.isExtension("file.txt", new ArrayList<String>(Arrays.asList(new String[] {"txt"}))));
+        assertFalse(FilenameUtils.isExtension("file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf"}))));
+        assertTrue(FilenameUtils.isExtension("file", new ArrayList<String>(Arrays.asList(new String[] {"rtf", ""}))));
+        assertTrue(FilenameUtils.isExtension("file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf", "txt"}))));
+        
+        assertFalse(FilenameUtils.isExtension("a/b/file.txt", (Collection<String>) null));
+        assertFalse(FilenameUtils.isExtension("a/b/file.txt", new ArrayList<String>()));
+        assertTrue(FilenameUtils.isExtension("a/b/file.txt", new ArrayList<String>(Arrays.asList(new String[] {"txt"}))));
+        assertFalse(FilenameUtils.isExtension("a/b/file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf"}))));
+        assertTrue(FilenameUtils.isExtension("a/b/file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf", "txt"}))));
+        
+        assertFalse(FilenameUtils.isExtension("a.b/file.txt", (Collection<String>) null));
+        assertFalse(FilenameUtils.isExtension("a.b/file.txt", new ArrayList<String>()));
+        assertTrue(FilenameUtils.isExtension("a.b/file.txt", new ArrayList<String>(Arrays.asList(new String[] {"txt"}))));
+        assertFalse(FilenameUtils.isExtension("a.b/file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf"}))));
+        assertTrue(FilenameUtils.isExtension("a.b/file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf", "txt"}))));
+        
+        assertFalse(FilenameUtils.isExtension("a\\b\\file.txt", (Collection<String>) null));
+        assertFalse(FilenameUtils.isExtension("a\\b\\file.txt", new ArrayList<String>()));
+        assertTrue(FilenameUtils.isExtension("a\\b\\file.txt", new ArrayList<String>(Arrays.asList(new String[] {"txt"}))));
+        assertFalse(FilenameUtils.isExtension("a\\b\\file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf"}))));
+        assertTrue(FilenameUtils.isExtension("a\\b\\file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf", "txt"}))));
+        
+        assertFalse(FilenameUtils.isExtension("a.b\\file.txt", (Collection<String>) null));
+        assertFalse(FilenameUtils.isExtension("a.b\\file.txt", new ArrayList<String>()));
+        assertTrue(FilenameUtils.isExtension("a.b\\file.txt", new ArrayList<String>(Arrays.asList(new String[] {"txt"}))));
+        assertFalse(FilenameUtils.isExtension("a.b\\file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf"}))));
+        assertTrue(FilenameUtils.isExtension("a.b\\file.txt", new ArrayList<String>(Arrays.asList(new String[] {"rtf", "txt"}))));
         
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", new ArrayList<String>(Arrays.asList(new String[] {"TXT"}))));
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", new ArrayList<String>(Arrays.asList(new String[] {"TXT", "RTF"}))));
+        assertFalse(FilenameUtils.isExtension("a.b\\file.txt", new ArrayList<String>(Arrays.asList(new String[] {"TXT"}))));
+        assertFalse(FilenameUtils.isExtension("a.b\\file.txt", new ArrayList<String>(Arrays.asList(new String[] {"TXT", "RTF"}))));
     }
 
 }

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsWildcardTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsWildcardTestCase.java?rev=1302017&r1=1302016&r2=1302017&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsWildcardTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsWildcardTestCase.java Sat Mar 17 21:36:05 2012
@@ -34,47 +34,47 @@ public class FilenameUtilsWildcardTestCa
     //   FilenameUtils.wildcardMatch(String,String)
 
     public void testMatch() {
-        assertEquals(false, FilenameUtils.wildcardMatch(null, "Foo"));
-        assertEquals(false, FilenameUtils.wildcardMatch("Foo", null));
-        assertEquals(true, FilenameUtils.wildcardMatch(null, null));
-        assertEquals(true, FilenameUtils.wildcardMatch("Foo", "Foo"));
-        assertEquals(true, FilenameUtils.wildcardMatch("", ""));
-        assertEquals(true, FilenameUtils.wildcardMatch("", "*"));
-        assertEquals(false, FilenameUtils.wildcardMatch("", "?"));
-        assertEquals(true, FilenameUtils.wildcardMatch("Foo", "Fo*"));
-        assertEquals(true, FilenameUtils.wildcardMatch("Foo", "Fo?"));
-        assertEquals(true, FilenameUtils.wildcardMatch("Foo Bar and Catflap", "Fo*"));
-        assertEquals(true, FilenameUtils.wildcardMatch("New Bookmarks", "N?w ?o?k??r?s"));
-        assertEquals(false, FilenameUtils.wildcardMatch("Foo", "Bar"));
-        assertEquals(true, FilenameUtils.wildcardMatch("Foo Bar Foo", "F*o Bar*"));
-        assertEquals(true, FilenameUtils.wildcardMatch("Adobe Acrobat Installer", "Ad*er"));
-        assertEquals(true, FilenameUtils.wildcardMatch("Foo", "*Foo"));
-        assertEquals(true, FilenameUtils.wildcardMatch("BarFoo", "*Foo"));
-        assertEquals(true, FilenameUtils.wildcardMatch("Foo", "Foo*"));
-        assertEquals(true, FilenameUtils.wildcardMatch("FooBar", "Foo*"));
-        assertEquals(false, FilenameUtils.wildcardMatch("FOO", "*Foo"));
-        assertEquals(false, FilenameUtils.wildcardMatch("BARFOO", "*Foo"));
-        assertEquals(false, FilenameUtils.wildcardMatch("FOO", "Foo*"));
-        assertEquals(false, FilenameUtils.wildcardMatch("FOOBAR", "Foo*"));
+        assertFalse(FilenameUtils.wildcardMatch(null, "Foo"));
+        assertFalse(FilenameUtils.wildcardMatch("Foo", null));
+        assertTrue(FilenameUtils.wildcardMatch(null, null));
+        assertTrue(FilenameUtils.wildcardMatch("Foo", "Foo"));
+        assertTrue(FilenameUtils.wildcardMatch("", ""));
+        assertTrue(FilenameUtils.wildcardMatch("", "*"));
+        assertFalse(FilenameUtils.wildcardMatch("", "?"));
+        assertTrue(FilenameUtils.wildcardMatch("Foo", "Fo*"));
+        assertTrue(FilenameUtils.wildcardMatch("Foo", "Fo?"));
+        assertTrue(FilenameUtils.wildcardMatch("Foo Bar and Catflap", "Fo*"));
+        assertTrue(FilenameUtils.wildcardMatch("New Bookmarks", "N?w ?o?k??r?s"));
+        assertFalse(FilenameUtils.wildcardMatch("Foo", "Bar"));
+        assertTrue(FilenameUtils.wildcardMatch("Foo Bar Foo", "F*o Bar*"));
+        assertTrue(FilenameUtils.wildcardMatch("Adobe Acrobat Installer", "Ad*er"));
+        assertTrue(FilenameUtils.wildcardMatch("Foo", "*Foo"));
+        assertTrue(FilenameUtils.wildcardMatch("BarFoo", "*Foo"));
+        assertTrue(FilenameUtils.wildcardMatch("Foo", "Foo*"));
+        assertTrue(FilenameUtils.wildcardMatch("FooBar", "Foo*"));
+        assertFalse(FilenameUtils.wildcardMatch("FOO", "*Foo"));
+        assertFalse(FilenameUtils.wildcardMatch("BARFOO", "*Foo"));
+        assertFalse(FilenameUtils.wildcardMatch("FOO", "Foo*"));
+        assertFalse(FilenameUtils.wildcardMatch("FOOBAR", "Foo*"));
     }
 
     public void testMatchOnSystem() {
-        assertEquals(false, FilenameUtils.wildcardMatchOnSystem(null, "Foo"));
-        assertEquals(false, FilenameUtils.wildcardMatchOnSystem("Foo", null));
-        assertEquals(true, FilenameUtils.wildcardMatchOnSystem(null, null));
-        assertEquals(true, FilenameUtils.wildcardMatchOnSystem("Foo", "Foo"));
-        assertEquals(true, FilenameUtils.wildcardMatchOnSystem("", ""));
-        assertEquals(true, FilenameUtils.wildcardMatchOnSystem("Foo", "Fo*"));
-        assertEquals(true, FilenameUtils.wildcardMatchOnSystem("Foo", "Fo?"));
-        assertEquals(true, FilenameUtils.wildcardMatchOnSystem("Foo Bar and Catflap", "Fo*"));
-        assertEquals(true, FilenameUtils.wildcardMatchOnSystem("New Bookmarks", "N?w ?o?k??r?s"));
-        assertEquals(false, FilenameUtils.wildcardMatchOnSystem("Foo", "Bar"));
-        assertEquals(true, FilenameUtils.wildcardMatchOnSystem("Foo Bar Foo", "F*o Bar*"));
-        assertEquals(true, FilenameUtils.wildcardMatchOnSystem("Adobe Acrobat Installer", "Ad*er"));
-        assertEquals(true, FilenameUtils.wildcardMatchOnSystem("Foo", "*Foo"));
-        assertEquals(true, FilenameUtils.wildcardMatchOnSystem("BarFoo", "*Foo"));
-        assertEquals(true, FilenameUtils.wildcardMatchOnSystem("Foo", "Foo*"));
-        assertEquals(true, FilenameUtils.wildcardMatchOnSystem("FooBar", "Foo*"));
+        assertFalse(FilenameUtils.wildcardMatchOnSystem(null, "Foo"));
+        assertFalse(FilenameUtils.wildcardMatchOnSystem("Foo", null));
+        assertTrue(FilenameUtils.wildcardMatchOnSystem(null, null));
+        assertTrue(FilenameUtils.wildcardMatchOnSystem("Foo", "Foo"));
+        assertTrue(FilenameUtils.wildcardMatchOnSystem("", ""));
+        assertTrue(FilenameUtils.wildcardMatchOnSystem("Foo", "Fo*"));
+        assertTrue(FilenameUtils.wildcardMatchOnSystem("Foo", "Fo?"));
+        assertTrue(FilenameUtils.wildcardMatchOnSystem("Foo Bar and Catflap", "Fo*"));
+        assertTrue(FilenameUtils.wildcardMatchOnSystem("New Bookmarks", "N?w ?o?k??r?s"));
+        assertFalse(FilenameUtils.wildcardMatchOnSystem("Foo", "Bar"));
+        assertTrue(FilenameUtils.wildcardMatchOnSystem("Foo Bar Foo", "F*o Bar*"));
+        assertTrue(FilenameUtils.wildcardMatchOnSystem("Adobe Acrobat Installer", "Ad*er"));
+        assertTrue(FilenameUtils.wildcardMatchOnSystem("Foo", "*Foo"));
+        assertTrue(FilenameUtils.wildcardMatchOnSystem("BarFoo", "*Foo"));
+        assertTrue(FilenameUtils.wildcardMatchOnSystem("Foo", "Foo*"));
+        assertTrue(FilenameUtils.wildcardMatchOnSystem("FooBar", "Foo*"));
         assertEquals(WINDOWS, FilenameUtils.wildcardMatchOnSystem("FOO", "*Foo"));
         assertEquals(WINDOWS, FilenameUtils.wildcardMatchOnSystem("BARFOO", "*Foo"));
         assertEquals(WINDOWS, FilenameUtils.wildcardMatchOnSystem("FOO", "Foo*"));
@@ -82,33 +82,33 @@ public class FilenameUtilsWildcardTestCa
     }
 
     public void testMatchCaseSpecified() {
-        assertEquals(false, FilenameUtils.wildcardMatch(null, "Foo", IOCase.SENSITIVE));
-        assertEquals(false, FilenameUtils.wildcardMatch("Foo", null, IOCase.SENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch(null, null, IOCase.SENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch("Foo", "Foo", IOCase.SENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch("", "", IOCase.SENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch("Foo", "Fo*", IOCase.SENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch("Foo", "Fo?", IOCase.SENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch("Foo Bar and Catflap", "Fo*", IOCase.SENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch("New Bookmarks", "N?w ?o?k??r?s", IOCase.SENSITIVE));
-        assertEquals(false, FilenameUtils.wildcardMatch("Foo", "Bar", IOCase.SENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch("Foo Bar Foo", "F*o Bar*", IOCase.SENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch("Adobe Acrobat Installer", "Ad*er", IOCase.SENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch("Foo", "*Foo", IOCase.SENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch("Foo", "Foo*", IOCase.SENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch("Foo", "*Foo", IOCase.SENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch("BarFoo", "*Foo", IOCase.SENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch("Foo", "Foo*", IOCase.SENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch("FooBar", "Foo*", IOCase.SENSITIVE));
+        assertFalse(FilenameUtils.wildcardMatch(null, "Foo", IOCase.SENSITIVE));
+        assertFalse(FilenameUtils.wildcardMatch("Foo", null, IOCase.SENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch(null, null, IOCase.SENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch("Foo", "Foo", IOCase.SENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch("", "", IOCase.SENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch("Foo", "Fo*", IOCase.SENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch("Foo", "Fo?", IOCase.SENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch("Foo Bar and Catflap", "Fo*", IOCase.SENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch("New Bookmarks", "N?w ?o?k??r?s", IOCase.SENSITIVE));
+        assertFalse(FilenameUtils.wildcardMatch("Foo", "Bar", IOCase.SENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch("Foo Bar Foo", "F*o Bar*", IOCase.SENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch("Adobe Acrobat Installer", "Ad*er", IOCase.SENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch("Foo", "*Foo", IOCase.SENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch("Foo", "Foo*", IOCase.SENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch("Foo", "*Foo", IOCase.SENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch("BarFoo", "*Foo", IOCase.SENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch("Foo", "Foo*", IOCase.SENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch("FooBar", "Foo*", IOCase.SENSITIVE));
         
-        assertEquals(false, FilenameUtils.wildcardMatch("FOO", "*Foo", IOCase.SENSITIVE));
-        assertEquals(false, FilenameUtils.wildcardMatch("BARFOO", "*Foo", IOCase.SENSITIVE));
-        assertEquals(false, FilenameUtils.wildcardMatch("FOO", "Foo*", IOCase.SENSITIVE));
-        assertEquals(false, FilenameUtils.wildcardMatch("FOOBAR", "Foo*", IOCase.SENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch("FOO", "*Foo", IOCase.INSENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch("BARFOO", "*Foo", IOCase.INSENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch("FOO", "Foo*", IOCase.INSENSITIVE));
-        assertEquals(true, FilenameUtils.wildcardMatch("FOOBAR", "Foo*", IOCase.INSENSITIVE));
+        assertFalse(FilenameUtils.wildcardMatch("FOO", "*Foo", IOCase.SENSITIVE));
+        assertFalse(FilenameUtils.wildcardMatch("BARFOO", "*Foo", IOCase.SENSITIVE));
+        assertFalse(FilenameUtils.wildcardMatch("FOO", "Foo*", IOCase.SENSITIVE));
+        assertFalse(FilenameUtils.wildcardMatch("FOOBAR", "Foo*", IOCase.SENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch("FOO", "*Foo", IOCase.INSENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch("BARFOO", "*Foo", IOCase.INSENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch("FOO", "Foo*", IOCase.INSENSITIVE));
+        assertTrue(FilenameUtils.wildcardMatch("FOOBAR", "Foo*", IOCase.INSENSITIVE));
         assertEquals(WINDOWS, FilenameUtils.wildcardMatch("FOO", "*Foo", IOCase.SYSTEM));
         assertEquals(WINDOWS, FilenameUtils.wildcardMatch("BARFOO", "*Foo", IOCase.SYSTEM));
         assertEquals(WINDOWS, FilenameUtils.wildcardMatch("FOO", "Foo*", IOCase.SYSTEM));

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOCaseTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOCaseTestCase.java?rev=1302017&r1=1302016&r2=1302017&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOCaseTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOCaseTestCase.java Sat Mar 17 21:36:05 2012
@@ -80,8 +80,8 @@ public class IOCaseTestCase extends File
     }
 
     public void test_isCaseSensitive() throws Exception {
-        assertEquals(true, IOCase.SENSITIVE.isCaseSensitive());
-        assertEquals(false, IOCase.INSENSITIVE.isCaseSensitive());
+        assertTrue(IOCase.SENSITIVE.isCaseSensitive());
+        assertFalse(IOCase.INSENSITIVE.isCaseSensitive());
         assertEquals(!WINDOWS, IOCase.SYSTEM.isCaseSensitive());
     }
     //-----------------------------------------------------------------------
@@ -124,15 +124,15 @@ public class IOCaseTestCase extends File
 
     //-----------------------------------------------------------------------
     public void test_checkEquals_functionality() throws Exception {
-        assertEquals(false, IOCase.SENSITIVE.checkEquals("ABC", ""));
-        assertEquals(false, IOCase.SENSITIVE.checkEquals("ABC", "A"));
-        assertEquals(false, IOCase.SENSITIVE.checkEquals("ABC", "AB"));
-        assertEquals(true, IOCase.SENSITIVE.checkEquals("ABC", "ABC"));
-        assertEquals(false, IOCase.SENSITIVE.checkEquals("ABC", "BC"));
-        assertEquals(false, IOCase.SENSITIVE.checkEquals("ABC", "C"));
-        assertEquals(false, IOCase.SENSITIVE.checkEquals("ABC", "ABCD"));
-        assertEquals(false, IOCase.SENSITIVE.checkEquals("", "ABC"));
-        assertEquals(true, IOCase.SENSITIVE.checkEquals("", ""));
+        assertFalse(IOCase.SENSITIVE.checkEquals("ABC", ""));
+        assertFalse(IOCase.SENSITIVE.checkEquals("ABC", "A"));
+        assertFalse(IOCase.SENSITIVE.checkEquals("ABC", "AB"));
+        assertTrue(IOCase.SENSITIVE.checkEquals("ABC", "ABC"));
+        assertFalse(IOCase.SENSITIVE.checkEquals("ABC", "BC"));
+        assertFalse(IOCase.SENSITIVE.checkEquals("ABC", "C"));
+        assertFalse(IOCase.SENSITIVE.checkEquals("ABC", "ABCD"));
+        assertFalse(IOCase.SENSITIVE.checkEquals("", "ABC"));
+        assertTrue(IOCase.SENSITIVE.checkEquals("", ""));
         
         try {
             IOCase.SENSITIVE.checkEquals("ABC", null);
@@ -149,27 +149,27 @@ public class IOCaseTestCase extends File
     }
 
     public void test_checkEquals_case() throws Exception {
-        assertEquals(true, IOCase.SENSITIVE.checkEquals("ABC", "ABC"));
-        assertEquals(false, IOCase.SENSITIVE.checkEquals("ABC", "Abc"));
+        assertTrue(IOCase.SENSITIVE.checkEquals("ABC", "ABC"));
+        assertFalse(IOCase.SENSITIVE.checkEquals("ABC", "Abc"));
         
-        assertEquals(true, IOCase.INSENSITIVE.checkEquals("ABC", "ABC"));
-        assertEquals(true, IOCase.INSENSITIVE.checkEquals("ABC", "Abc"));
+        assertTrue(IOCase.INSENSITIVE.checkEquals("ABC", "ABC"));
+        assertTrue(IOCase.INSENSITIVE.checkEquals("ABC", "Abc"));
         
-        assertEquals(true, IOCase.SYSTEM.checkEquals("ABC", "ABC"));
+        assertTrue(IOCase.SYSTEM.checkEquals("ABC", "ABC"));
         assertEquals(WINDOWS, IOCase.SYSTEM.checkEquals("ABC", "Abc"));
     }
 
     //-----------------------------------------------------------------------
     public void test_checkStartsWith_functionality() throws Exception {
-        assertEquals(true, IOCase.SENSITIVE.checkStartsWith("ABC", ""));
-        assertEquals(true, IOCase.SENSITIVE.checkStartsWith("ABC", "A"));
-        assertEquals(true, IOCase.SENSITIVE.checkStartsWith("ABC", "AB"));
-        assertEquals(true, IOCase.SENSITIVE.checkStartsWith("ABC", "ABC"));
-        assertEquals(false, IOCase.SENSITIVE.checkStartsWith("ABC", "BC"));
-        assertEquals(false, IOCase.SENSITIVE.checkStartsWith("ABC", "C"));
-        assertEquals(false, IOCase.SENSITIVE.checkStartsWith("ABC", "ABCD"));
-        assertEquals(false, IOCase.SENSITIVE.checkStartsWith("", "ABC"));
-        assertEquals(true, IOCase.SENSITIVE.checkStartsWith("", ""));
+        assertTrue(IOCase.SENSITIVE.checkStartsWith("ABC", ""));
+        assertTrue(IOCase.SENSITIVE.checkStartsWith("ABC", "A"));
+        assertTrue(IOCase.SENSITIVE.checkStartsWith("ABC", "AB"));
+        assertTrue(IOCase.SENSITIVE.checkStartsWith("ABC", "ABC"));
+        assertFalse(IOCase.SENSITIVE.checkStartsWith("ABC", "BC"));
+        assertFalse(IOCase.SENSITIVE.checkStartsWith("ABC", "C"));
+        assertFalse(IOCase.SENSITIVE.checkStartsWith("ABC", "ABCD"));
+        assertFalse(IOCase.SENSITIVE.checkStartsWith("", "ABC"));
+        assertTrue(IOCase.SENSITIVE.checkStartsWith("", ""));
         
         try {
             IOCase.SENSITIVE.checkStartsWith("ABC", null);
@@ -186,27 +186,27 @@ public class IOCaseTestCase extends File
     }
 
     public void test_checkStartsWith_case() throws Exception {
-        assertEquals(true, IOCase.SENSITIVE.checkStartsWith("ABC", "AB"));
-        assertEquals(false, IOCase.SENSITIVE.checkStartsWith("ABC", "Ab"));
+        assertTrue(IOCase.SENSITIVE.checkStartsWith("ABC", "AB"));
+        assertFalse(IOCase.SENSITIVE.checkStartsWith("ABC", "Ab"));
         
-        assertEquals(true, IOCase.INSENSITIVE.checkStartsWith("ABC", "AB"));
-        assertEquals(true, IOCase.INSENSITIVE.checkStartsWith("ABC", "Ab"));
+        assertTrue(IOCase.INSENSITIVE.checkStartsWith("ABC", "AB"));
+        assertTrue(IOCase.INSENSITIVE.checkStartsWith("ABC", "Ab"));
         
-        assertEquals(true, IOCase.SYSTEM.checkStartsWith("ABC", "AB"));
+        assertTrue(IOCase.SYSTEM.checkStartsWith("ABC", "AB"));
         assertEquals(WINDOWS, IOCase.SYSTEM.checkStartsWith("ABC", "Ab"));
     }
 
     //-----------------------------------------------------------------------
     public void test_checkEndsWith_functionality() throws Exception {
-        assertEquals(true, IOCase.SENSITIVE.checkEndsWith("ABC", ""));
-        assertEquals(false, IOCase.SENSITIVE.checkEndsWith("ABC", "A"));
-        assertEquals(false, IOCase.SENSITIVE.checkEndsWith("ABC", "AB"));
-        assertEquals(true, IOCase.SENSITIVE.checkEndsWith("ABC", "ABC"));
-        assertEquals(true, IOCase.SENSITIVE.checkEndsWith("ABC", "BC"));
-        assertEquals(true, IOCase.SENSITIVE.checkEndsWith("ABC", "C"));
-        assertEquals(false, IOCase.SENSITIVE.checkEndsWith("ABC", "ABCD"));
-        assertEquals(false, IOCase.SENSITIVE.checkEndsWith("", "ABC"));
-        assertEquals(true, IOCase.SENSITIVE.checkEndsWith("", ""));
+        assertTrue(IOCase.SENSITIVE.checkEndsWith("ABC", ""));
+        assertFalse(IOCase.SENSITIVE.checkEndsWith("ABC", "A"));
+        assertFalse(IOCase.SENSITIVE.checkEndsWith("ABC", "AB"));
+        assertTrue(IOCase.SENSITIVE.checkEndsWith("ABC", "ABC"));
+        assertTrue(IOCase.SENSITIVE.checkEndsWith("ABC", "BC"));
+        assertTrue(IOCase.SENSITIVE.checkEndsWith("ABC", "C"));
+        assertFalse(IOCase.SENSITIVE.checkEndsWith("ABC", "ABCD"));
+        assertFalse(IOCase.SENSITIVE.checkEndsWith("", "ABC"));
+        assertTrue(IOCase.SENSITIVE.checkEndsWith("", ""));
         
         try {
             IOCase.SENSITIVE.checkEndsWith("ABC", null);
@@ -223,13 +223,13 @@ public class IOCaseTestCase extends File
     }
 
     public void test_checkEndsWith_case() throws Exception {
-        assertEquals(true, IOCase.SENSITIVE.checkEndsWith("ABC", "BC"));
-        assertEquals(false, IOCase.SENSITIVE.checkEndsWith("ABC", "Bc"));
+        assertTrue(IOCase.SENSITIVE.checkEndsWith("ABC", "BC"));
+        assertFalse(IOCase.SENSITIVE.checkEndsWith("ABC", "Bc"));
         
-        assertEquals(true, IOCase.INSENSITIVE.checkEndsWith("ABC", "BC"));
-        assertEquals(true, IOCase.INSENSITIVE.checkEndsWith("ABC", "Bc"));
+        assertTrue(IOCase.INSENSITIVE.checkEndsWith("ABC", "BC"));
+        assertTrue(IOCase.INSENSITIVE.checkEndsWith("ABC", "Bc"));
         
-        assertEquals(true, IOCase.SYSTEM.checkEndsWith("ABC", "BC"));
+        assertTrue(IOCase.SYSTEM.checkEndsWith("ABC", "BC"));
         assertEquals(WINDOWS, IOCase.SYSTEM.checkEndsWith("ABC", "Bc"));
     }
 
@@ -299,25 +299,25 @@ public class IOCaseTestCase extends File
 
     //-----------------------------------------------------------------------
     public void test_checkRegionMatches_functionality() throws Exception {
-        assertEquals(true, IOCase.SENSITIVE.checkRegionMatches("ABC", 0, ""));
-        assertEquals(true, IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "A"));
-        assertEquals(true, IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "AB"));
-        assertEquals(true, IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "ABC"));
-        assertEquals(false, IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "BC"));
-        assertEquals(false, IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "C"));
-        assertEquals(false, IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "ABCD"));
-        assertEquals(false, IOCase.SENSITIVE.checkRegionMatches("", 0, "ABC"));
-        assertEquals(true, IOCase.SENSITIVE.checkRegionMatches("", 0, ""));
-        
-        assertEquals(true, IOCase.SENSITIVE.checkRegionMatches("ABC", 1, ""));
-        assertEquals(false, IOCase.SENSITIVE.checkRegionMatches("ABC", 1, "A"));
-        assertEquals(false, IOCase.SENSITIVE.checkRegionMatches("ABC", 1, "AB"));
-        assertEquals(false, IOCase.SENSITIVE.checkRegionMatches("ABC", 1, "ABC"));
-        assertEquals(true, IOCase.SENSITIVE.checkRegionMatches("ABC", 1, "BC"));
-        assertEquals(false, IOCase.SENSITIVE.checkRegionMatches("ABC", 1, "C"));
-        assertEquals(false, IOCase.SENSITIVE.checkRegionMatches("ABC", 1, "ABCD"));
-        assertEquals(false, IOCase.SENSITIVE.checkRegionMatches("", 1, "ABC"));
-        assertEquals(false, IOCase.SENSITIVE.checkRegionMatches("", 1, ""));
+        assertTrue(IOCase.SENSITIVE.checkRegionMatches("ABC", 0, ""));
+        assertTrue(IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "A"));
+        assertTrue(IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "AB"));
+        assertTrue(IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "ABC"));
+        assertFalse(IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "BC"));
+        assertFalse(IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "C"));
+        assertFalse(IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "ABCD"));
+        assertFalse(IOCase.SENSITIVE.checkRegionMatches("", 0, "ABC"));
+        assertTrue(IOCase.SENSITIVE.checkRegionMatches("", 0, ""));
+        
+        assertTrue(IOCase.SENSITIVE.checkRegionMatches("ABC", 1, ""));
+        assertFalse(IOCase.SENSITIVE.checkRegionMatches("ABC", 1, "A"));
+        assertFalse(IOCase.SENSITIVE.checkRegionMatches("ABC", 1, "AB"));
+        assertFalse(IOCase.SENSITIVE.checkRegionMatches("ABC", 1, "ABC"));
+        assertTrue(IOCase.SENSITIVE.checkRegionMatches("ABC", 1, "BC"));
+        assertFalse(IOCase.SENSITIVE.checkRegionMatches("ABC", 1, "C"));
+        assertFalse(IOCase.SENSITIVE.checkRegionMatches("ABC", 1, "ABCD"));
+        assertFalse(IOCase.SENSITIVE.checkRegionMatches("", 1, "ABC"));
+        assertFalse(IOCase.SENSITIVE.checkRegionMatches("", 1, ""));
         
         try {
             IOCase.SENSITIVE.checkRegionMatches("ABC", 0, null);
@@ -346,13 +346,13 @@ public class IOCaseTestCase extends File
     }
 
     public void test_checkRegionMatches_case() throws Exception {
-        assertEquals(true, IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "AB"));
-        assertEquals(false, IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "Ab"));
+        assertTrue(IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "AB"));
+        assertFalse(IOCase.SENSITIVE.checkRegionMatches("ABC", 0, "Ab"));
         
-        assertEquals(true, IOCase.INSENSITIVE.checkRegionMatches("ABC", 0, "AB"));
-        assertEquals(true, IOCase.INSENSITIVE.checkRegionMatches("ABC", 0, "Ab"));
+        assertTrue(IOCase.INSENSITIVE.checkRegionMatches("ABC", 0, "AB"));
+        assertTrue(IOCase.INSENSITIVE.checkRegionMatches("ABC", 0, "Ab"));
         
-        assertEquals(true, IOCase.SYSTEM.checkRegionMatches("ABC", 0, "AB"));
+        assertTrue(IOCase.SYSTEM.checkRegionMatches("ABC", 0, "AB"));
         assertEquals(WINDOWS, IOCase.SYSTEM.checkRegionMatches("ABC", 0, "Ab"));
     }
 

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/filefilter/FileFilterTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/filefilter/FileFilterTestCase.java?rev=1302017&r1=1302016&r2=1302017&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/filefilter/FileFilterTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/filefilter/FileFilterTestCase.java Sat Mar 17 21:36:05 2012
@@ -446,7 +446,7 @@ public class FileFilterTestCase extends 
         }
 
         AndFileFilter f = new AndFileFilter((List<IOFileFilter>) null);
-        assertEquals(true, f.getFileFilters().isEmpty());
+        assertTrue(f.getFileFilters().isEmpty());
     }
 
     public void testOr() throws Exception {
@@ -483,7 +483,7 @@ public class FileFilterTestCase extends 
         }
         
         OrFileFilter f = new OrFileFilter((List<IOFileFilter>) null);
-        assertEquals(true, f.getFileFilters().isEmpty());
+        assertTrue(f.getFileFilters().isEmpty());
     }
     public void testFileFilterUtils_and() throws Exception {
         IOFileFilter trueFilter = TrueFileFilter.INSTANCE;

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/FileWriterWithEncodingTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/FileWriterWithEncodingTest.java?rev=1302017&r1=1302016&r2=1302017&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/FileWriterWithEncodingTest.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/FileWriterWithEncodingTest.java Sat Mar 17 21:36:05 2012
@@ -81,8 +81,8 @@ public class FileWriterWithEncodingTest 
         try {
             fw1 = new FileWriter(file1);  // default encoding
             fw2 = new FileWriterWithEncoding(file2, defaultEncoding);
-            assertEquals(true, file1.exists());
-            assertEquals(true, file2.exists());
+            assertTrue(file1.exists());
+            assertTrue(file2.exists());
             
             fw1.write(textContent);
             fw2.write(textContent);
@@ -95,8 +95,8 @@ public class FileWriterWithEncodingTest 
             IOUtils.closeQuietly(fw1);
             IOUtils.closeQuietly(fw2);
         }
-        assertEquals(true, file1.exists());
-        assertEquals(true, file2.exists());
+        assertTrue(file1.exists());
+        assertTrue(file2.exists());
     }
 
     public void testDifferentEncoding() throws Exception {
@@ -106,8 +106,8 @@ public class FileWriterWithEncodingTest 
             try {
                 fw1 = new FileWriter(file1);  // default encoding
                 fw2 = new FileWriterWithEncoding(file2, defaultEncoding);
-                assertEquals(true, file1.exists());
-                assertEquals(true, file2.exists());
+                assertTrue(file1.exists());
+                assertTrue(file2.exists());
                 
                 fw1.write(textContent);
                 fw2.write(textContent);
@@ -125,8 +125,8 @@ public class FileWriterWithEncodingTest 
                 IOUtils.closeQuietly(fw1);
                 IOUtils.closeQuietly(fw2);
             }
-            assertEquals(true, file1.exists());
-            assertEquals(true, file2.exists());
+            assertTrue(file1.exists());
+            assertTrue(file2.exists());
         }
         if (Charset.isSupported("UTF-16LE")) {
             FileWriter fw1 = null;
@@ -134,8 +134,8 @@ public class FileWriterWithEncodingTest 
             try {
                 fw1 = new FileWriter(file1);  // default encoding
                 fw2 = new FileWriterWithEncoding(file2, defaultEncoding);
-                assertEquals(true, file1.exists());
-                assertEquals(true, file2.exists());
+                assertTrue(file1.exists());
+                assertTrue(file2.exists());
                 
                 fw1.write(textContent);
                 fw2.write(textContent);
@@ -153,8 +153,8 @@ public class FileWriterWithEncodingTest 
                 IOUtils.closeQuietly(fw1);
                 IOUtils.closeQuietly(fw2);
             }
-            assertEquals(true, file1.exists());
-            assertEquals(true, file2.exists());
+            assertTrue(file1.exists());
+            assertTrue(file2.exists());
         }
     }
 
@@ -166,11 +166,11 @@ public class FileWriterWithEncodingTest 
             fail();
         } catch (IOException ex) {
             // expected
-            assertEquals(false, file1.exists());
+            assertFalse(file1.exists());
         } finally {
             IOUtils.closeQuietly(writer);
         }
-        assertEquals(false, file1.exists());
+        assertFalse(file1.exists());
     }
 
     //-----------------------------------------------------------------------
@@ -181,11 +181,11 @@ public class FileWriterWithEncodingTest 
             fail();
         } catch (IOException ex) {
             // expected
-            assertEquals(false, file1.exists());
+            assertFalse(file1.exists());
         } finally {
             IOUtils.closeQuietly(writer);
         }
-        assertEquals(false, file1.exists());
+        assertFalse(file1.exists());
     }
 
     //-----------------------------------------------------------------------
@@ -196,11 +196,11 @@ public class FileWriterWithEncodingTest 
             fail();
         } catch (NullPointerException ex) {
             // expected
-            assertEquals(false, file1.exists());
+            assertFalse(file1.exists());
         } finally {
             IOUtils.closeQuietly(writer);
         }
-        assertEquals(false, file1.exists());
+        assertFalse(file1.exists());
     }
 
     //-----------------------------------------------------------------------
@@ -211,11 +211,11 @@ public class FileWriterWithEncodingTest 
             fail();
         } catch (NullPointerException ex) {
             // expected
-            assertEquals(false, file1.exists());
+            assertFalse(file1.exists());
         } finally {
             IOUtils.closeQuietly(writer);
         }
-        assertEquals(false, file1.exists());
+        assertFalse(file1.exists());
     }
 
 }

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/LockableFileWriterTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/LockableFileWriterTest.java?rev=1302017&r1=1302016&r2=1302017&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/LockableFileWriterTest.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/LockableFileWriterTest.java Sat Mar 17 21:36:05 2012
@@ -65,8 +65,8 @@ public class LockableFileWriterTest exte
         try {
             // open a valid locakable writer
             lfw1 = new LockableFileWriter(file);
-            assertEquals(true, file.exists());
-            assertEquals(true, lockFile.exists());
+            assertTrue(file.exists());
+            assertTrue(lockFile.exists());
             
             // try to open a second writer
             try {
@@ -76,8 +76,8 @@ public class LockableFileWriterTest exte
                 String msg = ioe.getMessage();
                 assertTrue( "Exception message does not start correctly. ", 
                             msg.startsWith("Can't write file, lock ") );
-                assertEquals(true, file.exists());
-                assertEquals(true, lockFile.exists());
+                assertTrue(file.exists());
+                assertTrue(lockFile.exists());
             }
             
             // try to open a third writer
@@ -88,8 +88,8 @@ public class LockableFileWriterTest exte
                 String msg = ioe.getMessage();
                 assertTrue( "Exception message does not start correctly. ", 
                             msg.startsWith("Can't write file, lock ") );
-                assertEquals(true, file.exists());
-                assertEquals(true, lockFile.exists());
+                assertTrue(file.exists());
+                assertTrue(lockFile.exists());
             }
             
         } finally {
@@ -97,8 +97,8 @@ public class LockableFileWriterTest exte
             IOUtils.closeQuietly(lfw2);
             IOUtils.closeQuietly(lfw3);
         }
-        assertEquals(true, file.exists());
-        assertEquals(false, lockFile.exists());
+        assertTrue(file.exists());
+        assertFalse(lockFile.exists());
     }
 
     //-----------------------------------------------------------------------
@@ -108,8 +108,8 @@ public class LockableFileWriterTest exte
         try {
             // open a valid locakable writer
             lfw1 = new LockableFileWriter(file, true, altLockDir.getAbsolutePath());
-            assertEquals(true, file.exists());
-            assertEquals(true, altLockFile.exists());
+            assertTrue(file.exists());
+            assertTrue(altLockFile.exists());
             
             // try to open a second writer
             try {
@@ -119,16 +119,16 @@ public class LockableFileWriterTest exte
                 String msg = ioe.getMessage();
                 assertTrue( "Exception message does not start correctly. ", 
                             msg.startsWith("Can't write file, lock ") );
-                assertEquals(true, file.exists());
-                assertEquals(true, altLockFile.exists());
+                assertTrue(file.exists());
+                assertTrue(altLockFile.exists());
             }
             
         } finally {
             IOUtils.closeQuietly(lfw1);
             IOUtils.closeQuietly(lfw2);
         }
-        assertEquals(true, file.exists());
-        assertEquals(false, altLockFile.exists());
+        assertTrue(file.exists());
+        assertFalse(altLockFile.exists());
     }
 
     //-----------------------------------------------------------------------
@@ -137,25 +137,25 @@ public class LockableFileWriterTest exte
         LockableFileWriter lfw1 = null;
         try {
             lfw1 = new LockableFileWriter(file);
-            assertEquals(true, file.exists());
-            assertEquals(true, lockFile.exists());
+            assertTrue(file.exists());
+            assertTrue(lockFile.exists());
         } finally {
             IOUtils.closeQuietly(lfw1);
         }
-        assertEquals(true, file.exists());
-        assertEquals(false, lockFile.exists());
+        assertTrue(file.exists());
+        assertFalse(lockFile.exists());
         
         // open a second valid writer on the same file
         LockableFileWriter lfw2 = null;
         try {
             lfw2 = new LockableFileWriter(file);
-            assertEquals(true, file.exists());
-            assertEquals(true, lockFile.exists());
+            assertTrue(file.exists());
+            assertTrue(lockFile.exists());
         } finally {
             IOUtils.closeQuietly(lfw2);
         }
-        assertEquals(true, file.exists());
-        assertEquals(false, lockFile.exists());
+        assertTrue(file.exists());
+        assertFalse(lockFile.exists());
     }
 
     //-----------------------------------------------------------------------
@@ -166,13 +166,13 @@ public class LockableFileWriterTest exte
             fail();
         } catch (IOException ex) {
             // expected
-            assertEquals(false, file.exists());
-            assertEquals(false, lockFile.exists());
+            assertFalse(file.exists());
+            assertFalse(lockFile.exists());
         } finally {
             IOUtils.closeQuietly(writer);
         }
-        assertEquals(false, file.exists());
-        assertEquals(false, lockFile.exists());
+        assertFalse(file.exists());
+        assertFalse(lockFile.exists());
     }
 
     //-----------------------------------------------------------------------
@@ -183,13 +183,13 @@ public class LockableFileWriterTest exte
             fail();
         } catch (IOException ex) {
             // expected
-            assertEquals(false, file.exists());
-            assertEquals(false, lockFile.exists());
+            assertFalse(file.exists());
+            assertFalse(lockFile.exists());
         } finally {
             IOUtils.closeQuietly(writer);
         }
-        assertEquals(false, file.exists());
-        assertEquals(false, lockFile.exists());
+        assertFalse(file.exists());
+        assertFalse(lockFile.exists());
     }
 
     //-----------------------------------------------------------------------
@@ -200,13 +200,13 @@ public class LockableFileWriterTest exte
             fail();
         } catch (NullPointerException ex) {
             // expected
-            assertEquals(false, file.exists());
-            assertEquals(false, lockFile.exists());
+            assertFalse(file.exists());
+            assertFalse(lockFile.exists());
         } finally {
             IOUtils.closeQuietly(writer);
         }
-        assertEquals(false, file.exists());
-        assertEquals(false, lockFile.exists());
+        assertFalse(file.exists());
+        assertFalse(lockFile.exists());
     }
 
     //-----------------------------------------------------------------------
@@ -217,13 +217,13 @@ public class LockableFileWriterTest exte
             fail();
         } catch (NullPointerException ex) {
             // expected
-            assertEquals(false, file.exists());
-            assertEquals(false, lockFile.exists());
+            assertFalse(file.exists());
+            assertFalse(lockFile.exists());
         } finally {
             IOUtils.closeQuietly(writer);
         }
-        assertEquals(false, file.exists());
-        assertEquals(false, lockFile.exists());
+        assertFalse(file.exists());
+        assertFalse(lockFile.exists());
     }
 
 }



Mime
View raw message