Author: luc
Date: Sat Oct 2 22:11:04 2010
New Revision: 1003901
URL: http://svn.apache.org/viewvc?rev=1003901&view=rev
Log:
backported r1003549 from trunk to branch 2.X
Split multiple tests
Modified:
commons/proper/math/branches/MATH_2_X/ (props changed)
commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java
Propchange: commons/proper/math/branches/MATH_2_X/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 2 22:11:04 2010
@@ -1 +1 @@
-/commons/proper/math/trunk:1003346,1003348-1003351,1003526,1003533,1003543,1003545,1003547,1003569,1003584
+/commons/proper/math/trunk:1003346,1003348-1003351,1003526,1003533,1003543,1003545,1003547,1003549,1003569,1003584
Modified:
commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java?rev=1003901&r1=1003900&r2=1003901&view=diff
==============================================================================
---
commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java
(original)
+++
commons/proper/math/branches/MATH_2_X/src/test/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java
Sat Oct 2 22:11:04 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.1, 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"); // TODO needs
rework since convergence behaviour was changed
@@ -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");