edu.rice.cs.plt.iter
Class IterUtilTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by edu.rice.cs.plt.iter.IterUtilTest
All Implemented Interfaces:
junit.framework.Test

public class IterUtilTest
extends junit.framework.TestCase

Tests for the IterUtil methods


Constructor Summary
IterUtilTest()
           
 
Method Summary
static void assertIterator(Iterator<?> iter, Object... expected)
          Verify that the iterator contents exactly match the given sequence.
static void assertIteratorUnchecked(Iterator<?> iter, Object... expected)
          Verify that the iterator contents exactly match the given sequence.
 void testArrayIterable()
           
 void testCharSequenceIterable()
           
 void testDistribute()
           
 void testInputStreamAsIterator()
           
 void testReaderAsIterator()
           
 void testRelax()
           
 void testToArray()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IterUtilTest

public IterUtilTest()
Method Detail

assertIterator

public static void assertIterator(Iterator<?> iter,
                                  Object... expected)
Verify that the iterator contents exactly match the given sequence. Tests both hasNext() and next() at each step.


assertIteratorUnchecked

public static void assertIteratorUnchecked(Iterator<?> iter,
                                           Object... expected)
Verify that the iterator contents exactly match the given sequence. Does not invoke hasNext() until iteration is complete. This allows bugs related to state change occurring in hasNext() to be detected.


testRelax

public void testRelax()

testToArray

public void testToArray()

testArrayIterable

public void testArrayIterable()

testCharSequenceIterable

public void testCharSequenceIterable()

testReaderAsIterator

public void testReaderAsIterator()

testInputStreamAsIterator

public void testInputStreamAsIterator()

testDistribute

public void testDistribute()