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

Comparing jsr166/src/test/tck/ConcurrentSkipListMapTest.java (file contents):
Revision 1.38 by jsr166, Thu Sep 15 16:43:56 2016 UTC vs.
Revision 1.41 by jsr166, Wed Aug 23 05:33:00 2017 UTC

# Line 18 | Line 18 | import java.util.Set;
18   import java.util.concurrent.ConcurrentSkipListMap;
19  
20   import junit.framework.Test;
21 import junit.framework.TestSuite;
21  
22   public class ConcurrentSkipListMapTest extends JSR166TestCase {
23      public static void main(String[] args) {
24          main(suite(), args);
25      }
26      public static Test suite() {
27 <        return new TestSuite(ConcurrentSkipListMapTest.class);
27 >        class Implementation implements MapImplementation {
28 >            public Class<?> klazz() { return ConcurrentSkipListMap.class; }
29 >            public Map emptyMap() { return new ConcurrentSkipListMap(); }
30 >            public Object makeKey(int i) { return i; }
31 >            public Object makeValue(int i) { return i; }
32 >            public boolean isConcurrent() { return true; }
33 >            public boolean permitsNullKeys() { return false; }
34 >            public boolean permitsNullValues() { return false; }
35 >            public boolean supportsSetValue() { return false; }
36 >        }
37 >        return newTestSuite(
38 >            ConcurrentSkipListMapTest.class,
39 >            MapTest.testSuite(new Implementation()));
40      }
41  
42      /**
# Line 801 | Line 812 | public class ConcurrentSkipListMapTest e
812      }
813  
814      /**
815 <     * A deserialized map equals original
815 >     * A cloned map equals original
816 >     */
817 >    public void testClone() {
818 >        ConcurrentSkipListMap x = map5();
819 >        ConcurrentSkipListMap y = x.clone();
820 >
821 >        assertNotSame(x, y);
822 >        assertEquals(x.size(), y.size());
823 >        assertEquals(x.toString(), y.toString());
824 >        assertEquals(x, y);
825 >        assertEquals(y, x);
826 >        y.clear();
827 >        assertTrue(y.isEmpty());
828 >        assertFalse(x.equals(y));
829 >    }
830 >
831 >    /**
832 >     * A deserialized/reserialized map equals original
833       */
834      public void testSerialization() throws Exception {
835          NavigableMap x = map5();
# Line 812 | Line 840 | public class ConcurrentSkipListMapTest e
840          assertEquals(x.toString(), y.toString());
841          assertEquals(x, y);
842          assertEquals(y, x);
843 +        y.clear();
844 +        assertTrue(y.isEmpty());
845 +        assertFalse(x.equals(y));
846      }
847  
848      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines