757 |
|
ExecutorService executor = Executors.newFixedThreadPool(2); |
758 |
|
executor.execute(new CheckedRunnable() { |
759 |
|
public void realRun() throws InterruptedException { |
760 |
< |
threadAssertFalse(q.offer(three)); |
761 |
< |
threadAssertTrue(q.offer(three, MEDIUM_DELAY_MS, MILLISECONDS)); |
762 |
< |
threadAssertEquals(0, q.remainingCapacity()); |
760 |
> |
assertFalse(q.offer(three)); |
761 |
> |
assertTrue(q.offer(three, MEDIUM_DELAY_MS, MILLISECONDS)); |
762 |
> |
assertEquals(0, q.remainingCapacity()); |
763 |
|
}}); |
764 |
|
|
765 |
|
executor.execute(new CheckedRunnable() { |
766 |
|
public void realRun() throws InterruptedException { |
767 |
|
Thread.sleep(SMALL_DELAY_MS); |
768 |
< |
threadAssertEquals(one, q.take()); |
768 |
> |
assertSame(one, q.take()); |
769 |
|
}}); |
770 |
|
|
771 |
|
joinPool(executor); |
779 |
|
ExecutorService executor = Executors.newFixedThreadPool(2); |
780 |
|
executor.execute(new CheckedRunnable() { |
781 |
|
public void realRun() throws InterruptedException { |
782 |
< |
threadAssertNull(q.poll()); |
783 |
< |
threadAssertTrue(null != q.poll(MEDIUM_DELAY_MS, MILLISECONDS)); |
784 |
< |
threadAssertTrue(q.isEmpty()); |
782 |
> |
assertNull(q.poll()); |
783 |
> |
assertSame(one, q.poll(MEDIUM_DELAY_MS, MILLISECONDS)); |
784 |
> |
assertTrue(q.isEmpty()); |
785 |
|
}}); |
786 |
|
|
787 |
|
executor.execute(new CheckedRunnable() { |