commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1003571 - in /commons/proper/io/trunk/src/test/org/apache/commons/io: FileUtilsListFilesTestCase.java input/NullInputStreamTest.java input/NullReaderTest.java
Date Fri, 01 Oct 2010 16:26:36 GMT
Author: sebb
Date: Fri Oct  1 16:26:35 2010
New Revision: 1003571

URL: http://svn.apache.org/viewvc?rev=1003571&view=rev
Log:
Narrow allowable Exceptions

Modified:
    commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsListFilesTestCase.java
    commons/proper/io/trunk/src/test/org/apache/commons/io/input/NullInputStreamTest.java
    commons/proper/io/trunk/src/test/org/apache/commons/io/input/NullReaderTest.java

Modified: commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsListFilesTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsListFilesTestCase.java?rev=1003571&r1=1003570&r2=1003571&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsListFilesTestCase.java
(original)
+++ commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsListFilesTestCase.java
Fri Oct  1 16:26:35 2010
@@ -163,8 +163,8 @@ public class FileUtilsListFilesTestCase 
         try {
             FileUtils.listFiles(getLocalTestDirectory(), (IOFileFilter)null, (IOFileFilter)null);
             fail("Expected error about null parameter");
-        } catch (Exception e) {
-            //fine
+        } catch (NullPointerException e) {
+            // expected
         }
     }
 

Modified: commons/proper/io/trunk/src/test/org/apache/commons/io/input/NullInputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/org/apache/commons/io/input/NullInputStreamTest.java?rev=1003571&r1=1003570&r2=1003571&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/org/apache/commons/io/input/NullInputStreamTest.java
(original)
+++ commons/proper/io/trunk/src/test/org/apache/commons/io/input/NullInputStreamTest.java
Fri Oct  1 16:26:35 2010
@@ -151,7 +151,7 @@ public class NullInputStreamTest extends
         try {
             input.reset();
             fail("Read limit exceeded, expected IOException ");
-        } catch (Exception e) {
+        } catch (IOException e) {
             assertEquals("No Mark IOException message",
                          "No position has been marked",
                          e.getMessage());
@@ -181,7 +181,7 @@ public class NullInputStreamTest extends
         try {
             input.reset();
             fail("Read limit exceeded, expected IOException ");
-        } catch (Exception e) {
+        } catch (IOException e) {
             assertEquals("Read limit IOException message",
                          "Marked position [" + position
                          + "] is no longer valid - passed the read limit ["
@@ -226,7 +226,7 @@ public class NullInputStreamTest extends
         try {
             input.skip(5); //
             fail("Expected IOException for skipping after end of file");
-        } catch (Exception e) {
+        } catch (IOException e) {
             assertEquals("Skip after EOF IOException message",
                     "Skip after end of file",
                     e.getMessage());

Modified: commons/proper/io/trunk/src/test/org/apache/commons/io/input/NullReaderTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/org/apache/commons/io/input/NullReaderTest.java?rev=1003571&r1=1003570&r2=1003571&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/org/apache/commons/io/input/NullReaderTest.java (original)
+++ commons/proper/io/trunk/src/test/org/apache/commons/io/input/NullReaderTest.java Fri Oct
 1 16:26:35 2010
@@ -148,7 +148,7 @@ public class NullReaderTest extends Test
         try {
             reader.reset();
             fail("Read limit exceeded, expected IOException ");
-        } catch (Exception e) {
+        } catch (IOException e) {
             assertEquals("No Mark IOException message",
                          "No position has been marked",
                          e.getMessage());
@@ -178,7 +178,7 @@ public class NullReaderTest extends Test
         try {
             reader.reset();
             fail("Read limit exceeded, expected IOException ");
-        } catch (Exception e) {
+        } catch (IOException e) {
             assertEquals("Read limit IOException message",
                          "Marked position [" + position
                          + "] is no longer valid - passed the read limit ["
@@ -223,7 +223,7 @@ public class NullReaderTest extends Test
         try {
             reader.skip(5); //
             fail("Expected IOException for skipping after end of file");
-        } catch (Exception e) {
+        } catch (IOException e) {
             assertEquals("Skip after EOF IOException message",
                     "Skip after end of file",
                     e.getMessage());



Mime
View raw message