1
2
3
4 package org.melati.poem.util.test;
5
6 import java.util.Vector;
7
8 import org.melati.poem.util.ConsEnumeration;
9 import org.melati.poem.util.LimitedEnumeration;
10
11 import junit.framework.TestCase;
12
13
14
15
16
17
18 public class ConsEnumerationTest extends TestCase {
19
20
21
22
23 public ConsEnumerationTest(String name) {
24 super(name);
25 }
26
27
28
29
30
31 protected void setUp() throws Exception {
32 super.setUp();
33 }
34
35
36
37
38
39 protected void tearDown() throws Exception {
40 super.tearDown();
41 }
42
43
44
45
46 public void testConsEnumeration() {
47
48 }
49
50
51
52
53 public void testHasMoreElements() {
54
55 }
56
57
58
59
60 public void testNextElement() {
61
62 }
63
64
65
66
67 public void testSkip() {
68 ConsEnumeration<String> c = new ConsEnumeration<String>("head", new Vector<String>(1).elements());
69 assertTrue(c.hasMoreElements());
70 c.skip();
71 assertFalse(c.hasMoreElements());
72
73 Vector<String> them = new Vector<String>();
74 them.add("a");
75 them.add("b");
76 them.add("c");
77 them.add("d");
78 LimitedEnumeration<String> le = new LimitedEnumeration<String>(them.elements(),2);
79 c = new ConsEnumeration<String>("head", le);
80 c.nextElement();
81 c.skip();
82 assertEquals("b", c.nextElement());
83
84 c = new ConsEnumeration<String>("head", them.elements());
85 c.nextElement();
86 c.skip();
87 assertEquals("b", c.nextElement());
88 }
89
90 }