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 import java.util.List;
23
24 import junit.framework.Test;
25 import junit.framework.TestSuite;
26
27 import org.apache.commons.collections.AbstractTestObject;
28 import org.apache.commons.collections.primitives.ShortCollection;
29
30
31
32
33
34 public class TestCollectionShortCollection extends AbstractTestObject {
35
36
37
38
39 public TestCollectionShortCollection(String testName) {
40 super(testName);
41 }
42
43 public static Test suite() {
44 return new TestSuite(TestCollectionShortCollection.class);
45 }
46
47
48
49
50 public Object makeObject() {
51 List list = new ArrayList();
52 for(int i=0;i<10;i++) {
53 list.add(new Short((short)i));
54 }
55 return new CollectionShortCollection(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(CollectionShortCollection.wrap(null));
78 }
79
80 public void testWrapSerializable() {
81 ShortCollection collection = CollectionShortCollection.wrap(new ArrayList());
82 assertNotNull(collection);
83 assertTrue(collection instanceof Serializable);
84 }
85
86 public void testWrapNonSerializable() {
87 ShortCollection collection = CollectionShortCollection.wrap(new AbstractList() {
88 public Object get(int i) { throw new IndexOutOfBoundsException(); }
89 public int size() { return 0; }
90 });
91 assertNotNull(collection);
92 assertTrue(!(collection instanceof Serializable));
93 }
94
95 }