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

# Line 813 | Line 813 | public class ConcurrentSkipListMapTest e
813      /**
814       * A deserialized map equals original
815       */
816 <    public void testSerialization() {
816 >    public void testSerialization() throws Exception {
817          ConcurrentSkipListMap q = map5();
818  
819 <        try {
820 <            ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
821 <            ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
822 <            out.writeObject(q);
823 <            out.close();
819 >        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
820 >        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
821 >        out.writeObject(q);
822 >        out.close();
823  
824 <            ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
825 <            ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
826 <            ConcurrentSkipListMap r = (ConcurrentSkipListMap)in.readObject();
827 <            assertEquals(q.size(), r.size());
828 <            assertTrue(q.equals(r));
829 <            assertTrue(r.equals(q));
831 <        } catch (Exception e) {
832 <            e.printStackTrace();
833 <            unexpectedException();
834 <        }
824 >        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
825 >        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
826 >        ConcurrentSkipListMap r = (ConcurrentSkipListMap)in.readObject();
827 >        assertEquals(q.size(), r.size());
828 >        assertTrue(q.equals(r));
829 >        assertTrue(r.equals(q));
830      }
831  
832  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines