~ubuntu-branches/ubuntu/maverick/commons-math/maverick

« back to all changes in this revision

Viewing changes to src/test/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverFactoryImplTest.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan
  • Date: 2009-08-22 01:13:25 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090822011325-hi4peq1ua5weguwn
Tags: 2.0-1
* New upstream release.
* Set Maintainer field to Debian Java Team
* Add myself as Uploaders
* Switch to Quilt patch system:
  - Refresh all patchs
  - Remove B-D on dpatch, Add B-D on quilt
  - Include patchsys-quilt.mk in debian/rules
* Bump Standards-Version to 3.8.3:
  - Add a README.source to describe patch system
* Maven POMs:
  - Add a Build-Depends-Indep dependency on maven-repo-helper
  - Use mh_installpom and mh_installjar to install the POM and the jar to the
    Maven repository
* Use default-jdk/jre:
  - Depends on java5-runtime-headless
  - Build-Depends on default-jdk
  - Use /usr/lib/jvm/default-java as JAVA_HOME
* Move api documentation to /usr/share/doc/libcommons-math-java/api
* Build-Depends on junit4 instead of junit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *
 
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
 
9
 *
 
10
 *     http://www.apache.org/licenses/LICENSE-2.0
 
11
 *
 
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.
 
17
 */
 
18
 
 
19
package org.apache.commons.math.analysis.solvers;
 
20
 
 
21
import junit.framework.TestCase;
 
22
 
 
23
/**
 
24
 * @version $Revision: 799857 $ $Date: 2009-08-01 09:07:12 -0400 (Sat, 01 Aug 2009) $
 
25
 */
 
26
public class UnivariateRealSolverFactoryImplTest extends TestCase {
 
27
    
 
28
    /** solver factory */
 
29
    private UnivariateRealSolverFactory factory;
 
30
    
 
31
    /**
 
32
     * @throws java.lang.Exception
 
33
     * @see junit.framework.TestCase#tearDown()
 
34
     */
 
35
    @Override
 
36
    protected void setUp() throws Exception {
 
37
        super.setUp();
 
38
        factory = new UnivariateRealSolverFactoryImpl();
 
39
    }
 
40
    
 
41
    /**
 
42
     * @throws java.lang.Exception
 
43
     * @see junit.framework.TestCase#tearDown()
 
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
}