backported r1003549 from trunk to branch 2.X

Split multiple tests


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/branches/MATH_2_X@1003901 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2010-10-02 22:11:04 +00:00
parent c87e900a1b
commit 332d372bdc
1 changed files with 14 additions and 2 deletions

View File

@ -40,13 +40,16 @@ public class UnivariateRealSolverUtilsTest extends TestCase {
}
}
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 UnivariateRealSolverUtilsTest extends TestCase {
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");