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

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

# Line 435 | Line 435 | public class TreeSubMapTest extends JSR1
435      /**
436       * A deserialized map equals original
437       */
438 <    public void testSerialization() {
438 >    public void testSerialization() throws Exception {
439          NavigableMap q = map5();
440  
441 <        try {
442 <            ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
443 <            ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
444 <            out.writeObject(q);
445 <            out.close();
446 <
447 <            ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
448 <            ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
449 <            NavigableMap r = (NavigableMap)in.readObject();
450 <            assertFalse(r.isEmpty());
451 <            assertEquals(q.size(), r.size());
452 <            assertTrue(q.equals(r));
453 <            assertTrue(r.equals(q));
454 <        } catch (Exception e) {
455 <            e.printStackTrace();
456 <            unexpectedException();
457 <        }
441 >        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
442 >        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
443 >        out.writeObject(q);
444 >        out.close();
445 >
446 >        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
447 >        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
448 >        NavigableMap r = (NavigableMap)in.readObject();
449 >        assertFalse(r.isEmpty());
450 >        assertEquals(q.size(), r.size());
451 >        assertTrue(q.equals(r));
452 >        assertTrue(r.equals(q));
453      }
454  
455  
# Line 985 | Line 980 | public class TreeSubMapTest extends JSR1
980      /**
981       * A deserialized map equals original
982       */
983 <    public void testDescendingSerialization() {
983 >    public void testDescendingSerialization() throws Exception {
984          NavigableMap q = dmap5();
985  
986 <        try {
987 <            ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
988 <            ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
989 <            out.writeObject(q);
990 <            out.close();
991 <
992 <            ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
993 <            ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
994 <            NavigableMap r = (NavigableMap)in.readObject();
995 <            assertEquals(q.size(), r.size());
996 <            assertTrue(q.equals(r));
1002 <            assertTrue(r.equals(q));
1003 <        } catch (Exception e) {
1004 <            e.printStackTrace();
1005 <            unexpectedException();
1006 <        }
986 >        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
987 >        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
988 >        out.writeObject(q);
989 >        out.close();
990 >
991 >        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
992 >        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
993 >        NavigableMap r = (NavigableMap)in.readObject();
994 >        assertEquals(q.size(), r.size());
995 >        assertTrue(q.equals(r));
996 >        assertTrue(r.equals(q));
997      }
998  
999  
1010
1000      /**
1001       * subMap returns map with keys in requested range
1002       */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines