psteitz     2004/07/21 19:30:01

  Modified:    math/src/test/org/apache/commons/math/stat/univariate
                        DescriptiveStatisticsTest.java
  Log:
  Added test for toString().
  
  Revision  Changes    Path
  1.8       +15 -1     
jakarta-commons/math/src/test/org/apache/commons/math/stat/univariate/DescriptiveStatisticsTest.java
  
  Index: DescriptiveStatisticsTest.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/math/src/test/org/apache/commons/math/stat/univariate/DescriptiveStatisticsTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DescriptiveStatisticsTest.java    10 Jul 2004 17:13:00 -0000      1.7
  +++ DescriptiveStatisticsTest.java    22 Jul 2004 02:30:01 -0000      1.8
  @@ -384,5 +384,19 @@
           assertEquals(3.0, u.getMean(), tolerance);
       }
       
  +    public void testToString() {
  +        DescriptiveStatistics u = DescriptiveStatistics.newInstance();
  +        assertTrue(u.toString().indexOf("NaN") > 0);  
  +        assertTrue(u.toString().startsWith("DescriptiveStatistics"));
  +        double[] testArray = 
  +            { 12.5, 12, 11.8, 14.2, 14.9, 14.5, 21, 8.2, 10.3, 11.3, 14.1,
  +                9.9, 12.2, 12, 12.1, 11, 19.8, 11, 10, 8.8, 9, 12.3 };
  +        for( int i = 0; i < testArray.length; i++) {
  +            u.addValue( testArray[i]);
  +        }        
  +        assertTrue(u.toString().indexOf("NaN") == -1);  
  +        assertTrue(u.toString().startsWith("DescriptiveStatistics"));
  +    }
  +    
   }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to