ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/EntryTest.java
(Generate patch)

Comparing jsr166/src/test/tck/EntryTest.java (file contents):
Revision 1.5 by jsr166, Wed Aug 25 00:07:03 2010 UTC vs.
Revision 1.12 by jsr166, Sat Apr 25 04:55:30 2015 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6  
7 < import junit.framework.*;
8 < import java.util.*;
9 < import java.util.concurrent.*;
10 < import java.io.*;
7 > import java.util.AbstractMap;
8 > import java.util.Map;
9 >
10 > import junit.framework.Test;
11 > import junit.framework.TestSuite;
12  
13   public class EntryTest extends JSR166TestCase {
14      public static void main(String[] args) {
15 <        junit.textui.TestRunner.run(suite());
15 >        main(suite(), args);
16      }
17      public static Test suite() {
18          return new TestSuite(EntryTest.class);
# Line 22 | Line 23 | public class EntryTest extends JSR166Tes
23      static final String k2 = "2";
24      static final String v2 = "b";
25  
25
26      /**
27       * A new SimpleEntry(k, v) holds k, v.
28       */
# Line 41 | Line 41 | public class EntryTest extends JSR166Tes
41          assertEquals(v1, s.getValue());
42      }
43  
44
44      /**
45       * A new SimpleEntry(entry(k, v)) holds k, v.
46       */
# Line 87 | Line 86 | public class EntryTest extends JSR166Tes
86      public void testNotEquals() {
87          Map.Entry e2 = new AbstractMap.SimpleEntry(k1, v1);
88          Map.Entry e = new AbstractMap.SimpleEntry(k2, v1);
89 <        assertFalse(e2.equals( e));
89 >        assertFalse(e2.equals(e));
90          e = new AbstractMap.SimpleEntry(k1, v2);
91 <        assertFalse(e2.equals( e));
91 >        assertFalse(e2.equals(e));
92          e = new AbstractMap.SimpleEntry(k2, v2);
93 <        assertFalse(e2.equals( e));
93 >        assertFalse(e2.equals(e));
94  
95          Map.Entry s2 = new AbstractMap.SimpleImmutableEntry(k1, v1);
96          Map.Entry s = new AbstractMap.SimpleImmutableEntry(k2, v1);
97 <        assertFalse(s2.equals( s));
97 >        assertFalse(s2.equals(s));
98          s = new AbstractMap.SimpleImmutableEntry(k1, v2);
99 <        assertFalse(s2.equals( s));
99 >        assertFalse(s2.equals(s));
100          s = new AbstractMap.SimpleImmutableEntry(k2, v2);
101 <        assertFalse(s2.equals( s));
101 >        assertFalse(s2.equals(s));
102      }
103  
105
104      /**
105       * getValue returns last setValue for SimpleEntry
106       */
# Line 113 | Line 111 | public class EntryTest extends JSR166Tes
111          assertEquals(v1, e.getValue());
112          e.setValue(k2);
113          assertEquals(k2, e.getValue());
114 <        assertFalse(e2.equals( e));
114 >        assertFalse(e2.equals(e));
115      }
116  
117      /**
118       * setValue for SimpleImmutableEntry throws UnsupportedOperationException
119       */
120 <    public void testsetValue2() {
120 >    public void testSetValue2() {
121          Map.Entry s2 = new AbstractMap.SimpleImmutableEntry(k1, v1);
122          Map.Entry s = new AbstractMap.SimpleImmutableEntry(s2);
123          assertEquals(k1, s.getKey());

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines