From e3f28223adf26c639a158662019ca9cf63c90230 Mon Sep 17 00:00:00 2001 From: Phil Steitz Date: Wed, 16 Jun 2010 00:46:05 +0000 Subject: [PATCH] Really make poissonConsistencyTest use a fixed seed. Complete intent of r949613. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@955100 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/commons/math/random/RandomDataTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/apache/commons/math/random/RandomDataTest.java b/src/test/java/org/apache/commons/math/random/RandomDataTest.java index 88f01d322..96e47169b 100644 --- a/src/test/java/org/apache/commons/math/random/RandomDataTest.java +++ b/src/test/java/org/apache/commons/math/random/RandomDataTest.java @@ -237,12 +237,15 @@ public class RandomDataTest extends RetryTestCase { } 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 RetryTestCase { 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);