[cvs] / jsr166 / src / test / tck / ArrayBlockingQueueTest.java Repository:
ViewVC logotype

Diff of /jsr166/src/test/tck/ArrayBlockingQueueTest.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.40, Thu Nov 4 01:04:54 2010 UTC revision 1.41, Fri Nov 5 00:17:22 2010 UTC
# Line 41  Line 41 
41       * Create a queue of given size containing consecutive       * Create a queue of given size containing consecutive
42       * Integers 0 ... n.       * Integers 0 ... n.
43       */       */
44      private ArrayBlockingQueue populatedQueue(int n) {      private ArrayBlockingQueue<Integer> populatedQueue(int n) {
45          ArrayBlockingQueue q = new ArrayBlockingQueue(n);          ArrayBlockingQueue<Integer> q = new ArrayBlockingQueue<Integer>(n);
46          assertTrue(q.isEmpty());          assertTrue(q.isEmpty());
47          for (int i = 0; i < n; i++)          for (int i = 0; i < n; i++)
48              assertTrue(q.offer(new Integer(i)));              assertTrue(q.offer(new Integer(i)));
# Line 620  Line 620 
620       * toArray(a) contains all elements in FIFO order       * toArray(a) contains all elements in FIFO order
621       */       */
622      public void testToArray2() {      public void testToArray2() {
623          ArrayBlockingQueue q = populatedQueue(SIZE);          ArrayBlockingQueue<Integer> q = populatedQueue(SIZE);
624          Integer[] ints = new Integer[SIZE];          Integer[] ints = new Integer[SIZE];
625          assertSame(ints, q.toArray(ints));          Integer[] array = q.toArray(ints);
626            assertSame(ints, array);
627          for (int i = 0; i < ints.length; i++)          for (int i = 0; i < ints.length; i++)
628              assertSame(ints[i], q.poll());              assertSame(ints[i], q.poll());
629      }      }

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.41

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8