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.20 by jsr166, Fri May 27 19:10:32 2011 UTC vs.
Revision 1.21 by jsr166, Tue May 31 16:16:24 2011 UTC

# Line 6 | Line 6
6  
7   import junit.framework.*;
8   import java.util.*;
9 import java.util.concurrent.*;
10 import java.io.*;
9  
10   public class TreeMapTest extends JSR166TestCase {
11      public static void main(String[] args) {
# Line 119 | Line 117 | public class TreeMapTest extends JSR166T
117          assertEquals(five, map.lastKey());
118      }
119  
122
120      /**
121       * keySet.toArray returns contains all keys
122       */
# Line 413 | Line 410 | public class TreeMapTest extends JSR166T
410          assertNull(e4);
411      }
412  
416
413      /**
414       * lowerKey returns preceding element
415       */
# Line 601 | Line 597 | public class TreeMapTest extends JSR166T
597       * A deserialized map equals original
598       */
599      public void testSerialization() throws Exception {
600 <        TreeMap q = map5();
600 >        NavigableMap x = map5();
601 >        NavigableMap y = serialClone(x);
602  
603 <        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
604 <        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
605 <        out.writeObject(q);
606 <        out.close();
607 <
611 <        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
612 <        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
613 <        TreeMap r = (TreeMap)in.readObject();
614 <        assertEquals(q.size(), r.size());
615 <        assertTrue(q.equals(r));
616 <        assertTrue(r.equals(q));
603 >        assertTrue(x != y);
604 >        assertEquals(x.size(), y.size());
605 >        assertEquals(x.toString(), y.toString());
606 >        assertEquals(x, y);
607 >        assertEquals(y, x);
608      }
609  
610      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines