11 |
|
import java.io.*; |
12 |
|
|
13 |
|
public class LinkedBlockingDequeTest extends JSR166TestCase { |
14 |
+ |
|
15 |
+ |
public static class Unbounded extends BlockingQueueTest { |
16 |
+ |
protected BlockingQueue emptyCollection() { |
17 |
+ |
return new LinkedBlockingDeque(); |
18 |
+ |
} |
19 |
+ |
} |
20 |
+ |
|
21 |
+ |
public static class Bounded extends BlockingQueueTest { |
22 |
+ |
protected BlockingQueue emptyCollection() { |
23 |
+ |
return new LinkedBlockingDeque(20); |
24 |
+ |
} |
25 |
+ |
} |
26 |
+ |
|
27 |
|
public static void main(String[] args) { |
28 |
< |
junit.textui.TestRunner.run (suite()); |
28 |
> |
junit.textui.TestRunner.run(suite()); |
29 |
|
} |
30 |
|
|
31 |
|
public static Test suite() { |
32 |
< |
return new TestSuite(LinkedBlockingDequeTest.class); |
32 |
> |
return newTestSuite(LinkedBlockingDequeTest.class, |
33 |
> |
new Unbounded().testSuite(), |
34 |
> |
new Bounded().testSuite()); |
35 |
|
} |
36 |
|
|
37 |
|
/** |
113 |
|
public void testPollFirst() { |
114 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
115 |
|
for (int i = 0; i < SIZE; ++i) { |
116 |
< |
assertEquals(i, ((Integer)q.pollFirst()).intValue()); |
116 |
> |
assertEquals(i, q.pollFirst()); |
117 |
|
} |
118 |
|
assertNull(q.pollFirst()); |
119 |
|
} |
124 |
|
public void testPollLast() { |
125 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
126 |
|
for (int i = SIZE-1; i >= 0; --i) { |
127 |
< |
assertEquals(i, ((Integer)q.pollLast()).intValue()); |
127 |
> |
assertEquals(i, q.pollLast()); |
128 |
|
} |
129 |
|
assertNull(q.pollLast()); |
130 |
|
} |
135 |
|
public void testPeekFirst() { |
136 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
137 |
|
for (int i = 0; i < SIZE; ++i) { |
138 |
< |
assertEquals(i, ((Integer)q.peekFirst()).intValue()); |
139 |
< |
q.pollFirst(); |
138 |
> |
assertEquals(i, q.peekFirst()); |
139 |
> |
assertEquals(i, q.pollFirst()); |
140 |
|
assertTrue(q.peekFirst() == null || |
141 |
< |
i != ((Integer)q.peekFirst()).intValue()); |
141 |
> |
!q.peekFirst().equals(i)); |
142 |
|
} |
143 |
|
assertNull(q.peekFirst()); |
144 |
|
} |
149 |
|
public void testPeek() { |
150 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
151 |
|
for (int i = 0; i < SIZE; ++i) { |
152 |
< |
assertEquals(i, ((Integer)q.peek()).intValue()); |
153 |
< |
q.pollFirst(); |
152 |
> |
assertEquals(i, q.peek()); |
153 |
> |
assertEquals(i, q.pollFirst()); |
154 |
|
assertTrue(q.peek() == null || |
155 |
< |
i != ((Integer)q.peek()).intValue()); |
155 |
> |
!q.peek().equals(i)); |
156 |
|
} |
157 |
|
assertNull(q.peek()); |
158 |
|
} |
163 |
|
public void testPeekLast() { |
164 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
165 |
|
for (int i = SIZE-1; i >= 0; --i) { |
166 |
< |
assertEquals(i, ((Integer)q.peekLast()).intValue()); |
167 |
< |
q.pollLast(); |
166 |
> |
assertEquals(i, q.peekLast()); |
167 |
> |
assertEquals(i, q.pollLast()); |
168 |
|
assertTrue(q.peekLast() == null || |
169 |
< |
i != ((Integer)q.peekLast()).intValue()); |
169 |
> |
!q.peekLast().equals(i)); |
170 |
|
} |
171 |
|
assertNull(q.peekLast()); |
172 |
|
} |
173 |
|
|
174 |
|
/** |
175 |
< |
* getFirst returns next getFirst, or throws NSEE if empty |
175 |
> |
* getFirst() returns first element, or throws NSEE if empty |
176 |
|
*/ |
177 |
|
public void testFirstElement() { |
178 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
179 |
|
for (int i = 0; i < SIZE; ++i) { |
180 |
< |
assertEquals(i, ((Integer)q.getFirst()).intValue()); |
181 |
< |
q.pollFirst(); |
180 |
> |
assertEquals(i, q.getFirst()); |
181 |
> |
assertEquals(i, q.pollFirst()); |
182 |
|
} |
183 |
|
try { |
184 |
|
q.getFirst(); |
188 |
|
} |
189 |
|
|
190 |
|
/** |
191 |
< |
* getLast returns next element, or throws NSEE if empty |
191 |
> |
* getLast() returns last element, or throws NSEE if empty |
192 |
|
*/ |
193 |
|
public void testLastElement() { |
194 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
195 |
|
for (int i = SIZE-1; i >= 0; --i) { |
196 |
< |
assertEquals(i, ((Integer)q.getLast()).intValue()); |
197 |
< |
q.pollLast(); |
196 |
> |
assertEquals(i, q.getLast()); |
197 |
> |
assertEquals(i, q.pollLast()); |
198 |
|
} |
199 |
|
try { |
200 |
|
q.getLast(); |
204 |
|
} |
205 |
|
|
206 |
|
/** |
207 |
< |
* removeFirst removes next element, or throws NSEE if empty |
207 |
> |
* removeFirst() removes first element, or throws NSEE if empty |
208 |
|
*/ |
209 |
|
public void testRemoveFirst() { |
210 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
211 |
|
for (int i = 0; i < SIZE; ++i) { |
212 |
< |
assertEquals(i, ((Integer)q.removeFirst()).intValue()); |
212 |
> |
assertEquals(i, q.removeFirst()); |
213 |
|
} |
214 |
|
try { |
215 |
|
q.removeFirst(); |
219 |
|
} |
220 |
|
|
221 |
|
/** |
222 |
< |
* removeLast removes last element, or throws NSEE if empty |
222 |
> |
* removeLast() removes last element, or throws NSEE if empty |
223 |
|
*/ |
224 |
|
public void testRemoveLast() { |
225 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
226 |
|
for (int i = SIZE - 1; i >= 0; --i) { |
227 |
< |
assertEquals(i, ((Integer)q.removeLast()).intValue()); |
227 |
> |
assertEquals(i, q.removeLast()); |
228 |
|
} |
229 |
|
try { |
230 |
|
q.removeLast(); |
239 |
|
public void testRemove() { |
240 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
241 |
|
for (int i = 0; i < SIZE; ++i) { |
242 |
< |
assertEquals(i, ((Integer)q.remove()).intValue()); |
242 |
> |
assertEquals(i, q.remove()); |
243 |
|
} |
244 |
|
try { |
245 |
|
q.remove(); |
284 |
|
LinkedBlockingDeque q = populatedDeque(3); |
285 |
|
q.pollLast(); |
286 |
|
q.addFirst(four); |
287 |
< |
assertEquals(four,q.peekFirst()); |
287 |
> |
assertSame(four, q.peekFirst()); |
288 |
|
} |
289 |
|
|
290 |
|
/** |
294 |
|
LinkedBlockingDeque q = populatedDeque(3); |
295 |
|
q.pollLast(); |
296 |
|
q.addLast(four); |
297 |
< |
assertEquals(four,q.peekLast()); |
297 |
> |
assertSame(four, q.peekLast()); |
298 |
|
} |
299 |
|
|
300 |
|
|
452 |
|
LinkedBlockingDeque q = populatedDeque(3); |
453 |
|
q.pollLast(); |
454 |
|
q.push(four); |
455 |
< |
assertEquals(four,q.peekFirst()); |
455 |
> |
assertSame(four, q.peekFirst()); |
456 |
|
} |
457 |
|
|
458 |
|
|
462 |
|
public void testPop() { |
463 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
464 |
|
for (int i = 0; i < SIZE; ++i) { |
465 |
< |
assertEquals(i, ((Integer)q.pop()).intValue()); |
465 |
> |
assertEquals(i, q.pop()); |
466 |
|
} |
467 |
|
try { |
468 |
|
q.pop(); |
528 |
|
shouldThrow(); |
529 |
|
} catch (NullPointerException success) {} |
530 |
|
} |
531 |
+ |
|
532 |
|
/** |
533 |
|
* addAll of a collection with any null elements throws NPE after |
534 |
|
* possibly adding some elements |
543 |
|
shouldThrow(); |
544 |
|
} catch (NullPointerException success) {} |
545 |
|
} |
546 |
+ |
|
547 |
|
/** |
548 |
|
* addAll throws ISE if not enough room |
549 |
|
*/ |
677 |
|
public void testTake() throws InterruptedException { |
678 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
679 |
|
for (int i = 0; i < SIZE; ++i) { |
680 |
< |
assertEquals(i, ((Integer)q.take()).intValue()); |
680 |
> |
assertEquals(i, q.take()); |
681 |
|
} |
682 |
|
} |
683 |
|
|
705 |
|
Thread t = new Thread(new CheckedRunnable() { |
706 |
|
public void realRun() throws InterruptedException { |
707 |
|
for (int i = 0; i < SIZE; ++i) { |
708 |
< |
assertEquals(i, ((Integer)q.take()).intValue()); |
708 |
> |
assertEquals(i, q.take()); |
709 |
|
} |
710 |
|
try { |
711 |
|
q.take(); |
726 |
|
public void testPoll() { |
727 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
728 |
|
for (int i = 0; i < SIZE; ++i) { |
729 |
< |
assertEquals(i, ((Integer)q.poll()).intValue()); |
729 |
> |
assertEquals(i, q.poll()); |
730 |
|
} |
731 |
|
assertNull(q.poll()); |
732 |
|
} |
737 |
|
public void testTimedPoll0() throws InterruptedException { |
738 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
739 |
|
for (int i = 0; i < SIZE; ++i) { |
740 |
< |
assertEquals(i, ((Integer)q.poll(0, MILLISECONDS)).intValue()); |
740 |
> |
assertEquals(i, q.poll(0, MILLISECONDS)); |
741 |
|
} |
742 |
|
assertNull(q.poll(0, MILLISECONDS)); |
743 |
|
} |
748 |
|
public void testTimedPoll() throws InterruptedException { |
749 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
750 |
|
for (int i = 0; i < SIZE; ++i) { |
751 |
< |
assertEquals(i, ((Integer)q.poll(SHORT_DELAY_MS, MILLISECONDS)).intValue()); |
751 |
> |
assertEquals(i, q.poll(SHORT_DELAY_MS, MILLISECONDS)); |
752 |
|
} |
753 |
|
assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS)); |
754 |
|
} |
762 |
|
public void realRun() throws InterruptedException { |
763 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
764 |
|
for (int i = 0; i < SIZE; ++i) { |
765 |
< |
assertEquals(i, ((Integer)q.poll(SHORT_DELAY_MS, MILLISECONDS)).intValue()); |
765 |
> |
assertEquals(i, q.poll(SHORT_DELAY_MS, MILLISECONDS)); |
766 |
|
} |
767 |
|
try { |
768 |
|
q.poll(SMALL_DELAY_MS, MILLISECONDS); |
777 |
|
} |
778 |
|
|
779 |
|
/** |
763 |
– |
* timed poll before a delayed offer fails; after offer succeeds; |
764 |
– |
* on interruption throws |
765 |
– |
*/ |
766 |
– |
public void testTimedPollWithOffer() throws InterruptedException { |
767 |
– |
final LinkedBlockingDeque q = new LinkedBlockingDeque(2); |
768 |
– |
Thread t = new Thread(new CheckedRunnable() { |
769 |
– |
public void realRun() throws InterruptedException { |
770 |
– |
assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS)); |
771 |
– |
assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS)); |
772 |
– |
try { |
773 |
– |
q.poll(LONG_DELAY_MS, MILLISECONDS); |
774 |
– |
shouldThrow(); |
775 |
– |
} catch (InterruptedException success) {} |
776 |
– |
}}); |
777 |
– |
|
778 |
– |
t.start(); |
779 |
– |
Thread.sleep(SMALL_DELAY_MS); |
780 |
– |
assertTrue(q.offer(zero, SHORT_DELAY_MS, MILLISECONDS)); |
781 |
– |
t.interrupt(); |
782 |
– |
t.join(); |
783 |
– |
} |
784 |
– |
|
785 |
– |
|
786 |
– |
/** |
780 |
|
* putFirst(null) throws NPE |
781 |
|
*/ |
782 |
|
public void testPutFirstNull() throws InterruptedException { |
879 |
|
public void testTakeFirst() throws InterruptedException { |
880 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
881 |
|
for (int i = 0; i < SIZE; ++i) { |
882 |
< |
assertEquals(i, ((Integer)q.takeFirst()).intValue()); |
882 |
> |
assertEquals(i, q.takeFirst()); |
883 |
|
} |
884 |
|
} |
885 |
|
|
927 |
|
public void testTimedPollFirst0() throws InterruptedException { |
928 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
929 |
|
for (int i = 0; i < SIZE; ++i) { |
930 |
< |
assertEquals(i, ((Integer)q.pollFirst(0, MILLISECONDS)).intValue()); |
930 |
> |
assertEquals(i, q.pollFirst(0, MILLISECONDS)); |
931 |
|
} |
932 |
|
assertNull(q.pollFirst(0, MILLISECONDS)); |
933 |
|
} |
938 |
|
public void testTimedPollFirst() throws InterruptedException { |
939 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
940 |
|
for (int i = 0; i < SIZE; ++i) { |
941 |
< |
assertEquals(i, ((Integer)q.pollFirst(SHORT_DELAY_MS, MILLISECONDS)).intValue()); |
941 |
> |
assertEquals(i, q.pollFirst(SHORT_DELAY_MS, MILLISECONDS)); |
942 |
|
} |
943 |
|
assertNull(q.pollFirst(SHORT_DELAY_MS, MILLISECONDS)); |
944 |
|
} |
952 |
|
public void realRun() throws InterruptedException { |
953 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
954 |
|
for (int i = 0; i < SIZE; ++i) { |
955 |
< |
assertEquals(i, ((Integer)q.pollFirst(SHORT_DELAY_MS, MILLISECONDS)).intValue()); |
955 |
> |
assertEquals(i, q.pollFirst(SHORT_DELAY_MS, MILLISECONDS)); |
956 |
|
} |
957 |
|
try { |
958 |
|
q.pollFirst(SMALL_DELAY_MS, MILLISECONDS); |
1092 |
|
public void testTakeLast() throws InterruptedException { |
1093 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
1094 |
|
for (int i = 0; i < SIZE; ++i) { |
1095 |
< |
assertEquals(SIZE-i-1, ((Integer)q.takeLast()).intValue()); |
1095 |
> |
assertEquals(SIZE-i-1, q.takeLast()); |
1096 |
|
} |
1097 |
|
} |
1098 |
|
|
1139 |
|
public void testTimedPollLast0() throws InterruptedException { |
1140 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
1141 |
|
for (int i = 0; i < SIZE; ++i) { |
1142 |
< |
assertEquals(SIZE-i-1, ((Integer)q.pollLast(0, MILLISECONDS)).intValue()); |
1142 |
> |
assertEquals(SIZE-i-1, q.pollLast(0, MILLISECONDS)); |
1143 |
|
} |
1144 |
|
assertNull(q.pollLast(0, MILLISECONDS)); |
1145 |
|
} |
1150 |
|
public void testTimedPollLast() throws InterruptedException { |
1151 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
1152 |
|
for (int i = 0; i < SIZE; ++i) { |
1153 |
< |
assertEquals(SIZE-i-1, ((Integer)q.pollLast(SHORT_DELAY_MS, MILLISECONDS)).intValue()); |
1153 |
> |
assertEquals(SIZE-i-1, q.pollLast(SHORT_DELAY_MS, MILLISECONDS)); |
1154 |
|
} |
1155 |
|
assertNull(q.pollLast(SHORT_DELAY_MS, MILLISECONDS)); |
1156 |
|
} |
1164 |
|
public void realRun() throws InterruptedException { |
1165 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
1166 |
|
for (int i = 0; i < SIZE; ++i) { |
1167 |
< |
assertEquals(SIZE-i-1, ((Integer)q.pollLast(SHORT_DELAY_MS, MILLISECONDS)).intValue()); |
1167 |
> |
assertEquals(SIZE-i-1, q.pollLast(SHORT_DELAY_MS, MILLISECONDS)); |
1168 |
|
} |
1169 |
|
try { |
1170 |
|
q.pollLast(SMALL_DELAY_MS, MILLISECONDS); |
1179 |
|
} |
1180 |
|
|
1181 |
|
/** |
1182 |
< |
* timed poll before a delayed offerLast fails; after offerLast succeeds; |
1183 |
< |
* on interruption throws |
1182 |
> |
* timed poll before a delayed offerLast fails; after offerLast succeeds; |
1183 |
> |
* on interruption throws |
1184 |
|
*/ |
1185 |
|
public void testTimedPollWithOfferLast() throws InterruptedException { |
1186 |
|
final LinkedBlockingDeque q = new LinkedBlockingDeque(2); |
1208 |
|
public void testElement() { |
1209 |
|
LinkedBlockingDeque q = populatedDeque(SIZE); |
1210 |
|
for (int i = 0; i < SIZE; ++i) { |
1211 |
< |
assertEquals(i, ((Integer)q.element()).intValue()); |
1211 |
> |
assertEquals(i, q.element()); |
1212 |
|
q.poll(); |
1213 |
|
} |
1214 |
|
try { |
1334 |
|
* toArray(null) throws NPE |
1335 |
|
*/ |
1336 |
|
public void testToArray_BadArg() { |
1337 |
+ |
LinkedBlockingDeque q = populatedDeque(SIZE); |
1338 |
|
try { |
1345 |
– |
LinkedBlockingDeque q = populatedDeque(SIZE); |
1339 |
|
Object o[] = q.toArray(null); |
1340 |
|
shouldThrow(); |
1341 |
|
} catch (NullPointerException success) {} |
1345 |
|
* toArray with incompatible array type throws CCE |
1346 |
|
*/ |
1347 |
|
public void testToArray1_BadArg() { |
1348 |
+ |
LinkedBlockingDeque q = populatedDeque(SIZE); |
1349 |
|
try { |
1350 |
< |
LinkedBlockingDeque q = populatedDeque(SIZE); |
1357 |
< |
Object o[] = q.toArray(new String[10] ); |
1350 |
> |
Object o[] = q.toArray(new String[10]); |
1351 |
|
shouldThrow(); |
1352 |
|
} catch (ArrayStoreException success) {} |
1353 |
|
} |
1367 |
|
/** |
1368 |
|
* iterator.remove removes current element |
1369 |
|
*/ |
1370 |
< |
public void testIteratorRemove () { |
1370 |
> |
public void testIteratorRemove() { |
1371 |
|
final LinkedBlockingDeque q = new LinkedBlockingDeque(3); |
1372 |
|
q.add(two); |
1373 |
|
q.add(one); |
1378 |
|
it.remove(); |
1379 |
|
|
1380 |
|
it = q.iterator(); |
1381 |
< |
assertEquals(it.next(), one); |
1382 |
< |
assertEquals(it.next(), three); |
1381 |
> |
assertSame(it.next(), one); |
1382 |
> |
assertSame(it.next(), three); |
1383 |
|
assertFalse(it.hasNext()); |
1384 |
|
} |
1385 |
|
|
1395 |
|
assertEquals(0, q.remainingCapacity()); |
1396 |
|
int k = 0; |
1397 |
|
for (Iterator it = q.iterator(); it.hasNext();) { |
1398 |
< |
int i = ((Integer)(it.next())).intValue(); |
1406 |
< |
assertEquals(++k, i); |
1398 |
> |
assertEquals(++k, it.next()); |
1399 |
|
} |
1400 |
|
assertEquals(3, k); |
1401 |
|
} |
1403 |
|
/** |
1404 |
|
* Modifications do not cause iterators to fail |
1405 |
|
*/ |
1406 |
< |
public void testWeaklyConsistentIteration () { |
1406 |
> |
public void testWeaklyConsistentIteration() { |
1407 |
|
final LinkedBlockingDeque q = new LinkedBlockingDeque(3); |
1408 |
|
q.add(one); |
1409 |
|
q.add(two); |
1446 |
|
q.add(new Integer(1)); |
1447 |
|
int k = 0; |
1448 |
|
for (Iterator it = q.descendingIterator(); it.hasNext();) { |
1449 |
< |
int i = ((Integer)(it.next())).intValue(); |
1458 |
< |
assertEquals(++k, i); |
1449 |
> |
assertEquals(++k, it.next()); |
1450 |
|
} |
1451 |
|
|
1452 |
|
assertEquals(3, k); |
1459 |
|
/** |
1460 |
|
* descendingIterator.remove removes current element |
1461 |
|
*/ |
1462 |
< |
public void testDescendingIteratorRemove () { |
1462 |
> |
public void testDescendingIteratorRemove() { |
1463 |
|
final LinkedBlockingDeque q = new LinkedBlockingDeque(); |
1464 |
|
for (int iters = 0; iters < 100; ++iters) { |
1465 |
|
q.add(new Integer(3)); |
1501 |
|
ExecutorService executor = Executors.newFixedThreadPool(2); |
1502 |
|
executor.execute(new CheckedRunnable() { |
1503 |
|
public void realRun() throws InterruptedException { |
1504 |
< |
threadAssertFalse(q.offer(three)); |
1505 |
< |
threadAssertTrue(q.offer(three, MEDIUM_DELAY_MS, MILLISECONDS)); |
1506 |
< |
threadAssertEquals(0, q.remainingCapacity()); |
1504 |
> |
assertFalse(q.offer(three)); |
1505 |
> |
assertTrue(q.offer(three, MEDIUM_DELAY_MS, MILLISECONDS)); |
1506 |
> |
assertEquals(0, q.remainingCapacity()); |
1507 |
|
}}); |
1508 |
|
|
1509 |
|
executor.execute(new CheckedRunnable() { |
1510 |
|
public void realRun() throws InterruptedException { |
1511 |
|
Thread.sleep(SMALL_DELAY_MS); |
1512 |
< |
threadAssertEquals(one, q.take()); |
1512 |
> |
assertSame(one, q.take()); |
1513 |
|
}}); |
1514 |
|
|
1515 |
|
joinPool(executor); |
1523 |
|
ExecutorService executor = Executors.newFixedThreadPool(2); |
1524 |
|
executor.execute(new CheckedRunnable() { |
1525 |
|
public void realRun() throws InterruptedException { |
1526 |
< |
threadAssertNull(q.poll()); |
1527 |
< |
threadAssertTrue(null != q.poll(MEDIUM_DELAY_MS, MILLISECONDS)); |
1528 |
< |
threadAssertTrue(q.isEmpty()); |
1526 |
> |
assertNull(q.poll()); |
1527 |
> |
assertSame(one, q.poll(MEDIUM_DELAY_MS, MILLISECONDS)); |
1528 |
> |
assertTrue(q.isEmpty()); |
1529 |
|
}}); |
1530 |
|
|
1531 |
|
executor.execute(new CheckedRunnable() { |