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.3 by dl, Thu Apr 20 20:35:00 2006 UTC vs.
Revision 1.4 by jsr166, Mon Nov 2 20:28:32 2009 UTC

# Line 11 | Line 11 | import java.io.*;
11  
12   public class TreeSubMapTest extends JSR166TestCase {
13      public static void main(String[] args) {
14 <        junit.textui.TestRunner.run (suite());  
14 >        junit.textui.TestRunner.run (suite());
15      }
16      public static Test suite() {
17          return new TestSuite(TreeSubMapTest.class);
# Line 20 | Line 20 | public class TreeSubMapTest extends JSR1
20      /**
21       * Create a map from Integers 1-5 to Strings "A"-"E".
22       */
23 <    private static NavigableMap map5() {  
23 >    private static NavigableMap map5() {
24          TreeMap map = new TreeMap();
25          assertTrue(map.isEmpty());
26          map.put(zero, "Z");
# Line 35 | Line 35 | public class TreeSubMapTest extends JSR1
35          return map.subMap(one, true, seven, false);
36      }
37  
38 <    private static NavigableMap map0() {  
38 >    private static NavigableMap map0() {
39          TreeMap map = new TreeMap();
40          assertTrue(map.isEmpty());
41          return map.tailMap(one, true);
# Line 44 | Line 44 | public class TreeSubMapTest extends JSR1
44      /**
45       * Create a map from Integers -5 to -1 to Strings "A"-"E".
46       */
47 <    private static NavigableMap dmap5() {  
47 >    private static NavigableMap dmap5() {
48          TreeMap map = new TreeMap();
49          assertTrue(map.isEmpty());
50          map.put(m1, "A");
# Line 57 | Line 57 | public class TreeSubMapTest extends JSR1
57          return map.descendingMap();
58      }
59  
60 <    private static NavigableMap dmap0() {  
60 >    private static NavigableMap dmap0() {
61          TreeMap map = new TreeMap();
62          assertTrue(map.isEmpty());
63          return map;
# Line 196 | Line 196 | public class TreeSubMapTest extends JSR1
196          Iterator it = s.iterator();
197          while (it.hasNext()) {
198              Map.Entry e = (Map.Entry) it.next();
199 <            assertTrue(
199 >            assertTrue(
200                         (e.getKey().equals(one) && e.getValue().equals("A")) ||
201                         (e.getKey().equals(two) && e.getValue().equals("B")) ||
202                         (e.getKey().equals(three) && e.getValue().equals("C")) ||
# Line 384 | Line 384 | public class TreeSubMapTest extends JSR1
384          for (int i = 1; i <= 5; ++i) {
385              assertTrue(s.indexOf(String.valueOf(i)) >= 0);
386          }
387 <    }        
387 >    }
388  
389      // Exception tests
390  
# Line 770 | Line 770 | public class TreeSubMapTest extends JSR1
770          Iterator it = s.iterator();
771          while (it.hasNext()) {
772              Map.Entry e = (Map.Entry) it.next();
773 <            assertTrue(
773 >            assertTrue(
774                         (e.getKey().equals(m1) && e.getValue().equals("A")) ||
775                         (e.getKey().equals(m2) && e.getValue().equals("B")) ||
776                         (e.getKey().equals(m3) && e.getValue().equals("C")) ||
# Line 956 | Line 956 | public class TreeSubMapTest extends JSR1
956          for (int i = 1; i <= 5; ++i) {
957              assertTrue(s.indexOf(String.valueOf(i)) >= 0);
958          }
959 <    }        
959 >    }
960  
961      // Exception testDescendings
962  
# Line 987 | Line 987 | public class TreeSubMapTest extends JSR1
987       */
988      public void testDescendingSerialization() {
989          NavigableMap q = dmap5();
990 <        
990 >
991          try {
992              ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
993              ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
# Line 1142 | Line 1142 | public class TreeSubMapTest extends JSR1
1142          assertEquals(3, sm.size());
1143          assertEquals(4, map.size());
1144      }
1145 <    
1145 >
1146   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines