commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1003566 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java
Date Fri, 01 Oct 2010 15:41:18 GMT
Author: sebb
Date: Fri Oct  1 15:41:18 2010
New Revision: 1003566

URL: http://svn.apache.org/viewvc?rev=1003566&view=rev
Log:
Narrow expected exception

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java?rev=1003566&r1=1003565&r2=1003566&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java
Fri Oct  1 15:41:18 2010
@@ -97,16 +97,16 @@ public final class StatUtilsTest extends
 
         try {
             StatUtils.sum(values, 2, 3);
-            assertTrue("Didn't throw exception", false);
-        } catch (Exception e) {
-            assertTrue(true);
+            fail("Expected RuntimeException");
+        } catch (RuntimeException e) {
+            // expected
         }
 
         try {
             StatUtils.sum(values, -1, 2);
-            assertTrue("Didn't throw exception", false);
-        } catch (Exception e) {
-            assertTrue(true);
+            fail("Expected RuntimeException");
+        } catch (RuntimeException e) {
+            // expected
         }
 
     }



Mime
View raw message