~ubuntu-branches/ubuntu/quantal/commons-math/quantal

« back to all changes in this revision

Viewing changes to src/test/java/org/apache/commons/math/FunctionEvaluationExceptionTest.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan
  • Date: 2010-04-05 23:33:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100405233302-gpqlceked76nw28a
Tags: 2.1-1
* New upstream release.
* Bump Standards-Version to 3.8.4: no changes needed
* Bump debhelper to >= 7
* Switch to 3.0 (quilt) source format:
  - Remove B-D on quilt
  - Add d/source/format
  - Remove d/README.source

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
6
 * (the "License"); you may not use this file except in compliance with
7
7
 * the License.  You may obtain a copy of the License at
8
 
 * 
 
8
 *
9
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 
 * 
 
10
 *
11
11
 * Unless required by applicable law or agreed to in writing, software
12
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
22
import junit.framework.TestCase;
23
23
 
24
24
/**
25
 
 * @version $Revision: 758051 $ $Date: 2009-03-24 18:10:16 -0400 (Tue, 24 Mar 2009) $
 
25
 * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
26
26
 */
27
27
public class FunctionEvaluationExceptionTest extends TestCase {
28
 
    
 
28
 
29
29
    public void testConstructor(){
30
30
        FunctionEvaluationException ex = new FunctionEvaluationException(0.0);
31
31
        assertNull(ex.getCause());
33
33
        assertTrue(ex.getMessage().indexOf("0") > 0);
34
34
        assertEquals(0.0, ex.getArgument()[0], 0);
35
35
    }
36
 
    
 
36
 
37
37
    public void testConstructorArray(){
38
38
        FunctionEvaluationException ex =
39
39
            new FunctionEvaluationException(new double[] { 0, 1, 2 });
44
44
        assertEquals(1.0, ex.getArgument()[1], 0);
45
45
        assertEquals(2.0, ex.getArgument()[2], 0);
46
46
    }
47
 
    
 
47
 
48
48
    public void testConstructorPatternArguments(){
49
49
        String pattern = "evaluation failed for argument = {0}";
50
50
        Object[] arguments = { Double.valueOf(0.0) };