You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ps...@apache.org on 2013/07/18 22:55:47 UTC

svn commit: r1504656 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/StatUtilsTest.java

Author: psteitz
Date: Thu Jul 18 20:55:46 2013
New Revision: 1504656

URL: http://svn.apache.org/r1504656
Log:
Added test to confirm null contract. JIRA: MATH-1007.

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

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/StatUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/StatUtilsTest.java?rev=1504656&r1=1504655&r2=1504656&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/StatUtilsTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/StatUtilsTest.java Thu Jul 18 20:55:46 2013
@@ -543,6 +543,14 @@ public final class StatUtilsTest {
         final double[] nansOnly = {Double.NaN, Double.NaN};
         final double[] modeNansOnly = StatUtils.mode(nansOnly);
         Assert.assertEquals(0, modeNansOnly.length);
+        
+        final double[] nullArray = null;
+        try {
+            StatUtils.mode(nullArray);
+            Assert.fail("Expecting MathIllegalArgumentException");
+        } catch (MathIllegalArgumentException ex) {
+            // Expected
+        }
     }
 
 }