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.List;
21
22 import junit.framework.Test;
23 import junit.framework.TestSuite;
24
25 import org.apache.commons.collections.BulkTest;
26 import org.apache.commons.collections.primitives.ArrayFloatList;
27 import org.apache.commons.collections.primitives.RandomAccessFloatList;
28
29
30
31
32
33 public class TestFloatListList extends BaseTestList {
34
35
36
37
38 public TestFloatListList(String testName) {
39 super(testName);
40 }
41
42 public static Test suite() {
43 TestSuite suite = BulkTest.makeSuite(TestFloatListList.class);
44 return suite;
45 }
46
47
48
49
50 public List makeEmptyList() {
51 return new FloatListList(new ArrayFloatList());
52 }
53
54 public Object[] getFullElements() {
55 Float[] elts = new Float[10];
56 for(int i=0;i<elts.length;i++) {
57 elts[i] = new Float((float)i);
58 }
59 return elts;
60 }
61
62 public Object[] getOtherElements() {
63 Float[] elts = new Float[10];
64 for(int i=0;i<elts.length;i++) {
65 elts[i] = new Float((float)(10 + i));
66 }
67 return elts;
68 }
69
70
71
72
73
74
75 public void testCanonicalEmptyCollectionExists() {
76
77
78 }
79
80 public void testCanonicalFullCollectionExists() {
81
82
83 }
84
85 public void testEmptyListCompatibility() {
86
87
88 }
89
90 public void testFullListCompatibility() {
91
92
93 }
94
95 public void testWrapNull() {
96 assertNull(FloatListList.wrap(null));
97 }
98
99 public void testWrapSerializable() {
100 List list = FloatListList.wrap(new ArrayFloatList());
101 assertNotNull(list);
102 assertTrue(list instanceof Serializable);
103 }
104
105 public void testWrapNonSerializable() {
106 List list = FloatListList.wrap(new RandomAccessFloatList() {
107 public float get(int i) { throw new IndexOutOfBoundsException(); }
108 public int size() { return 0; }
109 });
110 assertNotNull(list);
111 assertTrue(!(list instanceof Serializable));
112 }
113 }