21 |
|
|
22 |
|
public class ConcurrentSkipListSetTest extends JSR166TestCase { |
23 |
|
public static void main(String[] args) { |
24 |
< |
junit.textui.TestRunner.run(suite()); |
24 |
> |
main(suite(), args); |
25 |
|
} |
26 |
|
public static Test suite() { |
27 |
|
return new TestSuite(ConcurrentSkipListSetTest.class); |
77 |
|
*/ |
78 |
|
public void testConstructor3() { |
79 |
|
try { |
80 |
< |
ConcurrentSkipListSet q = new ConcurrentSkipListSet((Collection)null); |
80 |
> |
new ConcurrentSkipListSet((Collection)null); |
81 |
|
shouldThrow(); |
82 |
|
} catch (NullPointerException success) {} |
83 |
|
} |
88 |
|
public void testConstructor4() { |
89 |
|
try { |
90 |
|
Integer[] ints = new Integer[SIZE]; |
91 |
< |
ConcurrentSkipListSet q = new ConcurrentSkipListSet(Arrays.asList(ints)); |
91 |
> |
new ConcurrentSkipListSet(Arrays.asList(ints)); |
92 |
|
shouldThrow(); |
93 |
|
} catch (NullPointerException success) {} |
94 |
|
} |
101 |
|
Integer[] ints = new Integer[SIZE]; |
102 |
|
for (int i = 0; i < SIZE-1; ++i) |
103 |
|
ints[i] = new Integer(i); |
104 |
< |
ConcurrentSkipListSet q = new ConcurrentSkipListSet(Arrays.asList(ints)); |
104 |
> |
new ConcurrentSkipListSet(Arrays.asList(ints)); |
105 |
|
shouldThrow(); |
106 |
|
} catch (NullPointerException success) {} |
107 |
|
} |
166 |
|
* add(null) throws NPE |
167 |
|
*/ |
168 |
|
public void testAddNull() { |
169 |
+ |
ConcurrentSkipListSet q = new ConcurrentSkipListSet(); |
170 |
|
try { |
170 |
– |
ConcurrentSkipListSet q = new ConcurrentSkipListSet(); |
171 |
|
q.add(null); |
172 |
|
shouldThrow(); |
173 |
|
} catch (NullPointerException success) {} |
195 |
|
* Add of non-Comparable throws CCE |
196 |
|
*/ |
197 |
|
public void testAddNonComparable() { |
198 |
+ |
ConcurrentSkipListSet q = new ConcurrentSkipListSet(); |
199 |
|
try { |
199 |
– |
ConcurrentSkipListSet q = new ConcurrentSkipListSet(); |
200 |
– |
q.add(new Object()); |
200 |
|
q.add(new Object()); |
201 |
|
q.add(new Object()); |
202 |
|
shouldThrow(); |
207 |
|
* addAll(null) throws NPE |
208 |
|
*/ |
209 |
|
public void testAddAll1() { |
210 |
+ |
ConcurrentSkipListSet q = new ConcurrentSkipListSet(); |
211 |
|
try { |
212 |
– |
ConcurrentSkipListSet q = new ConcurrentSkipListSet(); |
212 |
|
q.addAll(null); |
213 |
|
shouldThrow(); |
214 |
|
} catch (NullPointerException success) {} |
218 |
|
* addAll of a collection with null elements throws NPE |
219 |
|
*/ |
220 |
|
public void testAddAll2() { |
221 |
+ |
ConcurrentSkipListSet q = new ConcurrentSkipListSet(); |
222 |
+ |
Integer[] ints = new Integer[SIZE]; |
223 |
|
try { |
223 |
– |
ConcurrentSkipListSet q = new ConcurrentSkipListSet(); |
224 |
– |
Integer[] ints = new Integer[SIZE]; |
224 |
|
q.addAll(Arrays.asList(ints)); |
225 |
|
shouldThrow(); |
226 |
|
} catch (NullPointerException success) {} |
231 |
|
* possibly adding some elements |
232 |
|
*/ |
233 |
|
public void testAddAll3() { |
234 |
+ |
ConcurrentSkipListSet q = new ConcurrentSkipListSet(); |
235 |
+ |
Integer[] ints = new Integer[SIZE]; |
236 |
+ |
for (int i = 0; i < SIZE-1; ++i) |
237 |
+ |
ints[i] = new Integer(i); |
238 |
|
try { |
236 |
– |
ConcurrentSkipListSet q = new ConcurrentSkipListSet(); |
237 |
– |
Integer[] ints = new Integer[SIZE]; |
238 |
– |
for (int i = 0; i < SIZE-1; ++i) |
239 |
– |
ints[i] = new Integer(i); |
239 |
|
q.addAll(Arrays.asList(ints)); |
240 |
|
shouldThrow(); |
241 |
|
} catch (NullPointerException success) {} |