ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/PriorityBlockingQueueTest.java
(Generate patch)

Comparing jsr166/src/test/tck/PriorityBlockingQueueTest.java (file contents):
Revision 1.24 by jsr166, Sun Nov 22 18:57:17 2009 UTC vs.
Revision 1.27 by jsr166, Wed Aug 25 01:44:48 2010 UTC

# Line 14 | Line 14 | import java.io.*;
14  
15   public class PriorityBlockingQueueTest extends JSR166TestCase {
16      public static void main(String[] args) {
17 <        junit.textui.TestRunner.run (suite());
17 >        junit.textui.TestRunner.run(suite());
18      }
19      public static Test suite() {
20          return new TestSuite(PriorityBlockingQueueTest.class);
# Line 245 | Line 245 | public class PriorityBlockingQueueTest e
245              shouldThrow();
246          } catch (NullPointerException success) {}
247      }
248 +
249      /**
250       * addAll of a collection with any null elements throws NPE after
251       * possibly adding some elements
# Line 663 | Line 664 | public class PriorityBlockingQueueTest e
664      /**
665       * iterator.remove removes current element
666       */
667 <    public void testIteratorRemove () {
667 >    public void testIteratorRemove() {
668          final PriorityBlockingQueue q = new PriorityBlockingQueue(3);
669          q.add(new Integer(2));
670          q.add(new Integer(1));
# Line 699 | Line 700 | public class PriorityBlockingQueueTest e
700          ExecutorService executor = Executors.newFixedThreadPool(2);
701          executor.execute(new CheckedRunnable() {
702              public void realRun() throws InterruptedException {
703 <                threadAssertNull(q.poll());
704 <                threadAssertTrue(null != q.poll(MEDIUM_DELAY_MS, MILLISECONDS));
705 <                threadAssertTrue(q.isEmpty());
703 >                assertNull(q.poll());
704 >                assertSame(one, q.poll(MEDIUM_DELAY_MS, MILLISECONDS));
705 >                assertTrue(q.isEmpty());
706              }});
707  
708          executor.execute(new CheckedRunnable() {
709              public void realRun() throws InterruptedException {
710                  Thread.sleep(SMALL_DELAY_MS);
711 <                q.put(new Integer(1));
711 >                q.put(one);
712              }});
713  
714          joinPool(executor);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines