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

Comparing jsr166/src/test/tck/LinkedListTest.java (file contents):
Revision 1.9 by dl, Wed Sep 14 23:50:31 2005 UTC vs.
Revision 1.10 by jsr166, Mon Nov 2 20:28:31 2009 UTC

# Line 2 | Line 2
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4   * http://creativecommons.org/licenses/publicdomain
5 < * Other contributors include Andrew Wright, Jeffrey Hayes,
6 < * Pat Fisher, Mike Judd.
5 > * Other contributors include Andrew Wright, Jeffrey Hayes,
6 > * Pat Fisher, Mike Judd.
7   */
8  
9   import junit.framework.*;
# Line 12 | Line 12 | import java.util.concurrent.*;
12  
13   public class LinkedListTest extends JSR166TestCase {
14      public static void main(String[] args) {
15 <        junit.textui.TestRunner.run (suite());  
15 >        junit.textui.TestRunner.run (suite());
16      }
17  
18      public static Test suite() {
# Line 32 | Line 32 | public class LinkedListTest extends JSR1
32          assertEquals(n, q.size());
33          return q;
34      }
35 <
35 >
36      /**
37       * new queue is empty
38       */
# Line 103 | Line 103 | public class LinkedListTest extends JSR1
103          try {
104              LinkedList q = new LinkedList();
105              q.offer(null);
106 <        } catch (NullPointerException ie) {
106 >        } catch (NullPointerException ie) {
107              unexpectedException();
108 <        }  
108 >        }
109      }
110  
111      /**
112 <     * Offer succeeds
112 >     * Offer succeeds
113       */
114      public void testOffer() {
115          LinkedList q = new LinkedList();
# Line 239 | Line 239 | public class LinkedListTest extends JSR1
239              q.remove();
240              shouldThrow();
241          } catch (NoSuchElementException success){
242 <        }  
242 >        }
243      }
244  
245      /**
# Line 256 | Line 256 | public class LinkedListTest extends JSR1
256          }
257          assertTrue(q.isEmpty());
258      }
259 <        
259 >
260      /**
261       * contains(x) reports true when elements added but not yet removed
262       */
# Line 378 | Line 378 | public class LinkedListTest extends JSR1
378              shouldThrow();
379          } catch(ArrayStoreException  success){}
380      }
381 <    
381 >
382      /**
383       *  iterator iterates through all elements
384       */
# Line 490 | Line 490 | public class LinkedListTest extends JSR1
490          for (int i = 0; i < SIZE; ++i) {
491              assertTrue(s.indexOf(String.valueOf(i)) >= 0);
492          }
493 <    }        
493 >    }
494  
495      /**
496       * peek returns element inserted with addFirst
# Line 499 | Line 499 | public class LinkedListTest extends JSR1
499          LinkedList q = populatedQueue(3);
500          q.addFirst(four);
501          assertEquals(four,q.peek());
502 <    }  
502 >    }
503  
504      /**
505       * peekFirst returns element inserted with push
# Line 509 | Line 509 | public class LinkedListTest extends JSR1
509          q.pollLast();
510          q.push(four);
511          assertEquals(four,q.peekFirst());
512 <    }  
512 >    }
513  
514      /**
515       *  pop removes next element, or throws NSEE if empty
# Line 523 | Line 523 | public class LinkedListTest extends JSR1
523              q.pop();
524              shouldThrow();
525          } catch (NoSuchElementException success){
526 <        }  
526 >        }
527      }
528  
529      /**
530 <     * OfferFirst succeeds
530 >     * OfferFirst succeeds
531       */
532      public void testOfferFirst() {
533          LinkedList q = new LinkedList();
# Line 536 | Line 536 | public class LinkedListTest extends JSR1
536      }
537  
538      /**
539 <     * OfferLast succeeds
539 >     * OfferLast succeeds
540       */
541      public void testOfferLast() {
542          LinkedList q = new LinkedList();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines