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.Collection;
21
22 import junit.framework.Test;
23 import junit.framework.TestSuite;
24
25 import org.apache.commons.collections.AbstractTestObject;
26 import org.apache.commons.collections.primitives.RandomAccessDoubleList;
27 import org.apache.commons.collections.primitives.ArrayDoubleList;
28 import org.apache.commons.collections.primitives.DoubleList;
29
30
31
32
33
34 public class TestDoubleCollectionCollection extends AbstractTestObject {
35
36
37
38
39 public TestDoubleCollectionCollection(String testName) {
40 super(testName);
41 }
42
43 public static Test suite() {
44 return new TestSuite(TestDoubleCollectionCollection.class);
45 }
46
47
48
49
50 public Object makeObject() {
51 DoubleList list = new ArrayDoubleList();
52 for(int i=0;i<10;i++) {
53 list.add((double)i);
54 }
55 return new DoubleCollectionCollection(list);
56 }
57
58 public void testSerializeDeserializeThenCompare() {
59
60 }
61
62
63 public void testCanonicalEmptyCollectionExists() {
64
65
66 }
67
68 public void testCanonicalFullCollectionExists() {
69
70
71 }
72
73
74
75
76 public void testWrapNull() {
77 assertNull(DoubleCollectionCollection.wrap(null));
78 }
79
80 public void testWrapSerializable() {
81 Collection collection = DoubleCollectionCollection.wrap(new ArrayDoubleList());
82 assertNotNull(collection);
83 assertTrue(collection instanceof Serializable);
84 }
85
86 public void testWrapNonSerializable() {
87 Collection collection = DoubleCollectionCollection.wrap(new RandomAccessDoubleList() {
88 public double get(int i) { throw new IndexOutOfBoundsException(); }
89 public int size() { return 0; }
90 });
91 assertNotNull(collection);
92 assertTrue(!(collection instanceof Serializable));
93 }
94
95 }