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

Comparing jsr166/src/test/tck/ConcurrentLinkedQueueTest.java (file contents):
Revision 1.7 by dl, Mon Dec 29 19:05:40 2003 UTC vs.
Revision 1.8 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 14 | Line 14 | import java.io.*;
14   public class ConcurrentLinkedQueueTest extends JSR166TestCase {
15  
16      public static void main(String[] args) {
17 <        junit.textui.TestRunner.run (suite());  
17 >        junit.textui.TestRunner.run (suite());
18      }
19  
20      public static Test suite() {
# Line 34 | Line 34 | public class ConcurrentLinkedQueueTest e
34          assertEquals(n, q.size());
35          return q;
36      }
37 <
37 >
38      /**
39       * new queue is empty
40       */
# Line 131 | Line 131 | public class ConcurrentLinkedQueueTest e
131              ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
132              q.offer(null);
133              shouldThrow();
134 <        } catch (NullPointerException success) { }  
134 >        } catch (NullPointerException success) { }
135      }
136  
137      /**
# Line 142 | Line 142 | public class ConcurrentLinkedQueueTest e
142              ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
143              q.add(null);
144              shouldThrow();
145 <        } catch (NullPointerException success) { }  
145 >        } catch (NullPointerException success) { }
146      }
147  
148  
# Line 289 | Line 289 | public class ConcurrentLinkedQueueTest e
289              q.remove();
290              shouldThrow();
291          } catch (NoSuchElementException success){
292 <        }  
292 >        }
293      }
294  
295      /**
# Line 306 | Line 306 | public class ConcurrentLinkedQueueTest e
306          }
307          assertTrue(q.isEmpty());
308      }
309 <        
309 >
310      /**
311       * contains(x) reports true when elements added but not yet removed
312       */
# Line 426 | Line 426 | public class ConcurrentLinkedQueueTest e
426              shouldThrow();
427          } catch(ArrayStoreException  success){}
428      }
429 <    
429 >
430      /**
431       *  iterator iterates through all elements
432       */
# Line 508 | Line 508 | public class ConcurrentLinkedQueueTest e
508          for (int i = 0; i < SIZE; ++i) {
509              assertTrue(s.indexOf(String.valueOf(i)) >= 0);
510          }
511 <    }        
511 >    }
512  
513      /**
514       * A deserialized serialized queue has same elements in same order
# Line 525 | Line 525 | public class ConcurrentLinkedQueueTest e
525              ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
526              ConcurrentLinkedQueue r = (ConcurrentLinkedQueue)in.readObject();
527              assertEquals(q.size(), r.size());
528 <            while (!q.isEmpty())
528 >            while (!q.isEmpty())
529                  assertEquals(q.remove(), r.remove());
530          } catch(Exception e){
531              unexpectedException();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines