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.24 by jsr166, Fri May 27 19:21:27 2011 UTC vs.
Revision 1.25 by jsr166, Tue May 31 16:16:23 2011 UTC

# Line 6 | Line 6
6  
7   import junit.framework.*;
8   import java.util.*;
9 < import java.util.concurrent.*;
10 < import java.io.*;
9 > import java.util.concurrent.ConcurrentSkipListMap;
10  
11   public class ConcurrentSkipListMapTest extends JSR166TestCase {
12      public static void main(String[] args) {
# Line 530 | Line 529 | public class ConcurrentSkipListMapTest e
529          } catch (UnsupportedOperationException success) {}
530      }
531  
533
532      /**
533       * lowerKey returns preceding element
534       */
# Line 794 | Line 792 | public class ConcurrentSkipListMapTest e
792       * A deserialized map equals original
793       */
794      public void testSerialization() throws Exception {
795 <        ConcurrentSkipListMap q = map5();
795 >        NavigableMap x = map5();
796 >        NavigableMap y = serialClone(x);
797  
798 <        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
799 <        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
800 <        out.writeObject(q);
801 <        out.close();
802 <
804 <        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
805 <        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
806 <        ConcurrentSkipListMap r = (ConcurrentSkipListMap)in.readObject();
807 <        assertEquals(q.size(), r.size());
808 <        assertTrue(q.equals(r));
809 <        assertTrue(r.equals(q));
798 >        assertTrue(x != y);
799 >        assertEquals(x.size(), y.size());
800 >        assertEquals(x.toString(), y.toString());
801 >        assertEquals(x, y);
802 >        assertEquals(y, x);
803      }
804  
805      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines