1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.commons.math.analysis.solvers;
20
21 import junit.framework.TestCase;
22
23
24
25
26 public class UnivariateRealSolverFactoryImplTest extends TestCase {
27
28
29 private UnivariateRealSolverFactory factory;
30
31
32
33
34
35 @Override
36 protected void setUp() throws Exception {
37 super.setUp();
38 factory = new UnivariateRealSolverFactoryImpl();
39 }
40
41
42
43
44
45 @Override
46 protected void tearDown() throws Exception {
47 factory = null;
48 super.tearDown();
49 }
50
51 public void testNewBisectionSolverValid() {
52 UnivariateRealSolver solver = factory.newBisectionSolver();
53 assertNotNull(solver);
54 assertTrue(solver instanceof BisectionSolver);
55 }
56
57 public void testNewNewtonSolverValid() {
58 UnivariateRealSolver solver = factory.newNewtonSolver();
59 assertNotNull(solver);
60 assertTrue(solver instanceof NewtonSolver);
61 }
62
63 public void testNewBrentSolverValid() {
64 UnivariateRealSolver solver = factory.newBrentSolver();
65 assertNotNull(solver);
66 assertTrue(solver instanceof BrentSolver);
67 }
68
69 public void testNewSecantSolverValid() {
70 UnivariateRealSolver solver = factory.newSecantSolver();
71 assertNotNull(solver);
72 assertTrue(solver instanceof SecantSolver);
73 }
74
75 }