commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdigg...@apache.org
Subject cvs commit: jakarta-commons-sandbox/math/src/test/org/apache/commons/math/stat StatUtilsTest.java
Date Tue, 24 Jun 2003 14:08:41 GMT
mdiggory    2003/06/24 07:08:40

  Modified:    math/src/test/org/apache/commons/math/stat
                        StatUtilsTest.java
  Log:
  Added Checks for Exceptions
  
  Revision  Changes    Path
  1.3       +31 -5     jakarta-commons-sandbox/math/src/test/org/apache/commons/math/stat/StatUtilsTest.java
  
  Index: StatUtilsTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/math/src/test/org/apache/commons/math/stat/StatUtilsTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StatUtilsTest.java	24 Jun 2003 14:03:31 -0000	1.2
  +++ StatUtilsTest.java	24 Jun 2003 14:08:40 -0000	1.3
  @@ -190,9 +190,35 @@
       public void testArrayIndexConditions() throws Exception {
           double[] values = { 1.0, 2.0, 3.0, 4.0 };
   
  -        assertEquals("Sum not expected", 5.0, StatUtils.sum(values,1,2),Double.MIN_VALUE);
  -        assertEquals("Sum not expected", 3.0, StatUtils.sum(values,0,2),Double.MIN_VALUE);
  -        assertEquals("Sum not expected", 7.0, StatUtils.sum(values,2,2),Double.MIN_VALUE);
  -        
  +        assertEquals(
  +            "Sum not expected",
  +            5.0,
  +            StatUtils.sum(values, 1, 2),
  +            Double.MIN_VALUE);
  +        assertEquals(
  +            "Sum not expected",
  +            3.0,
  +            StatUtils.sum(values, 0, 2),
  +            Double.MIN_VALUE);
  +        assertEquals(
  +            "Sum not expected",
  +            7.0,
  +            StatUtils.sum(values, 2, 2),
  +            Double.MIN_VALUE);
  +
  +        try {
  +            StatUtils.sum(values, 2, 3);
  +            assertTrue("Didn't throw exception", false);
  +        } catch (Exception e) {
  +            assertTrue(true);
  +        }
  +
  +        try {
  +            StatUtils.sum(values, -1, 2);
  +            assertTrue("Didn't throw exception", false);
  +        } catch (Exception e) {
  +            assertTrue(true);
  +        }
  +
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message