15 |
|
public class LinkedBlockingQueueTest extends JSR166TestCase { |
16 |
|
|
17 |
|
public static void main(String[] args) { |
18 |
< |
junit.textui.TestRunner.run (suite()); |
18 |
> |
junit.textui.TestRunner.run(suite()); |
19 |
|
} |
20 |
|
|
21 |
|
public static Test suite() { |
214 |
|
shouldThrow(); |
215 |
|
} catch (NullPointerException success) {} |
216 |
|
} |
217 |
+ |
|
218 |
|
/** |
219 |
|
* addAll of a collection with any null elements throws NPE after |
220 |
|
* possibly adding some elements |
229 |
|
shouldThrow(); |
230 |
|
} catch (NullPointerException success) {} |
231 |
|
} |
232 |
+ |
|
233 |
|
/** |
234 |
|
* addAll throws ISE if not enough room |
235 |
|
*/ |
243 |
|
shouldThrow(); |
244 |
|
} catch (IllegalStateException success) {} |
245 |
|
} |
246 |
+ |
|
247 |
|
/** |
248 |
|
* Queue contains all elements, in traversal order, of successful addAll |
249 |
|
*/ |
689 |
|
/** |
690 |
|
* iterator.remove removes current element |
691 |
|
*/ |
692 |
< |
public void testIteratorRemove () { |
692 |
> |
public void testIteratorRemove() { |
693 |
|
final LinkedBlockingQueue q = new LinkedBlockingQueue(3); |
694 |
|
q.add(two); |
695 |
|
q.add(one); |
700 |
|
it.remove(); |
701 |
|
|
702 |
|
it = q.iterator(); |
703 |
< |
assertEquals(it.next(), one); |
704 |
< |
assertEquals(it.next(), three); |
703 |
> |
assertSame(it.next(), one); |
704 |
> |
assertSame(it.next(), three); |
705 |
|
assertFalse(it.hasNext()); |
706 |
|
} |
707 |
|
|
725 |
|
/** |
726 |
|
* Modifications do not cause iterators to fail |
727 |
|
*/ |
728 |
< |
public void testWeaklyConsistentIteration () { |
728 |
> |
public void testWeaklyConsistentIteration() { |
729 |
|
final LinkedBlockingQueue q = new LinkedBlockingQueue(3); |
730 |
|
q.add(one); |
731 |
|
q.add(two); |