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

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

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

revision 1.16, Sun Nov 22 18:57:17 2009 UTC revision 1.21, Wed Nov 3 07:54:52 2010 UTC
# Line 353  Line 353 
353      }      }
354    
355      /**      /**
356       * toArray with incompatable aray type throws CCE       * toArray(incompatible array type) throws ArrayStoreException
357       */       */
358      public void testToArray1_BadArg() {      public void testToArray1_BadArg() {
359          LinkedList l = new LinkedList();          LinkedList l = new LinkedList();
360          l.add(new Integer(5));          l.add(new Integer(5));
361          try {          try {
362              Object o[] = l.toArray(new String[10]);              l.toArray(new String[10]);
363              shouldThrow();              shouldThrow();
364          } catch (ArrayStoreException success) {}          } catch (ArrayStoreException success) {}
365      }      }
# Line 451  Line 451 
451       */       */
452      public void testDescendingIteratorRemove () {      public void testDescendingIteratorRemove () {
453          final LinkedList q = new LinkedList();          final LinkedList q = new LinkedList();
454          q.add(new Integer(3));          q.add(three);
455          q.add(new Integer(2));          q.add(two);
456          q.add(new Integer(1));          q.add(one);
457          Iterator it = q.descendingIterator();          Iterator it = q.descendingIterator();
458          it.next();          it.next();
459          it.remove();          it.remove();
460          it = q.descendingIterator();          it = q.descendingIterator();
461          assertEquals(it.next(), 2);          assertSame(it.next(), two);
462          assertEquals(it.next(), 3);          assertSame(it.next(), three);
463          assertFalse(it.hasNext());          assertFalse(it.hasNext());
464      }      }
465    
# Line 481  Line 481 
481      public void testAddFirst() {      public void testAddFirst() {
482          LinkedList q = populatedQueue(3);          LinkedList q = populatedQueue(3);
483          q.addFirst(four);          q.addFirst(four);
484          assertEquals(four,q.peek());          assertSame(four, q.peek());
485      }      }
486    
487      /**      /**
# Line 489  Line 489 
489       */       */
490      public void testPush() {      public void testPush() {
491          LinkedList q = populatedQueue(3);          LinkedList q = populatedQueue(3);
         q.pollLast();  
492          q.push(four);          q.push(four);
493          assertEquals(four,q.peekFirst());          assertSame(four, q.peekFirst());
494      }      }
495    
496      /**      /**

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.21

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8