commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r955100 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/RandomDataTest.java
Date Wed, 16 Jun 2010 00:46:05 GMT
Author: psteitz
Date: Wed Jun 16 00:46:05 2010
New Revision: 955100

URL: http://svn.apache.org/viewvc?rev=955100&view=rev
Log:
Really make poissonConsistencyTest use a fixed seed.  Complete intent of r949613.

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/RandomDataTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/RandomDataTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/RandomDataTest.java?rev=955100&r1=955099&r2=955100&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/RandomDataTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/random/RandomDataTest.java
Wed Jun 16 00:46:05 2010
@@ -237,12 +237,15 @@ public class RandomDataTest extends Retr
     }
 
     public void testNextPoissonConsistency() throws Exception {
+        
+        // Reseed randomGenerator to get fixed sequence
+        randomData.reSeed(1000);  
+        
         // Small integral means
         for (int i = 1; i < 100; i++) {
             checkNextPoissonConsistency(i);
         }
         // non-integer means
-        RandomData randomData = new RandomDataImpl();
         for (int i = 1; i < 10; i++) {
             checkNextPoissonConsistency(randomData.nextUniform(1, 1000));
         }
@@ -268,7 +271,6 @@ public class RandomDataTest extends Retr
         final int minExpectedCount = 7;     // Minimum size of expected bin count
         long maxObservedValue = 0;
         final double alpha = 0.001;         // Probability of false failure
-        randomData.reSeed(1000);            // Reseed randomGenerator to get fixed sequence
         Frequency frequency = new Frequency();
         for (int i = 0; i < sampleSize; i++) {
             long value = randomData.nextPoisson(mean);



Mime
View raw message