1 package junitx.util; 2 3 import junit.framework.TestCase; 4 5 import java.util.Iterator ; 6 import java.util.List ; 7 import java.util.Vector ; 8 9 13 public class ConverterTest 14 extends TestCase { 15 16 public ConverterTest(String name) { 17 super(name); 18 } 19 20 public void testIteratorToList() { 21 List vector = new Vector (); 22 vector.add("3"); 23 vector.add("2"); 24 vector.add("1"); 25 Iterator iter = vector.iterator(); 26 27 List conv = Converter.asList(iter); 28 assertNotNull(conv); 29 assertEquals(3, conv.size()); 30 assertTrue(conv.contains("1")); 31 assertTrue(conv.contains("2")); 32 assertTrue(conv.contains("3")); 33 } 34 35 } 36 | Popular Tags |