55 |
|
*/ |
56 |
|
public void testConstructor3() { |
57 |
|
try { |
58 |
< |
ConcurrentLinkedDeque q = new ConcurrentLinkedDeque((Collection)null); |
58 |
> |
new ConcurrentLinkedDeque((Collection)null); |
59 |
|
shouldThrow(); |
60 |
|
} catch (NullPointerException success) {} |
61 |
|
} |
66 |
|
public void testConstructor4() { |
67 |
|
try { |
68 |
|
Integer[] ints = new Integer[SIZE]; |
69 |
< |
ConcurrentLinkedDeque q = new ConcurrentLinkedDeque(Arrays.asList(ints)); |
69 |
> |
new ConcurrentLinkedDeque(Arrays.asList(ints)); |
70 |
|
shouldThrow(); |
71 |
|
} catch (NullPointerException success) {} |
72 |
|
} |
79 |
|
Integer[] ints = new Integer[SIZE]; |
80 |
|
for (int i = 0; i < SIZE-1; ++i) |
81 |
|
ints[i] = new Integer(i); |
82 |
< |
ConcurrentLinkedDeque q = new ConcurrentLinkedDeque(Arrays.asList(ints)); |
82 |
> |
new ConcurrentLinkedDeque(Arrays.asList(ints)); |
83 |
|
shouldThrow(); |
84 |
|
} catch (NullPointerException success) {} |
85 |
|
} |
696 |
|
*/ |
697 |
|
public void testIterator() { |
698 |
|
ConcurrentLinkedDeque q = populatedDeque(SIZE); |
699 |
– |
int i = 0; |
699 |
|
Iterator it = q.iterator(); |
700 |
< |
while (it.hasNext()) { |
700 |
> |
int i; |
701 |
> |
for (i = 0; it.hasNext(); i++) |
702 |
|
assertTrue(q.contains(it.next())); |
703 |
– |
++i; |
704 |
– |
} |
703 |
|
assertEquals(i, SIZE); |
704 |
+ |
assertIteratorExhausted(it); |
705 |
+ |
} |
706 |
+ |
|
707 |
+ |
/** |
708 |
+ |
* iterator of empty collection has no elements |
709 |
+ |
*/ |
710 |
+ |
public void testEmptyIterator() { |
711 |
+ |
Deque c = new ConcurrentLinkedDeque(); |
712 |
+ |
assertIteratorExhausted(c.iterator()); |
713 |
+ |
assertIteratorExhausted(c.descendingIterator()); |
714 |
|
} |
715 |
|
|
716 |
|
/** |