Author: sebb
Date: Fri Oct 1 14:54:37 2010
New Revision: 1003549
URL: http://svn.apache.org/viewvc?rev=1003549&view=rev
Log:
Split multiple tests
Modified:
commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java
Modified:
commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java?rev=1003549&r1=1003548&r2=1003549&view=diff
==============================================================================
---
commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java
(original)
+++
commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java
Fri Oct 1 14:54:37 2010
@@ -40,13 +40,16 @@ public class UnivariateRealSolverUtilsTe
}
}
- public void testSolveBadParameters() throws MathException {
+ public void testSolveBadEndpoints() throws MathException {
try { // bad endpoints
UnivariateRealSolverUtils.solve(sin,0.0, 4.0, 4.0);
fail("Expecting IllegalArgumentException");
} catch (IllegalArgumentException ex) {
// expected
}
+ }
+
+ public void testSolveBadAccuracy() throws MathException {
try { // bad accuracy
UnivariateRealSolverUtils.solve(sin, 0.0, 4.0, 0.0);
fail("Expecting IllegalArgumentException");
@@ -99,25 +102,34 @@ public class UnivariateRealSolverUtilsTe
assertTrue(sin.value(result[1]) > 0);
}
- public void testBadParameters() throws MathException {
+ public void testNullFunction() throws MathException {
try { // null function
UnivariateRealSolverUtils.bracket(null, 1.5, 0, 2.0);
fail("Expecting IllegalArgumentException");
} catch (IllegalArgumentException ex) {
// expected
}
+ }
+
+ public void testBadInitial() throws MathException {
try { // initial not between endpoints
UnivariateRealSolverUtils.bracket(sin, 2.5, 0, 2.0);
fail("Expecting IllegalArgumentException");
} catch (IllegalArgumentException ex) {
// expected
}
+ }
+
+ public void testBadEndpoints() throws MathException {
try { // endpoints not valid
UnivariateRealSolverUtils.bracket(sin, 1.5, 2.0, 1.0);
fail("Expecting IllegalArgumentException");
} catch (IllegalArgumentException ex) {
// expected
}
+ }
+
+ public void testBadMaximumIterations() throws MathException {
try { // bad maximum iterations
UnivariateRealSolverUtils.bracket(sin, 1.5, 0, 2.0, 0);
fail("Expecting IllegalArgumentException");