KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > junitx > util > ConverterTest


1 package junitx.util;
2
3 import junit.framework.TestCase;
4
5 import java.util.Iterator JavaDoc;
6 import java.util.List JavaDoc;
7 import java.util.Vector JavaDoc;
8
9 /**
10  * @version $Revision: 1.3 $ $Date: 2003/03/21 06:13:50 $
11  * @author <a HREF="mailto:vbossica@users.sourceforge.net">Vladimir R. Bossicard</a>
12  */

13 public class ConverterTest
14         extends TestCase {
15
16     public ConverterTest(String JavaDoc name) {
17         super(name);
18     }
19
20     public void testIteratorToList() {
21         List JavaDoc vector = new Vector JavaDoc();
22         vector.add("3");
23         vector.add("2");
24         vector.add("1");
25         Iterator JavaDoc iter = vector.iterator();
26
27         List JavaDoc 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