FileDocCategorySizeDatePackage
ArrayIteratorTest.javaAPI DocExample774Tue Sep 09 16:40:20 BST 2003regress

ArrayIteratorTest

public class ArrayIteratorTest extends TestCase

Fields Summary
String[]
TESTDATA
com.darwinsys.util.ArrayIterator
it
Constructors Summary
public ArrayIteratorTest(String name)
JUnit test classes require this constructor


	       
	   
		super(name);
	
Methods Summary
public voidtestGetting()
Simple tryout

		int i = 0;
		while (it.hasNext()) {
			assertEquals(TESTDATA[i++], it.next());
		}

		// XXX read up on writing JUnit tests that should throw exceptions
		try {
			it.next();		// EXPECT RUNTIME ERROR
			System.err.println("ERROR - DID NOT GET EXPECTED EXCEPTION");
		} catch (IndexOutOfBoundsException e) {
			System.err.println("Got expected exception -- OK!");
		}