1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.collections.primitives.adapters;
18
19 import java.io.Serializable;
20 import java.util.AbstractList;
21 import java.util.ArrayList;
22
23 import junit.framework.Test;
24 import junit.framework.TestSuite;
25
26 import org.apache.commons.collections.BulkTest;
27 import org.apache.commons.collections.primitives.IntList;
28 import org.apache.commons.collections.primitives.TestIntList;
29
30
31
32
33
34 public class TestListIntList extends TestIntList {
35
36
37
38
39 public TestListIntList(String testName) {
40 super(testName);
41 }
42
43 public static Test suite() {
44 TestSuite suite = BulkTest.makeSuite(TestListIntList.class);
45 return suite;
46 }
47
48
49
50
51
52
53
54 protected IntList makeEmptyIntList() {
55 return new ListIntList(new ArrayList());
56 }
57
58 public String[] ignoredTests() {
59
60 return new String[] {
61 "TestListIntList.bulkTestSubList.testFullListSerialization",
62 "TestListIntList.bulkTestSubList.testEmptyListSerialization",
63 "TestListIntList.bulkTestSubList.testCanonicalEmptyCollectionExists",
64 "TestListIntList.bulkTestSubList.testCanonicalFullCollectionExists",
65 "TestListIntList.bulkTestSubList.testEmptyListCompatibility",
66 "TestListIntList.bulkTestSubList.testFullListCompatibility",
67 "TestListIntList.bulkTestSubList.testSerializeDeserializeThenCompare",
68 "TestListIntList.bulkTestSubList.testSimpleSerialization"
69 };
70 }
71
72
73
74
75
76 public void testCanonicalEmptyCollectionExists() {
77
78
79 }
80
81 public void testCanonicalFullCollectionExists() {
82
83
84 }
85
86 public void testEmptyListCompatibility() {
87
88
89 }
90
91 public void testFullListCompatibility() {
92
93
94 }
95 public void testWrapNull() {
96 assertNull(ListIntList.wrap(null));
97 }
98
99 public void testWrapSerializable() {
100 IntList list = ListIntList.wrap(new ArrayList());
101 assertNotNull(list);
102 assertTrue(list instanceof Serializable);
103 }
104
105 public void testWrapNonSerializable() {
106 IntList list = ListIntList.wrap(new AbstractList() {
107 public Object get(int i) { throw new IndexOutOfBoundsException(); }
108 public int size() { return 0; }
109 });
110 assertNotNull(list);
111 assertTrue(!(list instanceof Serializable));
112 }
113
114 }