[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.36, Sun Feb 22 04:34:44 2015 UTC revision 1.41, Sun Oct 16 20:44:18 2016 UTC
# Line 17  Line 17 
17    
18  public class LinkedListTest extends JSR166TestCase {  public class LinkedListTest extends JSR166TestCase {
19      public static void main(String[] args) {      public static void main(String[] args) {
20          junit.textui.TestRunner.run(suite());          main(suite(), args);
21      }      }
22    
23      public static Test suite() {      public static Test suite() {
# Line 26  Line 26 
26    
27      /**      /**
28       * Returns a new queue of given size containing consecutive       * Returns a new queue of given size containing consecutive
29       * Integers 0 ... n.       * Integers 0 ... n - 1.
30       */       */
31      private LinkedList<Integer> populatedQueue(int n) {      private LinkedList<Integer> populatedQueue(int n) {
32          LinkedList<Integer> q = new LinkedList<Integer>();          LinkedList<Integer> q = new LinkedList<Integer>();
# Line 35  Line 35 
35              assertTrue(q.offer(new Integer(i)));              assertTrue(q.offer(new Integer(i)));
36          assertFalse(q.isEmpty());          assertFalse(q.isEmpty());
37          assertEquals(n, q.size());          assertEquals(n, q.size());
38            assertEquals((Integer) 0, q.peekFirst());
39            assertEquals((Integer) (n - 1), q.peekLast());
40          return q;          return q;
41      }      }
42    
# Line 102  Line 104 
104      public void testOfferNull() {      public void testOfferNull() {
105          LinkedList q = new LinkedList();          LinkedList q = new LinkedList();
106          q.offer(null);          q.offer(null);
107            assertNull(q.get(0));
108            assertTrue(q.contains(null));
109      }      }
110    
111      /**      /**
# Line 128  Line 132 
132       * addAll(null) throws NPE       * addAll(null) throws NPE
133       */       */
134      public void testAddAll1() {      public void testAddAll1() {
         try {  
135              LinkedList q = new LinkedList();              LinkedList q = new LinkedList();
136            try {
137              q.addAll(null);              q.addAll(null);
138              shouldThrow();              shouldThrow();
139          } catch (NullPointerException success) {}          } catch (NullPointerException success) {}

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

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8