1508 |
|
ExecutorService executor = Executors.newFixedThreadPool(2); |
1509 |
|
executor.execute(new CheckedRunnable() { |
1510 |
|
public void realRun() throws InterruptedException { |
1511 |
< |
threadAssertFalse(q.offer(three)); |
1512 |
< |
threadAssertTrue(q.offer(three, MEDIUM_DELAY_MS, MILLISECONDS)); |
1513 |
< |
threadAssertEquals(0, q.remainingCapacity()); |
1511 |
> |
assertFalse(q.offer(three)); |
1512 |
> |
assertTrue(q.offer(three, MEDIUM_DELAY_MS, MILLISECONDS)); |
1513 |
> |
assertEquals(0, q.remainingCapacity()); |
1514 |
|
}}); |
1515 |
|
|
1516 |
|
executor.execute(new CheckedRunnable() { |
1517 |
|
public void realRun() throws InterruptedException { |
1518 |
|
Thread.sleep(SMALL_DELAY_MS); |
1519 |
< |
threadAssertEquals(one, q.take()); |
1519 |
> |
assertSame(one, q.take()); |
1520 |
|
}}); |
1521 |
|
|
1522 |
|
joinPool(executor); |
1530 |
|
ExecutorService executor = Executors.newFixedThreadPool(2); |
1531 |
|
executor.execute(new CheckedRunnable() { |
1532 |
|
public void realRun() throws InterruptedException { |
1533 |
< |
threadAssertNull(q.poll()); |
1534 |
< |
threadAssertTrue(null != q.poll(MEDIUM_DELAY_MS, MILLISECONDS)); |
1535 |
< |
threadAssertTrue(q.isEmpty()); |
1533 |
> |
assertNull(q.poll()); |
1534 |
> |
assertSame(one, q.poll(MEDIUM_DELAY_MS, MILLISECONDS)); |
1535 |
> |
assertTrue(q.isEmpty()); |
1536 |
|
}}); |
1537 |
|
|
1538 |
|
executor.execute(new CheckedRunnable() { |