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.3 by dl, Wed Apr 19 15:10:54 2006 UTC vs.
Revision 1.4 by dl, Thu Apr 20 20:35:00 2006 UTC

# Line 592 | Line 592 | public class TreeMapTest extends JSR166T
592       */
593      public void testSubMapContents() {
594          TreeMap map = map5();
595 <        NavigableMap sm = map.navigableSubMap(two, true, four, false);
595 >        NavigableMap sm = map.subMap(two, true, four, false);
596          assertEquals(two, sm.firstKey());
597          assertEquals(three, sm.lastKey());
598          assertEquals(2, sm.size());
# Line 630 | Line 630 | public class TreeMapTest extends JSR166T
630  
631      public void testSubMapContents2() {
632          TreeMap map = map5();
633 <        NavigableMap sm = map.navigableSubMap(two, true, three, false);
633 >        NavigableMap sm = map.subMap(two, true, three, false);
634          assertEquals(1, sm.size());
635          assertEquals(two, sm.firstKey());
636          assertEquals(two, sm.lastKey());
# Line 665 | Line 665 | public class TreeMapTest extends JSR166T
665       */
666      public void testHeadMapContents() {
667          TreeMap map = map5();
668 <        NavigableMap sm = map.navigableHeadMap(four, false);
668 >        NavigableMap sm = map.headMap(four, false);
669          assertTrue(sm.containsKey(one));
670          assertTrue(sm.containsKey(two));
671          assertTrue(sm.containsKey(three));
# Line 691 | Line 691 | public class TreeMapTest extends JSR166T
691       */
692      public void testTailMapContents() {
693          TreeMap map = map5();
694 <        NavigableMap sm = map.navigableTailMap(two, true);
694 >        NavigableMap sm = map.tailMap(two, true);
695          assertFalse(sm.containsKey(one));
696          assertTrue(sm.containsKey(two));
697          assertTrue(sm.containsKey(three));
# Line 735 | Line 735 | public class TreeMapTest extends JSR166T
735          assertEquals("E", e.getValue());
736          assertFalse(i.hasNext());
737  
738 <        NavigableMap ssm = sm.navigableTailMap(four, true);
738 >        NavigableMap ssm = sm.tailMap(four, true);
739          assertEquals(four, ssm.firstKey());
740          assertEquals(five, ssm.lastKey());
741          assertTrue(ssm.remove(four) != null);
# Line 764 | Line 764 | public class TreeMapTest extends JSR166T
764          check(map,                 0, mapSize - 1, true);
765          check(map.descendingMap(), 0, mapSize - 1, false);
766  
767 <        bashSubMap(map.navigableSubMap(0, true, mapSize, false),
767 >        bashSubMap(map.subMap(0, true, mapSize, false),
768                     0, mapSize - 1, true);
769      }
770  
# Line 871 | Line 871 | public class TreeMapTest extends JSR166T
871  
872          // headMap - pick direction and endpoint inclusion randomly
873          boolean incl = rnd.nextBoolean();
874 <        NavigableMap<Integer,Integer> hm = map.navigableHeadMap(midPoint, incl);
874 >        NavigableMap<Integer,Integer> hm = map.headMap(midPoint, incl);
875          if (ascending) {
876              if (rnd.nextBoolean())
877                  bashSubMap(hm, min, midPoint - (incl ? 0 : 1), true);
# Line 888 | Line 888 | public class TreeMapTest extends JSR166T
888  
889          // tailMap - pick direction and endpoint inclusion randomly
890          incl = rnd.nextBoolean();
891 <        NavigableMap<Integer,Integer> tm = map.navigableTailMap(midPoint,incl);
891 >        NavigableMap<Integer,Integer> tm = map.tailMap(midPoint,incl);
892          if (ascending) {
893              if (rnd.nextBoolean())
894                  bashSubMap(tm, midPoint + (incl ? 0 : 1), max, true);
# Line 913 | Line 913 | public class TreeMapTest extends JSR166T
913          boolean lowIncl = rnd.nextBoolean();
914          boolean highIncl = rnd.nextBoolean();
915          if (ascending) {
916 <            NavigableMap<Integer,Integer> sm = map.navigableSubMap(
916 >            NavigableMap<Integer,Integer> sm = map.subMap(
917                  endpoints[0], lowIncl, endpoints[1], highIncl);
918              if (rnd.nextBoolean())
919                  bashSubMap(sm, endpoints[0] + (lowIncl ? 0 : 1),
# Line 922 | Line 922 | public class TreeMapTest extends JSR166T
922                  bashSubMap(sm.descendingMap(), endpoints[0] + (lowIncl ? 0 : 1),
923                             endpoints[1] - (highIncl ? 0 : 1), false);
924          } else {
925 <            NavigableMap<Integer,Integer> sm = map.navigableSubMap(
925 >            NavigableMap<Integer,Integer> sm = map.subMap(
926                  endpoints[1], highIncl, endpoints[0], lowIncl);
927              if (rnd.nextBoolean())
928                  bashSubMap(sm, endpoints[0] + (lowIncl ? 0 : 1),

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines