org.apache.commons.math.random
Class RandomDataTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.math.RetryTestCase
              extended by org.apache.commons.math.random.RandomDataTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractRandomGeneratorTest, RandomAdaptorTest

public class RandomDataTest
extends RetryTestCase

Test cases for the RandomData class.

Version:
$Revision: 783041 $ $Date: 2009-04-05 11:55:59 -0500 (Sun, 05 Apr 2009) $

Field Summary
protected  double[] expected
           
protected  int largeSampleSize
           
protected  org.apache.commons.math.random.RandomDataImpl randomData
           
protected  long smallSampleSize
           
protected  org.apache.commons.math.stat.inference.ChiSquareTestImpl testStatistic
           
 
Constructor Summary
RandomDataTest(String name)
           
 
Method Summary
static junit.framework.Test suite()
           
 void testConfig()
          test reseeding, algorithm/provider games
 void testNextExponential()
          test failure modes and distribution of nextExponential()
 void testNextGaussian()
          test failure modes and distribution of nextGaussian()
 void testNextHex()
          test dispersion and failute modes for nextHex()
 void testNextInt()
          test dispersion and failure modes for nextInt()
 void testNextIntExtremeValues()
           
 void testNextLong()
          test dispersion and failure modes for nextLong()
 void testNextLongExtremeValues()
           
 void testNextPermutation()
          tests for nextPermutation
 void testNextPoisson()
          Make sure that empirical distribution of random Poisson(4)'s has P(X <= 5) close to actual cumulative Poisson probablity and that nextPoisson fails when mean is non-positive TODO: replace with statistical test, adding test stat to TestStatistic
 void testNextPoissonLargeMean()
           
 void testNextSample()
          tests for nextSample() sampling from Collection
 void testNextSecureHex()
          test dispersion and failute modes for nextHex()
 void testNextSecureInt()
          test dispersion and failure modes for nextSecureInt()
 void testNextSecureLong()
          test dispersion and failure modes for nextSecureLong()
 void testNextUniform()
          test failure modes and dispersion of nextUniform()
 void testNextUniformExclusiveEndpoints()
          test exclusive endpoints of nextUniform
 
Methods inherited from class org.apache.commons.math.RetryTestCase
runTest
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

smallSampleSize

protected long smallSampleSize

expected

protected double[] expected

largeSampleSize

protected int largeSampleSize

randomData

protected org.apache.commons.math.random.RandomDataImpl randomData

testStatistic

protected org.apache.commons.math.stat.inference.ChiSquareTestImpl testStatistic
Constructor Detail

RandomDataTest

public RandomDataTest(String name)
Method Detail

suite

public static junit.framework.Test suite()

testNextIntExtremeValues

public void testNextIntExtremeValues()

testNextLongExtremeValues

public void testNextLongExtremeValues()

testNextInt

public void testNextInt()
test dispersion and failure modes for nextInt()


testNextLong

public void testNextLong()
test dispersion and failure modes for nextLong()


testNextSecureLong

public void testNextSecureLong()
test dispersion and failure modes for nextSecureLong()


testNextSecureInt

public void testNextSecureInt()
test dispersion and failure modes for nextSecureInt()


testNextPoisson

public void testNextPoisson()
Make sure that empirical distribution of random Poisson(4)'s has P(X <= 5) close to actual cumulative Poisson probablity and that nextPoisson fails when mean is non-positive TODO: replace with statistical test, adding test stat to TestStatistic


testNextPoissonLargeMean

public void testNextPoissonLargeMean()

testNextHex

public void testNextHex()
test dispersion and failute modes for nextHex()


testNextSecureHex

public void testNextSecureHex()
test dispersion and failute modes for nextHex()


testNextUniform

public void testNextUniform()
test failure modes and dispersion of nextUniform()


testNextUniformExclusiveEndpoints

public void testNextUniformExclusiveEndpoints()
test exclusive endpoints of nextUniform


testNextGaussian

public void testNextGaussian()
test failure modes and distribution of nextGaussian()


testNextExponential

public void testNextExponential()
test failure modes and distribution of nextExponential()


testConfig

public void testConfig()
test reseeding, algorithm/provider games


testNextSample

public void testNextSample()
tests for nextSample() sampling from Collection


testNextPermutation

public void testNextPermutation()
tests for nextPermutation



Copyright © 2003-2010 Apache Software Foundation. All Rights Reserved.