1 7 package com.inversoft.util.test; 8 9 10 import java.util.ArrayList ; 11 import java.util.List ; 12 13 import junit.framework.TestCase; 14 15 import com.inversoft.util.IteratorEnumeration; 16 17 18 25 public class IteratorEnumerationTest extends TestCase { 26 27 30 public IteratorEnumerationTest(String name) { 31 super(name); 32 } 33 34 35 public void testAll() { 36 List list = new ArrayList (); 37 list.add("foo"); 38 list.add("bar"); 39 40 IteratorEnumeration adapter = new IteratorEnumeration(list.iterator()); 41 assertTrue(adapter.hasMoreElements()); 42 assertEquals("foo", adapter.nextElement()); 43 assertTrue(adapter.hasMoreElements()); 44 assertEquals("bar", adapter.nextElement()); 45 assertFalse(adapter.hasMoreElements()); 46 } 47 } 48 | Popular Tags |