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

Comparing jsr166/src/test/tck/ConcurrentLinkedDequeTest.java (file contents):
Revision 1.1 by jsr166, Wed Aug 25 21:40:03 2010 UTC vs.
Revision 1.4 by jsr166, Thu Nov 4 01:04:54 2010 UTC

# Line 635 | Line 635 | public class ConcurrentLinkedDequeTest e
635      }
636  
637      /**
638 <     * toArray() contains all elements
638 >     * toArray() contains all elements in FIFO order
639       */
640      public void testToArray() {
641          ConcurrentLinkedDeque q = populatedDeque(SIZE);
642          Object[] o = q.toArray();
643        Arrays.sort(o);
643          for (int i = 0; i < o.length; i++)
644 <            assertEquals(o[i], q.poll());
644 >            assertSame(o[i], q.poll());
645      }
646  
647      /**
648 <     * toArray(a) contains all elements
648 >     * toArray(a) contains all elements in FIFO order
649       */
650      public void testToArray2() {
651          ConcurrentLinkedDeque q = populatedDeque(SIZE);
652          Integer[] ints = new Integer[SIZE];
653 <        ints = (Integer[])q.toArray(ints);
655 <        Arrays.sort(ints);
653 >        assertSame(ints, q.toArray(ints));
654          for (int i = 0; i < ints.length; i++)
655 <            assertEquals(ints[i], q.poll());
655 >            assertSame(ints[i], q.poll());
656      }
657  
658      /**
659 <     * toArray(null) throws NPE
659 >     * toArray(null) throws NullPointerException
660       */
661 <    public void testToArray_BadArg() {
661 >    public void testToArray_NullArg() {
662          ConcurrentLinkedDeque q = populatedDeque(SIZE);
663          try {
664 <            Object o[] = q.toArray(null);
664 >            q.toArray(null);
665              shouldThrow();
666          } catch (NullPointerException success) {}
667      }
668  
669      /**
670 <     * toArray() with incompatible array type throws ArrayStoreException
670 >     * toArray(incompatible array type) throws ArrayStoreException
671       */
672      public void testToArray1_BadArg() {
673          ConcurrentLinkedDeque q = populatedDeque(SIZE);
674          try {
675 <            Object o[] = q.toArray(new String[10]);
675 >            q.toArray(new String[10]);
676              shouldThrow();
677          } catch (ArrayStoreException success) {}
678      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines