commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r806003 - /commons/proper/io/trunk/src/test/org/apache/commons/io/FilenameUtilsTestCase.java
Date Wed, 19 Aug 2009 22:43:10 GMT
Author: sebb
Date: Wed Aug 19 22:43:07 2009
New Revision: 806003

URL: http://svn.apache.org/viewvc?rev=806003&view=rev
Log:
Does not make sense to use static fields to hold file sizes for instance File fields
Fix raw types

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

Modified: commons/proper/io/trunk/src/test/org/apache/commons/io/FilenameUtilsTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/org/apache/commons/io/FilenameUtilsTestCase.java?rev=806003&r1=806002&r2=806003&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/org/apache/commons/io/FilenameUtilsTestCase.java (original)
+++ commons/proper/io/trunk/src/test/org/apache/commons/io/FilenameUtilsTestCase.java Wed
Aug 19 22:43:07 2009
@@ -17,7 +17,6 @@
 package org.apache.commons.io;
 
 import java.io.File;
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -45,8 +44,8 @@
     private File testFile1;
     private File testFile2;
 
-    private static int testFile1Size;
-    private static int testFile2Size;
+    private int testFile1Size;
+    private int testFile2Size;
 
     public static void main(String[] args) {
         TestRunner.run(suite());
@@ -56,7 +55,7 @@
         return new TestSuite(FilenameUtilsTestCase.class);
     }
 
-    public FilenameUtilsTestCase(String name) throws IOException {
+    public FilenameUtilsTestCase(String name) {
         super(name);
 
         testFile1 = new File(getTestDirectory(), "file1-test.txt");
@@ -915,41 +914,41 @@
     }
 
     public void testIsExtensionCollection() {
-        assertEquals(false, FilenameUtils.isExtension(null, (Collection) null));
-        assertEquals(false, FilenameUtils.isExtension("file.txt", (Collection) null));
-        assertEquals(true, FilenameUtils.isExtension("file", (Collection) null));
-        assertEquals(false, FilenameUtils.isExtension("file.txt", new ArrayList()));
-        assertEquals(true, FilenameUtils.isExtension("file.txt", new ArrayList(Arrays.asList(new
String[] {"txt"}))));
-        assertEquals(false, FilenameUtils.isExtension("file.txt", new ArrayList(Arrays.asList(new
String[] {"rtf"}))));
-        assertEquals(true, FilenameUtils.isExtension("file", new ArrayList(Arrays.asList(new
String[] {"rtf", ""}))));
-        assertEquals(true, FilenameUtils.isExtension("file.txt", new ArrayList(Arrays.asList(new
String[] {"rtf", "txt"}))));
-        
-        assertEquals(false, FilenameUtils.isExtension("a/b/file.txt", (Collection) null));
-        assertEquals(false, FilenameUtils.isExtension("a/b/file.txt", new ArrayList()));
-        assertEquals(true, FilenameUtils.isExtension("a/b/file.txt", new ArrayList(Arrays.asList(new
String[] {"txt"}))));
-        assertEquals(false, FilenameUtils.isExtension("a/b/file.txt", new ArrayList(Arrays.asList(new
String[] {"rtf"}))));
-        assertEquals(true, FilenameUtils.isExtension("a/b/file.txt", new ArrayList(Arrays.asList(new
String[] {"rtf", "txt"}))));
-        
-        assertEquals(false, FilenameUtils.isExtension("a.b/file.txt", (Collection) null));
-        assertEquals(false, FilenameUtils.isExtension("a.b/file.txt", new ArrayList()));
-        assertEquals(true, FilenameUtils.isExtension("a.b/file.txt", new ArrayList(Arrays.asList(new
String[] {"txt"}))));
-        assertEquals(false, FilenameUtils.isExtension("a.b/file.txt", new ArrayList(Arrays.asList(new
String[] {"rtf"}))));
-        assertEquals(true, FilenameUtils.isExtension("a.b/file.txt", new ArrayList(Arrays.asList(new
String[] {"rtf", "txt"}))));
-        
-        assertEquals(false, FilenameUtils.isExtension("a\\b\\file.txt", (Collection) null));
-        assertEquals(false, FilenameUtils.isExtension("a\\b\\file.txt", new ArrayList()));
-        assertEquals(true, FilenameUtils.isExtension("a\\b\\file.txt", new ArrayList(Arrays.asList(new
String[] {"txt"}))));
-        assertEquals(false, FilenameUtils.isExtension("a\\b\\file.txt", new ArrayList(Arrays.asList(new
String[] {"rtf"}))));
-        assertEquals(true, FilenameUtils.isExtension("a\\b\\file.txt", new ArrayList(Arrays.asList(new
String[] {"rtf", "txt"}))));
-        
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", (Collection) null));
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", new ArrayList()));
-        assertEquals(true, FilenameUtils.isExtension("a.b\\file.txt", new ArrayList(Arrays.asList(new
String[] {"txt"}))));
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", new ArrayList(Arrays.asList(new
String[] {"rtf"}))));
-        assertEquals(true, FilenameUtils.isExtension("a.b\\file.txt", new ArrayList(Arrays.asList(new
String[] {"rtf", "txt"}))));
+        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"}))));
         
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", new ArrayList(Arrays.asList(new
String[] {"TXT"}))));
-        assertEquals(false, FilenameUtils.isExtension("a.b\\file.txt", new ArrayList(Arrays.asList(new
String[] {"TXT", "RTF"}))));
+        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"}))));
     }
 
 }



Mime
View raw message