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.17 by jsr166, Sat Nov 21 02:07:26 2009 UTC vs.
Revision 1.18 by jsr166, Sat Nov 21 10:25:05 2009 UTC

# Line 559 | Line 559 | public class ConcurrentHashMapTest exten
559      /**
560       * A deserialized map equals original
561       */
562 <    public void testSerialization() {
562 >    public void testSerialization() throws Exception {
563          ConcurrentHashMap q = map5();
564  
565 <        try {
566 <            ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
567 <            ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
568 <            out.writeObject(q);
569 <            out.close();
565 >        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
566 >        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
567 >        out.writeObject(q);
568 >        out.close();
569  
570 <            ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
571 <            ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
572 <            ConcurrentHashMap r = (ConcurrentHashMap)in.readObject();
573 <            assertEquals(q.size(), r.size());
574 <            assertTrue(q.equals(r));
575 <            assertTrue(r.equals(q));
577 <        } catch (Exception e) {
578 <            e.printStackTrace();
579 <            unexpectedException();
580 <        }
570 >        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
571 >        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
572 >        ConcurrentHashMap r = (ConcurrentHashMap)in.readObject();
573 >        assertEquals(q.size(), r.size());
574 >        assertTrue(q.equals(r));
575 >        assertTrue(r.equals(q));
576      }
577  
578  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines