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.19 by jsr166, Tue Feb 21 02:04:17 2012 UTC vs.
Revision 1.23 by jsr166, Sat Apr 25 04:55:31 2015 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.ArrayList;
8 > import java.util.Arrays;
9 > import java.util.Collection;
10 > import java.util.Iterator;
11 > import java.util.Map;
12 > import java.util.NavigableMap;
13 > import java.util.Set;
14 > import java.util.SortedMap;
15 > import java.util.TreeMap;
16 >
17 > import junit.framework.Test;
18 > import junit.framework.TestSuite;
19  
20   public class TreeSubMapTest extends JSR166TestCase {
21      public static void main(String[] args) {
22 <        junit.textui.TestRunner.run(suite());
22 >        main(suite(), args);
23      }
24      public static Test suite() {
25          return new TestSuite(TreeSubMapTest.class);
# Line 382 | Line 392 | public class TreeSubMapTest extends JSR1
392       * get(null) of nonempty map throws NPE
393       */
394      public void testGet_NullPointerException() {
395 +        NavigableMap c = map5();
396          try {
386            NavigableMap c = map5();
397              c.get(null);
398              shouldThrow();
399          } catch (NullPointerException success) {}
# Line 393 | Line 403 | public class TreeSubMapTest extends JSR1
403       * containsKey(null) of nonempty map throws NPE
404       */
405      public void testContainsKey_NullPointerException() {
406 +        NavigableMap c = map5();
407          try {
397            NavigableMap c = map5();
408              c.containsKey(null);
409              shouldThrow();
410          } catch (NullPointerException success) {}
# Line 404 | Line 414 | public class TreeSubMapTest extends JSR1
414       * put(null,x) throws NPE
415       */
416      public void testPut1_NullPointerException() {
417 +        NavigableMap c = map5();
418          try {
408            NavigableMap c = map5();
419              c.put(null, "whatever");
420              shouldThrow();
421          } catch (NullPointerException success) {}
# Line 415 | Line 425 | public class TreeSubMapTest extends JSR1
425       * remove(null) throws NPE
426       */
427      public void testRemove1_NullPointerException() {
428 +        NavigableMap c = map5();
429          try {
419            NavigableMap c = map5();
430              c.remove(null);
431              shouldThrow();
432          } catch (NullPointerException success) {}
# Line 429 | Line 439 | public class TreeSubMapTest extends JSR1
439          NavigableMap x = map5();
440          NavigableMap y = serialClone(x);
441  
442 <        assertTrue(x != y);
442 >        assertNotSame(x, y);
443          assertEquals(x.size(), y.size());
444          assertEquals(x.toString(), y.toString());
445          assertEquals(x, y);
# Line 931 | Line 941 | public class TreeSubMapTest extends JSR1
941       * get(null) of nonempty map throws NPE
942       */
943      public void testDescendingGet_NullPointerException() {
944 +        NavigableMap c = dmap5();
945          try {
935            NavigableMap c = dmap5();
946              c.get(null);
947              shouldThrow();
948          } catch (NullPointerException success) {}
# Line 942 | Line 952 | public class TreeSubMapTest extends JSR1
952       * put(null,x) throws NPE
953       */
954      public void testDescendingPut1_NullPointerException() {
955 +        NavigableMap c = dmap5();
956          try {
946            NavigableMap c = dmap5();
957              c.put(null, "whatever");
958              shouldThrow();
959          } catch (NullPointerException success) {}
# Line 956 | Line 966 | public class TreeSubMapTest extends JSR1
966          NavigableMap x = dmap5();
967          NavigableMap y = serialClone(x);
968  
969 <        assertTrue(x != y);
969 >        assertNotSame(x, y);
970          assertEquals(x.size(), y.size());
971          assertEquals(x.toString(), y.toString());
972          assertEquals(x, y);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines