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

Comparing jsr166/src/test/tck/TreeMapTest.java (file contents):
Revision 1.9 by jsr166, Sat Nov 21 02:07:27 2009 UTC vs.
Revision 1.10 by jsr166, Sat Nov 21 10:25:05 2009 UTC

# Line 610 | Line 610 | public class TreeMapTest extends JSR166T
610      /**
611       * A deserialized map equals original
612       */
613 <    public void testSerialization() {
613 >    public void testSerialization() throws Exception {
614          TreeMap q = map5();
615  
616 <        try {
617 <            ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
618 <            ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
619 <            out.writeObject(q);
620 <            out.close();
616 >        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
617 >        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
618 >        out.writeObject(q);
619 >        out.close();
620  
621 <            ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
622 <            ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
623 <            TreeMap r = (TreeMap)in.readObject();
624 <            assertEquals(q.size(), r.size());
625 <            assertTrue(q.equals(r));
626 <            assertTrue(r.equals(q));
628 <        } catch (Exception e) {
629 <            e.printStackTrace();
630 <            unexpectedException();
631 <        }
621 >        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
622 >        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
623 >        TreeMap r = (TreeMap)in.readObject();
624 >        assertEquals(q.size(), r.size());
625 >        assertTrue(q.equals(r));
626 >        assertTrue(r.equals(q));
627      }
628  
629      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines