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

Comparing jsr166/src/test/tck/ConcurrentSkipListSetTest.java (file contents):
Revision 1.28 by jsr166, Tue Feb 21 02:04:17 2012 UTC vs.
Revision 1.31 by jsr166, Wed Dec 31 19:05:42 2014 UTC

# Line 4 | Line 4
4   * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6  
7 import junit.framework.*;
7   import java.util.Arrays;
8   import java.util.BitSet;
9   import java.util.Collection;
# Line 17 | Line 16 | import java.util.Set;
16   import java.util.SortedSet;
17   import java.util.concurrent.ConcurrentSkipListSet;
18  
19 + import junit.framework.Test;
20 + import junit.framework.TestSuite;
21 +
22   public class ConcurrentSkipListSetTest extends JSR166TestCase {
23      public static void main(String[] args) {
24          junit.textui.TestRunner.run(suite());
# Line 531 | Line 533 | public class ConcurrentSkipListSetTest e
533          NavigableSet x = populatedSet(SIZE);
534          NavigableSet y = serialClone(x);
535  
536 <        assertTrue(x != y);
536 >        assertNotSame(x, y);
537          assertEquals(x.size(), y.size());
538          assertEquals(x, y);
539          assertEquals(y, x);
# Line 685 | Line 687 | public class ConcurrentSkipListSetTest e
687                     0, setSize - 1, true, bs);
688      }
689  
690 +    /**
691 +     * addAll is idempotent
692 +     */
693 +    public void testAddAll_idempotent() throws Exception {
694 +        Set x = populatedSet(SIZE);
695 +        Set y = new ConcurrentSkipListSet(x);
696 +        y.addAll(x);
697 +        assertEquals(x, y);
698 +        assertEquals(y, x);
699 +    }
700 +
701      static NavigableSet<Integer> newSet(Class cl) throws Exception {
702          NavigableSet<Integer> result = (NavigableSet<Integer>) cl.newInstance();
703          assertEquals(0, result.size());

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines