fr.jussieu.gla.wasa.util.junit
Class RandomIteratorTest

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--fr.jussieu.gla.wasa.util.junit.RandomIteratorTest
All Implemented Interfaces:
junit.framework.Test

public class RandomIteratorTest
extends junit.framework.TestCase

Automated test for the RandomIterator.

Version:
$Revision: 1.1 $ $Date: 2002/04/11 19:53:32 $
Author:
Florent Selva

Constructor Summary
RandomIteratorTest(java.lang.String s)
           
 
Method Summary
 boolean areDifferent(int[] array1, int[] array2)
          Return true if the two int sequences aren't the same.
 boolean areSameContent(int[] array1, int[] array2)
          Return true if each int of the array1 is in array2.
 int[] generateIntArrayResult(RandomIterator randomIterator)
           
 boolean isEachIntOnlyOnce(int[] array)
          Return true if each int of the array is different from the others.
static void main(java.lang.String[] args)
           
static junit.framework.Test suite()
           
 void testEachIntOnlyOnce()
           
 void testRandomIntSequences()
          Test if the sequences generated aren't always the same.
 void testSameContentAsOrigin()
          Test if the generated sequence contains same int as the origin array.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RandomIteratorTest

public RandomIteratorTest(java.lang.String s)
Method Detail

testSameContentAsOrigin

public void testSameContentAsOrigin()
Test if the generated sequence contains same int as the origin array.

testEachIntOnlyOnce

public void testEachIntOnlyOnce()

testRandomIntSequences

public void testRandomIntSequences()
Test if the sequences generated aren't always the same. As the test is based on random, it may sometimes fail. So, don't panic.

generateIntArrayResult

public int[] generateIntArrayResult(RandomIterator randomIterator)

areSameContent

public boolean areSameContent(int[] array1,
                              int[] array2)
Return true if each int of the array1 is in array2.

isEachIntOnlyOnce

public boolean isEachIntOnlyOnce(int[] array)
Return true if each int of the array is different from the others.

areDifferent

public boolean areDifferent(int[] array1,
                            int[] array2)
Return true if the two int sequences aren't the same.

suite

public static junit.framework.Test suite()

main

public static void main(java.lang.String[] args)