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: 610789 $ $Date: 2008-01-10 06:46:49 -0700 (Thu, 10 Jan 2008) $

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(java.lang.String name)
           
 
Method Summary
 void setUp()
           
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 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, 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
 
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(java.lang.String name)
Method Detail

setUp

public void setUp()
Overrides:
setUp in class junit.framework.TestCase

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


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()
                throws java.security.NoSuchProviderException,
                       java.security.NoSuchAlgorithmException
test reseeding, algorithm/provider games

Throws:
java.security.NoSuchProviderException
java.security.NoSuchAlgorithmException

testNextSample

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


testNextPermutation

public void testNextPermutation()
tests for nextPermutation



Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.