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.66 by jsr166, Wed Dec 31 20:17:39 2014 UTC vs.
Revision 1.67 by jsr166, Fri Jan 2 03:52:53 2015 UTC

# Line 335 | Line 335 | public class DelayQueueTest extends JSR1
335      public void testTake() throws InterruptedException {
336          DelayQueue q = populatedQueue(SIZE);
337          for (int i = 0; i < SIZE; ++i) {
338 <            assertEquals(new PDelay(i), ((PDelay)q.take()));
338 >            assertEquals(new PDelay(i), q.take());
339          }
340      }
341  
# Line 378 | Line 378 | public class DelayQueueTest extends JSR1
378      public void testPoll() {
379          DelayQueue q = populatedQueue(SIZE);
380          for (int i = 0; i < SIZE; ++i) {
381 <            assertEquals(new PDelay(i), ((PDelay)q.poll()));
381 >            assertEquals(new PDelay(i), q.poll());
382          }
383          assertNull(q.poll());
384      }
# Line 389 | Line 389 | public class DelayQueueTest extends JSR1
389      public void testTimedPoll0() throws InterruptedException {
390          DelayQueue q = populatedQueue(SIZE);
391          for (int i = 0; i < SIZE; ++i) {
392 <            assertEquals(new PDelay(i), ((PDelay)q.poll(0, MILLISECONDS)));
392 >            assertEquals(new PDelay(i), q.poll(0, MILLISECONDS));
393          }
394          assertNull(q.poll(0, MILLISECONDS));
395      }
# Line 401 | Line 401 | public class DelayQueueTest extends JSR1
401          DelayQueue q = populatedQueue(SIZE);
402          for (int i = 0; i < SIZE; ++i) {
403              long startTime = System.nanoTime();
404 <            assertEquals(new PDelay(i), ((PDelay)q.poll(LONG_DELAY_MS, MILLISECONDS)));
404 >            assertEquals(new PDelay(i), q.poll(LONG_DELAY_MS, MILLISECONDS));
405              assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
406          }
407          long startTime = System.nanoTime();
# Line 450 | Line 450 | public class DelayQueueTest extends JSR1
450      public void testPeek() {
451          DelayQueue q = populatedQueue(SIZE);
452          for (int i = 0; i < SIZE; ++i) {
453 <            assertEquals(new PDelay(i), ((PDelay)q.peek()));
454 <            assertEquals(new PDelay(i), ((PDelay)q.poll()));
453 >            assertEquals(new PDelay(i), q.peek());
454 >            assertEquals(new PDelay(i), q.poll());
455              if (q.isEmpty())
456                  assertNull(q.peek());
457              else
# Line 466 | Line 466 | public class DelayQueueTest extends JSR1
466      public void testElement() {
467          DelayQueue q = populatedQueue(SIZE);
468          for (int i = 0; i < SIZE; ++i) {
469 <            assertEquals(new PDelay(i), ((PDelay)q.element()));
469 >            assertEquals(new PDelay(i), q.element());
470              q.poll();
471          }
472          try {
# Line 481 | Line 481 | public class DelayQueueTest extends JSR1
481      public void testRemove() {
482          DelayQueue q = populatedQueue(SIZE);
483          for (int i = 0; i < SIZE; ++i) {
484 <            assertEquals(new PDelay(i), ((PDelay)q.remove()));
484 >            assertEquals(new PDelay(i), q.remove());
485          }
486          try {
487              q.remove();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines