3
* Licensed to the Apache Software Foundation (ASF) under one or more
4
* contributor license agreements. See the NOTICE file distributed with
5
* this work for additional information regarding copyright ownership.
6
* The ASF licenses this file to You under the Apache License, Version 2.0
7
* (the "License"); you may not use this file except in compliance with
8
* the License. You may obtain a copy of the License at
10
* http://www.apache.org/licenses/LICENSE-2.0
12
* Unless required by applicable law or agreed to in writing, software
13
* distributed under the License is distributed on an "AS IS" BASIS,
14
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
* See the License for the specific language governing permissions and
16
* limitations under the License.
19
package org.apache.commons.math.analysis.solvers;
21
import junit.framework.TestCase;
24
* @version $Revision: 799857 $ $Date: 2009-08-01 09:07:12 -0400 (Sat, 01 Aug 2009) $
26
public class UnivariateRealSolverFactoryImplTest extends TestCase {
29
private UnivariateRealSolverFactory factory;
32
* @throws java.lang.Exception
33
* @see junit.framework.TestCase#tearDown()
36
protected void setUp() throws Exception {
38
factory = new UnivariateRealSolverFactoryImpl();
42
* @throws java.lang.Exception
43
* @see junit.framework.TestCase#tearDown()
46
protected void tearDown() throws Exception {
51
public void testNewBisectionSolverValid() {
52
UnivariateRealSolver solver = factory.newBisectionSolver();
53
assertNotNull(solver);
54
assertTrue(solver instanceof BisectionSolver);
57
public void testNewNewtonSolverValid() {
58
UnivariateRealSolver solver = factory.newNewtonSolver();
59
assertNotNull(solver);
60
assertTrue(solver instanceof NewtonSolver);
63
public void testNewBrentSolverValid() {
64
UnivariateRealSolver solver = factory.newBrentSolver();
65
assertNotNull(solver);
66
assertTrue(solver instanceof BrentSolver);
69
public void testNewSecantSolverValid() {
70
UnivariateRealSolver solver = factory.newSecantSolver();
71
assertNotNull(solver);
72
assertTrue(solver instanceof SecantSolver);