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.33 by jsr166, Thu Oct 28 17:57:26 2010 UTC vs.
Revision 1.37 by jsr166, Thu Nov 4 01:04:54 2010 UTC

# Line 400 | Line 400 | public class PriorityBlockingQueueTest e
400      }
401  
402      /**
403 <     * timed pool with zero timeout succeeds when non-empty, else times out
403 >     * timed poll with zero timeout succeeds when non-empty, else times out
404       */
405      public void testTimedPoll0() throws InterruptedException {
406          PriorityBlockingQueue q = populatedQueue(SIZE);
# Line 411 | Line 411 | public class PriorityBlockingQueueTest e
411      }
412  
413      /**
414 <     * timed pool with nonzero timeout succeeds when non-empty, else times out
414 >     * timed poll with nonzero timeout succeeds when non-empty, else times out
415       */
416      public void testTimedPoll() throws InterruptedException {
417          PriorityBlockingQueue q = populatedQueue(SIZE);
# Line 586 | Line 586 | public class PriorityBlockingQueueTest e
586          Object[] o = q.toArray();
587          Arrays.sort(o);
588          for (int i = 0; i < o.length; i++)
589 <            assertEquals(o[i], q.take());
589 >            assertSame(o[i], q.take());
590      }
591  
592      /**
# Line 595 | Line 595 | public class PriorityBlockingQueueTest e
595      public void testToArray2() throws InterruptedException {
596          PriorityBlockingQueue q = populatedQueue(SIZE);
597          Integer[] ints = new Integer[SIZE];
598 <        ints = (Integer[])q.toArray(ints);
598 >        assertSame(ints, q.toArray(ints));
599          Arrays.sort(ints);
600          for (int i = 0; i < ints.length; i++)
601 <            assertEquals(ints[i], q.take());
601 >            assertSame(ints[i], q.take());
602      }
603  
604      /**
605 <     * toArray(null) throws NPE
605 >     * toArray(null) throws NullPointerException
606       */
607 <    public void testToArray_BadArg() {
607 >    public void testToArray_NullArg() {
608          PriorityBlockingQueue q = populatedQueue(SIZE);
609          try {
610 <            Object o[] = q.toArray(null);
610 >            q.toArray(null);
611              shouldThrow();
612          } catch (NullPointerException success) {}
613      }
614  
615      /**
616 <     * toArray with incompatible array type throws CCE
616 >     * toArray(incompatible array type) throws ArrayStoreException
617       */
618      public void testToArray1_BadArg() {
619          PriorityBlockingQueue q = populatedQueue(SIZE);
620          try {
621 <            Object o[] = q.toArray(new String[10]);
621 >            q.toArray(new String[10]);
622              shouldThrow();
623          } catch (ArrayStoreException success) {}
624      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines