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

Comparing jsr166/src/test/tck/ConcurrentHashMapTest.java (file contents):
Revision 1.24 by jsr166, Fri May 27 19:26:42 2011 UTC vs.
Revision 1.25 by jsr166, Tue May 31 16:16:23 2011 UTC

# Line 8 | Line 8
8  
9   import junit.framework.*;
10   import java.util.*;
11 < import java.util.concurrent.*;
12 < import java.util.Enumeration;
13 < import java.io.*;
11 > import java.util.concurrent.ConcurrentHashMap;
12  
13   public class ConcurrentHashMapTest extends JSR166TestCase {
14      public static void main(String[] args) {
# Line 551 | Line 549 | public class ConcurrentHashMapTest exten
549       * A deserialized map equals original
550       */
551      public void testSerialization() throws Exception {
552 <        ConcurrentHashMap q = map5();
552 >        Map x = map5();
553 >        Map y = serialClone(x);
554  
555 <        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
556 <        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
557 <        out.writeObject(q);
558 <        out.close();
560 <
561 <        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
562 <        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
563 <        ConcurrentHashMap r = (ConcurrentHashMap)in.readObject();
564 <        assertEquals(q.size(), r.size());
565 <        assertTrue(q.equals(r));
566 <        assertTrue(r.equals(q));
555 >        assertTrue(x != y);
556 >        assertEquals(x.size(), y.size());
557 >        assertEquals(x, y);
558 >        assertEquals(y, x);
559      }
560  
561      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines