381 |
|
} |
382 |
|
|
383 |
|
/** |
384 |
– |
* take blocks interruptibly when empty |
385 |
– |
*/ |
386 |
– |
public void testTakeFromEmpty() throws InterruptedException { |
387 |
– |
final LinkedBlockingQueue q = new LinkedBlockingQueue(2); |
388 |
– |
Thread t = new ThreadShouldThrow(InterruptedException.class) { |
389 |
– |
public void realRun() throws InterruptedException { |
390 |
– |
q.take(); |
391 |
– |
}}; |
392 |
– |
|
393 |
– |
t.start(); |
394 |
– |
Thread.sleep(SHORT_DELAY_MS); |
395 |
– |
t.interrupt(); |
396 |
– |
t.join(); |
397 |
– |
} |
398 |
– |
|
399 |
– |
/** |
384 |
|
* Take removes existing elements until empty, then blocks interruptibly |
385 |
|
*/ |
386 |
|
public void testBlockingTake() throws InterruptedException { |
414 |
|
} |
415 |
|
|
416 |
|
/** |
417 |
< |
* timed pool with zero timeout succeeds when non-empty, else times out |
417 |
> |
* timed poll with zero timeout succeeds when non-empty, else times out |
418 |
|
*/ |
419 |
|
public void testTimedPoll0() throws InterruptedException { |
420 |
|
LinkedBlockingQueue q = populatedQueue(SIZE); |
425 |
|
} |
426 |
|
|
427 |
|
/** |
428 |
< |
* timed pool with nonzero timeout succeeds when non-empty, else times out |
428 |
> |
* timed poll with nonzero timeout succeeds when non-empty, else times out |
429 |
|
*/ |
430 |
|
public void testTimedPoll() throws InterruptedException { |
431 |
|
LinkedBlockingQueue q = populatedQueue(SIZE); |
639 |
|
} |
640 |
|
|
641 |
|
/** |
642 |
< |
* toArray with incompatible array type throws CCE |
642 |
> |
* toArray(incompatible array type) throws ArrayStoreException |
643 |
|
*/ |
644 |
|
public void testToArray1_BadArg() { |
645 |
|
LinkedBlockingQueue q = populatedQueue(SIZE); |
646 |
|
try { |
647 |
< |
Object o[] = q.toArray(new String[10]); |
647 |
> |
q.toArray(new String[10]); |
648 |
|
shouldThrow(); |
649 |
|
} catch (ArrayStoreException success) {} |
650 |
|
} |