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

Comparing jsr166/src/test/tck/DelayQueueTest.java (file contents):
Revision 1.25 by jsr166, Sun Nov 22 00:17:37 2009 UTC vs.
Revision 1.27 by jsr166, Tue Dec 1 06:03:49 2009 UTC

# Line 522 | Line 522 | public class DelayQueueTest extends JSR1
522          DelayQueue q = populatedQueue(SIZE);
523          for (int i = 0; i < SIZE; ++i) {
524              assertEquals(new PDelay(i), ((PDelay)q.peek()));
525 <            q.poll();
525 >            assertEquals(new PDelay(i), ((PDelay)q.poll()));
526              if (q.isEmpty())
527                  assertNull(q.peek());
528              else
529 <                assertTrue(i != ((PDelay)q.peek()).intValue());
529 >                assertFalse(new PDelay(i).equals(q.peek()));
530          }
531          assertNull(q.peek());
532      }
# Line 681 | Line 681 | public class DelayQueueTest extends JSR1
681       * toArray(null) throws NPE
682       */
683      public void testToArray_BadArg() {
684 +        DelayQueue q = populatedQueue(SIZE);
685          try {
685            DelayQueue q = populatedQueue(SIZE);
686              Object o[] = q.toArray(null);
687              shouldThrow();
688          } catch (NullPointerException success) {}
# Line 692 | Line 692 | public class DelayQueueTest extends JSR1
692       * toArray with incompatible array type throws CCE
693       */
694      public void testToArray1_BadArg() {
695 +        DelayQueue q = populatedQueue(SIZE);
696          try {
697 <            DelayQueue q = populatedQueue(SIZE);
697 <            Object o[] = q.toArray(new String[10] );
697 >            Object o[] = q.toArray(new String[10]);
698              shouldThrow();
699          } catch (ArrayStoreException success) {}
700      }
# Line 750 | Line 750 | public class DelayQueueTest extends JSR1
750          ExecutorService executor = Executors.newFixedThreadPool(2);
751          executor.execute(new CheckedRunnable() {
752              public void realRun() throws InterruptedException {
753 <                threadAssertNull(q.poll());
754 <                threadAssertTrue(null != q.poll(MEDIUM_DELAY_MS, MILLISECONDS));
755 <                threadAssertTrue(q.isEmpty());
753 >                assertNull(q.poll());
754 >                assertTrue(null != q.poll(MEDIUM_DELAY_MS, MILLISECONDS));
755 >                assertTrue(q.isEmpty());
756              }});
757  
758          executor.execute(new CheckedRunnable() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines