commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1066176 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/function/StepFunctionTest.java
Date Tue, 01 Feb 2011 19:52:05 GMT
Author: sebb
Date: Tue Feb  1 19:52:05 2011
New Revision: 1066176

URL: http://svn.apache.org/viewvc?rev=1066176&view=rev
Log:
Tidy up test

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/function/StepFunctionTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/function/StepFunctionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/function/StepFunctionTest.java?rev=1066176&r1=1066175&r2=1066176&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/function/StepFunctionTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/function/StepFunctionTest.java
Tue Feb  1 19:52:05 2011
@@ -32,48 +32,34 @@ import org.junit.Test;
 public class StepFunctionTest {
     private final double EPS = Math.ulp(1d);
 
-    @Test
-    public void testPreconditions() {
-        try {
-            final UnivariateRealFunction f = new StepFunction(null,
-                                                              new double[] {0, -1, -2});
-        } catch (NullArgumentException e) {
-            // Expected.
-        }
-        try {
-            final UnivariateRealFunction f = new StepFunction(new double[] {0, 1},
-                                                              null);
-        } catch (NullArgumentException e) {
-            // Expected.
-        }
-
-        try {
-            final UnivariateRealFunction f = new StepFunction(new double[] {0},
-                                                              new double[] {});
-        } catch (NoDataException e) {
-            // Expected.
-        }
-
-        try {
-            final UnivariateRealFunction f = new StepFunction(new double[] {},
-                                                              new double[] {0});
-        } catch (NoDataException e) {
-            // Expected.
-        }
-
-        try {
-            final UnivariateRealFunction f = new StepFunction(new double[] {0, 1},
-                                                              new double[] {0, -1, -2});
-        } catch (DimensionMismatchException e) {
-            // Expected.
-        }
-
-        try {
-            final UnivariateRealFunction f = new StepFunction(new double[] {1, 0, 1},
-                                                              new double[] {0, -1, -2});
-        } catch (NonMonotonousSequenceException e) {
-            // Expected.
-        }
+    @Test(expected=NullArgumentException.class)
+    public void testPreconditions1() {
+        new StepFunction(null, new double[] {0, -1, -2});
+    }
+
+    @Test(expected=NullArgumentException.class)
+    public void testPreconditions2() {
+        new StepFunction(new double[] {0, 1}, null);
+    }
+
+    @Test(expected=NoDataException.class)
+    public void testPreconditions3() {
+        new StepFunction(new double[] {0}, new double[] {});
+    }
+
+    @Test(expected=NoDataException.class)
+    public void testPreconditions4() {
+        new StepFunction(new double[] {}, new double[] {0});
+    }
+
+    @Test(expected=DimensionMismatchException.class)
+    public void testPreconditions5() {
+        new StepFunction(new double[] {0, 1}, new double[] {0, -1, -2});
+    }
+
+    @Test(expected=NonMonotonousSequenceException.class)
+    public void testPreconditions6() {
+        new StepFunction(new double[] {1, 0, 1}, new double[] {0, -1, -2});
     }
 
     @Test



Mime
View raw message