6 |
|
* Pat Fisher, Mike Judd. |
7 |
|
*/ |
8 |
|
|
9 |
< |
import junit.framework.*; |
10 |
< |
import java.util.Arrays; |
9 |
> |
import static java.util.concurrent.TimeUnit.MILLISECONDS; |
10 |
> |
|
11 |
|
import java.util.ArrayList; |
12 |
+ |
import java.util.Arrays; |
13 |
+ |
import java.util.Collection; |
14 |
|
import java.util.Iterator; |
15 |
|
import java.util.NoSuchElementException; |
16 |
|
import java.util.concurrent.BlockingQueue; |
20 |
|
import java.util.concurrent.Executors; |
21 |
|
import java.util.concurrent.ExecutorService; |
22 |
|
import java.util.concurrent.TimeUnit; |
23 |
< |
import static java.util.concurrent.TimeUnit.MILLISECONDS; |
23 |
> |
|
24 |
> |
import junit.framework.Test; |
25 |
|
|
26 |
|
public class DelayQueueTest extends JSR166TestCase { |
27 |
|
|
654 |
|
public void realRun() throws InterruptedException { |
655 |
|
assertNull(q.poll()); |
656 |
|
threadsStarted.await(); |
657 |
< |
assertTrue(null != q.poll(LONG_DELAY_MS, MILLISECONDS)); |
657 |
> |
assertNotNull(q.poll(LONG_DELAY_MS, MILLISECONDS)); |
658 |
|
checkEmpty(q); |
659 |
|
}}); |
660 |
|
|
774 |
|
} |
775 |
|
} |
776 |
|
|
777 |
+ |
/** |
778 |
+ |
* remove(null), contains(null) always return false |
779 |
+ |
*/ |
780 |
+ |
public void testNeverContainsNull() { |
781 |
+ |
Collection<?> q = populatedQueue(SIZE); |
782 |
+ |
assertFalse(q.contains(null)); |
783 |
+ |
assertFalse(q.remove(null)); |
784 |
+ |
} |
785 |
|
} |