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.47 by jsr166, Sat Mar 18 20:42:20 2017 UTC vs.
Revision 1.49 by jsr166, Sun Jan 7 22:59:18 2018 UTC

# Line 38 | Line 38 | public class ConcurrentSkipListSetTest e
38       * Integers 0 ... n - 1.
39       */
40      private static ConcurrentSkipListSet<Integer> populatedSet(int n) {
41 <        ConcurrentSkipListSet<Integer> q =
42 <            new ConcurrentSkipListSet<Integer>();
41 >        ConcurrentSkipListSet<Integer> q = new ConcurrentSkipListSet<>();
42          assertTrue(q.isEmpty());
43          for (int i = n - 1; i >= 0; i -= 2)
44              assertTrue(q.add(new Integer(i)));
# Line 526 | Line 525 | public class ConcurrentSkipListSetTest e
525      }
526  
527      /**
528 <     * A deserialized serialized set has same elements
528 >     * A cloned set equals original
529 >     */
530 >    public void testClone() {
531 >        ConcurrentSkipListSet x = populatedSet(SIZE);
532 >        ConcurrentSkipListSet y = x.clone();
533 >
534 >        assertNotSame(x, y);
535 >        assertEquals(x.size(), y.size());
536 >        assertEquals(x, y);
537 >        assertEquals(y, x);
538 >        while (!x.isEmpty()) {
539 >            assertFalse(y.isEmpty());
540 >            assertEquals(x.pollFirst(), y.pollFirst());
541 >        }
542 >        assertTrue(y.isEmpty());
543 >    }
544 >
545 >    /**
546 >     * A deserialized/reserialized set equals original
547       */
548      public void testSerialization() throws Exception {
549          NavigableSet x = populatedSet(SIZE);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines