97 |
|
} |
98 |
|
|
99 |
|
/** |
100 |
< |
* addAll throws ISE if no active taker |
100 |
> |
* addAll throws IllegalStateException if no active taker |
101 |
|
*/ |
102 |
|
public void testAddAll_ISE() { testAddAll_ISE(false); } |
103 |
|
public void testAddAll_ISE_fair() { testAddAll_ISE(true); } |
198 |
|
long startTime = System.nanoTime(); |
199 |
|
assertFalse(q.offer(new Object(), timeoutMillis(), MILLISECONDS)); |
200 |
|
assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); |
201 |
+ |
|
202 |
+ |
Thread.currentThread().interrupt(); |
203 |
+ |
try { |
204 |
+ |
q.offer(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS); |
205 |
+ |
shouldThrow(); |
206 |
+ |
} catch (InterruptedException success) {} |
207 |
+ |
assertFalse(Thread.interrupted()); |
208 |
+ |
|
209 |
|
pleaseInterrupt.countDown(); |
210 |
|
try { |
211 |
|
q.offer(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS); |
437 |
|
public void testToArray_null(boolean fair) { |
438 |
|
final SynchronousQueue q = new SynchronousQueue(fair); |
439 |
|
try { |
440 |
< |
Object[] o = q.toArray(null); |
440 |
> |
Object[] o = q.toArray((Object[])null); |
441 |
|
shouldThrow(); |
442 |
|
} catch (NullPointerException success) {} |
443 |
|
} |
452 |
|
} |
453 |
|
|
454 |
|
/** |
455 |
< |
* iterator remove throws ISE |
455 |
> |
* iterator remove throws IllegalStateException |
456 |
|
*/ |
457 |
|
public void testIteratorRemove() { testIteratorRemove(false); } |
458 |
|
public void testIteratorRemove_fair() { testIteratorRemove(true); } |
530 |
|
} |
531 |
|
|
532 |
|
/** |
533 |
< |
* a deserialized serialized queue is usable |
533 |
> |
* a deserialized/reserialized queue is usable |
534 |
|
*/ |
535 |
|
public void testSerialization() { |
536 |
|
final SynchronousQueue x = new SynchronousQueue(); |