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.22 by jsr166, Sat Nov 26 05:19:17 2011 UTC vs.
Revision 1.29 by jsr166, Wed Dec 31 21:45:16 2014 UTC

# Line 4 | Line 4
4   * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6  
7 < import junit.framework.*;
8 < import java.util.*;
7 > import java.util.Arrays;
8 > import java.util.BitSet;
9 > import java.util.Collection;
10 > import java.util.Iterator;
11 > import java.util.Map;
12 > import java.util.NavigableMap;
13 > import java.util.NavigableSet;
14 > import java.util.NoSuchElementException;
15 > import java.util.Random;
16 > import java.util.Set;
17 > import java.util.TreeMap;
18 >
19 > import junit.framework.Test;
20 > import junit.framework.TestSuite;
21  
22   public class TreeMapTest extends JSR166TestCase {
23      public static void main(String[] args) {
# Line 16 | Line 28 | public class TreeMapTest extends JSR166T
28      }
29  
30      /**
31 <     * Create a map from Integers 1-5 to Strings "A"-"E".
31 >     * Returns a new map from Integers 1-5 to Strings "A"-"E".
32       */
33      private static TreeMap map5() {
34          TreeMap map = new TreeMap();
# Line 41 | Line 53 | public class TreeMapTest extends JSR166T
53      }
54  
55      /**
56 <     *
56 >     * copy constructor creates map equal to source map
57       */
58      public void testConstructFromSorted() {
59          TreeMap map = map5();
# Line 600 | Line 612 | public class TreeMapTest extends JSR166T
612          NavigableMap x = map5();
613          NavigableMap y = serialClone(x);
614  
615 <        assertTrue(x != y);
615 >        assertNotSame(x, y);
616          assertEquals(x.size(), y.size());
617          assertEquals(x.toString(), y.toString());
618          assertEquals(x, y);
# Line 823 | Line 835 | public class TreeMapTest extends JSR166T
835          // Add entries till we're back to original size
836          while (map.size() < size) {
837              int key = min + rnd.nextInt(rangeSize);
838 <            assertTrue(key >= min && key<= max);
838 >            assertTrue(key >= min && key <= max);
839              put(map, key);
840          }
841      }
# Line 848 | Line 860 | public class TreeMapTest extends JSR166T
860          // Add entries till we're back to original size
861          while (map.size() < size) {
862              int key = min - 5 + rnd.nextInt(rangeSize + 10);
863 <            if (key >= min && key<= max) {
863 >            if (key >= min && key <= max) {
864                  put(map, key);
865              } else {
866                  try {
# Line 1018 | Line 1030 | public class TreeMapTest extends JSR166T
1030              if (bsContainsI)
1031                  size++;
1032          }
1033 <        assertEquals(map.size(), size);
1033 >        assertEquals(size, map.size());
1034  
1035          // Test contents using contains keySet iterator
1036          int size2 = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines