44 |
|
} |
45 |
|
|
46 |
|
/** |
47 |
< |
* Create a deque of given size containing consecutive |
47 |
> |
* Returns a new deque of given size containing consecutive |
48 |
|
* Integers 0 ... n. |
49 |
|
*/ |
50 |
|
private LinkedBlockingDeque<Integer> populatedDeque(int n) { |
1064 |
|
|
1065 |
|
pleaseInterrupt.countDown(); |
1066 |
|
try { |
1067 |
< |
q.pollFirst(SMALL_DELAY_MS, MILLISECONDS); |
1067 |
> |
q.pollFirst(LONG_DELAY_MS, MILLISECONDS); |
1068 |
|
shouldThrow(); |
1069 |
|
} catch (InterruptedException success) {} |
1070 |
|
assertFalse(Thread.interrupted()); |
1766 |
|
ArrayList l = new ArrayList(); |
1767 |
|
q.drainTo(l, i); |
1768 |
|
int k = (i < SIZE) ? i : SIZE; |
1769 |
< |
assertEquals(l.size(), k); |
1770 |
< |
assertEquals(q.size(), SIZE-k); |
1769 |
> |
assertEquals(k, l.size()); |
1770 |
> |
assertEquals(SIZE-k, q.size()); |
1771 |
|
for (int j = 0; j < k; ++j) |
1772 |
|
assertEquals(l.get(j), new Integer(j)); |
1773 |
|
while (q.poll() != null) ; |