commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1083965 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math/distribution/KolmogorovSmirnovDistributionTest.java
Date Mon, 21 Mar 2011 21:29:08 GMT
Author: sebb
Date: Mon Mar 21 21:29:07 2011
New Revision: 1083965

URL: http://svn.apache.org/viewvc?rev=1083965&view=rev
Log:
Convert to Junit4

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/distribution/KolmogorovSmirnovDistributionTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/distribution/KolmogorovSmirnovDistributionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/distribution/KolmogorovSmirnovDistributionTest.java?rev=1083965&r1=1083964&r2=1083965&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/distribution/KolmogorovSmirnovDistributionTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/distribution/KolmogorovSmirnovDistributionTest.java
Mon Mar 21 21:29:07 2011
@@ -17,17 +17,19 @@
 
 package org.apache.commons.math.distribution;
 
-import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Test;
 
 /**
  * Test cases for {@link KolmogorovSmirnovDistributionImpl}.
  *
  * @version $Revision$ $Date$
  */
-public class KolmogorovSmirnovDistributionTest extends TestCase {
+public class KolmogorovSmirnovDistributionTest {
     
     private static final double TOLERANCE = 10e-10;
 
+    @Test
     public void testCumulativeDensityFunction() throws Exception {
         
         KolmogorovSmirnovDistributionImpl dist;
@@ -43,73 +45,73 @@ public class KolmogorovSmirnovDistributi
          * 4.907829957616471622388047046469198862537e-86
          */
         dist = new KolmogorovSmirnovDistributionImpl(200);
-        assertEquals(4.907829957616471622388047046469198862537e-86, dist.cdf(0.005, false),
TOLERANCE);
+        Assert.assertEquals(4.907829957616471622388047046469198862537e-86, dist.cdf(0.005,
false), TOLERANCE);
 
         /* formatC(.C("pkolmogorov2x", p = as.double(0.02), n = as.integer(200), PACKAGE
= "stats")$p, 40) gives
          * 5.151982014280041957199687829849210629618e-06
          */
         dist = new KolmogorovSmirnovDistributionImpl(200);
-        assertEquals(5.151982014280041957199687829849210629618e-06, dist.cdf(0.02, false),
TOLERANCE);
+        Assert.assertEquals(5.151982014280041957199687829849210629618e-06, dist.cdf(0.02,
false), TOLERANCE);
 
         /* formatC(.C("pkolmogorov2x", p = as.double(0.031111), n = as.integer(200), PACKAGE
= "stats")$p, 40) gives
          * 0.01291614648162886340443389343590752105229
          */
         dist = new KolmogorovSmirnovDistributionImpl(200);
-        assertEquals(0.01291614648162886340443389343590752105229, dist.cdf(0.031111, false),
TOLERANCE);
+        Assert.assertEquals(0.01291614648162886340443389343590752105229, dist.cdf(0.031111,
false), TOLERANCE);
 
         /* formatC(.C("pkolmogorov2x", p = as.double(0.04), n = as.integer(200), PACKAGE
= "stats")$p, 40) gives
          * 0.1067137011362679355208626930107129737735
          */
         dist = new KolmogorovSmirnovDistributionImpl(200);
-        assertEquals(0.1067137011362679355208626930107129737735, dist.cdf(0.04, false), TOLERANCE);
+        Assert.assertEquals(0.1067137011362679355208626930107129737735, dist.cdf(0.04, false),
TOLERANCE);
 
         /* formatC(.C("pkolmogorov2x", p = as.double(0.005), n = as.integer(341), PACKAGE
= "stats")$p, 40) gives
          * 1.914734701559404553985102395145063418825e-53
          */
         dist = new KolmogorovSmirnovDistributionImpl(341);
-        assertEquals(1.914734701559404553985102395145063418825e-53, dist.cdf(0.005, false),
TOLERANCE);
+        Assert.assertEquals(1.914734701559404553985102395145063418825e-53, dist.cdf(0.005,
false), TOLERANCE);
 
         /* formatC(.C("pkolmogorov2x", p = as.double(0.02), n = as.integer(341), PACKAGE
= "stats")$p, 40) gives
          * 0.001171328985781981343872182321774744195864
          */
         dist = new KolmogorovSmirnovDistributionImpl(341);
-        assertEquals(0.001171328985781981343872182321774744195864, dist.cdf(0.02, false),
TOLERANCE);
+        Assert.assertEquals(0.001171328985781981343872182321774744195864, dist.cdf(0.02,
false), TOLERANCE);
 
         /* formatC(.C("pkolmogorov2x", p = as.double(0.031111), n = as.integer(341), PACKAGE
= "stats")$p, 40) gives
          * 0.1142955196267499418105728636874118819833
          */
         dist = new KolmogorovSmirnovDistributionImpl(341);
-        assertEquals(0.1142955196267499418105728636874118819833, dist.cdf(0.031111, false),
TOLERANCE);
+        Assert.assertEquals(0.1142955196267499418105728636874118819833, dist.cdf(0.031111,
false), TOLERANCE);
 
         /* formatC(.C("pkolmogorov2x", p = as.double(0.04), n = as.integer(341), PACKAGE
= "stats")$p, 40) gives
          * 0.3685529520496805266915885113121476024389
          */
         dist = new KolmogorovSmirnovDistributionImpl(341);
-        assertEquals(0.3685529520496805266915885113121476024389, dist.cdf(0.04, false), TOLERANCE);
+        Assert.assertEquals(0.3685529520496805266915885113121476024389, dist.cdf(0.04, false),
TOLERANCE);
 
         /* formatC(.C("pkolmogorov2x", p = as.double(0.005), n = as.integer(389), PACKAGE
= "stats")$p, 40) gives
          * 1.810657144595055888918455512707637574637e-47
          */
         dist = new KolmogorovSmirnovDistributionImpl(389);
-        assertEquals(1.810657144595055888918455512707637574637e-47, dist.cdf(0.005, false),
TOLERANCE);
+        Assert.assertEquals(1.810657144595055888918455512707637574637e-47, dist.cdf(0.005,
false), TOLERANCE);
 
         /* formatC(.C("pkolmogorov2x", p = as.double(0.02), n = as.integer(389), PACKAGE
= "stats")$p, 40) gives
          * 0.003068542559702356568168690742481885536108
          */
         dist = new KolmogorovSmirnovDistributionImpl(389);
-        assertEquals(0.003068542559702356568168690742481885536108, dist.cdf(0.02, false),
TOLERANCE);
+        Assert.assertEquals(0.003068542559702356568168690742481885536108, dist.cdf(0.02,
false), TOLERANCE);
 
         /* formatC(.C("pkolmogorov2x", p = as.double(0.031111), n = as.integer(389), PACKAGE
= "stats")$p, 40) gives
          * 0.1658291700122746237244797384846606291831
          */
         dist = new KolmogorovSmirnovDistributionImpl(389);
-        assertEquals(0.1658291700122746237244797384846606291831, dist.cdf(0.031111, false),
TOLERANCE);
+        Assert.assertEquals(0.1658291700122746237244797384846606291831, dist.cdf(0.031111,
false), TOLERANCE);
 
         /* formatC(.C("pkolmogorov2x", p = as.double(0.04), n = as.integer(389), PACKAGE
= "stats")$p, 40) gives
          * 0.4513143712128902529379104180407011881471
          */
         dist = new KolmogorovSmirnovDistributionImpl(389);
-        assertEquals(0.4513143712128902529379104180407011881471, dist.cdf(0.04, false), TOLERANCE);
+        Assert.assertEquals(0.4513143712128902529379104180407011881471, dist.cdf(0.04, false),
TOLERANCE);
 
     }
 



Mime
View raw message