You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2010/10/01 18:26:36 UTC

svn commit: r1003571 - in /commons/proper/io/trunk/src/test/org/apache/commons/io: FileUtilsListFilesTestCase.java input/NullInputStreamTest.java input/NullReaderTest.java

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());