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

Comparing jsr166/src/test/tck/ConcurrentHashMapTest.java (file contents):
Revision 1.2 by dl, Sun Sep 7 20:39:11 2003 UTC vs.
Revision 1.3 by dl, Sun Sep 14 20:42:40 2003 UTC

# Line 11 | Line 11 | import java.util.concurrent.*;
11   import java.util.Enumeration;
12   import java.io.*;
13  
14 < public class ConcurrentHashMapTest extends TestCase{
14 > public class ConcurrentHashMapTest extends JSR166TestCase{
15      public static void main(String[] args) {
16          junit.textui.TestRunner.run (suite());  
17      }
# Line 19 | Line 19 | public class ConcurrentHashMapTest exten
19          return new TestSuite(ConcurrentHashMapTest.class);
20      }
21  
22    static final Integer one = new Integer(1);
23    static final Integer two = new Integer(2);
24    static final Integer three = new Integer(3);
25    static final Integer four = new Integer(4);
26    static final Integer five = new Integer(5);
27
22      private static ConcurrentHashMap map5() {  
23          ConcurrentHashMap map = new ConcurrentHashMap(5);
24          assertTrue(map.isEmpty());
# Line 39 | Line 33 | public class ConcurrentHashMapTest exten
33      }
34  
35      /**
36 <     *  Test to verify clear correctly removes all key-element pairs from the map
36 >     *   clear  removes all key-element pairs from the map
37       */
38      public void testClear(){
39          ConcurrentHashMap map = map5();
# Line 48 | Line 42 | public class ConcurrentHashMapTest exten
42      }
43  
44      /**
45 <     *  Test to verify contains gives the appropriate value
45 >     *   contains gives the appropriate value
46       */
47      public void testContains(){
48          ConcurrentHashMap map = map5();
# Line 57 | Line 51 | public class ConcurrentHashMapTest exten
51      }
52      
53      /**
54 <     *  Test to verify containsKey gives the appropriate value
54 >     *   containsKey gives the appropriate value
55       */
56      public void testContainsKey(){
57          ConcurrentHashMap map = map5();
# Line 89 | Line 83 | public class ConcurrentHashMapTest exten
83      }
84  
85      /**
86 <     *  Test to verify get returns the correct element at the given index
86 >     *   get returns the correct element at the given index
87       */
88      public void testGet(){
89          ConcurrentHashMap map = map5();
# Line 97 | Line 91 | public class ConcurrentHashMapTest exten
91      }
92  
93      /**
94 <     *  Test to verify get on a nonexistant key returns null
94 >     *   get on a nonexistant key returns null
95       */
96      public void testGet2(){
97          ConcurrentHashMap empty = new ConcurrentHashMap();
# Line 115 | Line 109 | public class ConcurrentHashMapTest exten
109      }
110  
111      /**
112 <     *  Test to verify keys returns an enumeration containing all the keys from the map
112 >     *   keys returns an enumeration containing all the keys from the map
113       */
114      public void testKeys(){
115          ConcurrentHashMap map = map5();
# Line 129 | Line 123 | public class ConcurrentHashMapTest exten
123      }
124  
125      /**
126 <     *  Test to verify keySet returns a Set containing all the keys
126 >     *   keySet returns a Set containing all the keys
127       */
128      public void testKeySet(){
129          ConcurrentHashMap map = map5();
# Line 170 | Line 164 | public class ConcurrentHashMapTest exten
164      }
165  
166      /**
167 <     *  Test to verify putAll correctly adds all key-value pairs from the given map
167 >     *   putAll  adds all key-value pairs from the given map
168       */
169      public void testPutAll(){
170          ConcurrentHashMap empty = new ConcurrentHashMap();
# Line 185 | Line 179 | public class ConcurrentHashMapTest exten
179      }
180  
181      /**
182 <     *  Test to verify putIfAbsent works when the given key is not present
182 >     *   putIfAbsent works when the given key is not present
183       */
184      public void testPutIfAbsent(){
185          ConcurrentHashMap map = map5();
# Line 194 | Line 188 | public class ConcurrentHashMapTest exten
188      }
189  
190      /**
191 <     *  Test to verify putIfAbsent does not add the pair if the key is already present
191 >     *   putIfAbsent does not add the pair if the key is already present
192       */
193      public void testPutIfAbsent2(){
194          ConcurrentHashMap map = map5();
# Line 202 | Line 196 | public class ConcurrentHashMapTest exten
196      }
197  
198      /**
199 <     *  Test to verify remove removes the correct key-value pair from the map
199 >     *   remove removes the correct key-value pair from the map
200       */
201      public void testRemove(){
202          ConcurrentHashMap map = map5();
# Line 223 | Line 217 | public class ConcurrentHashMapTest exten
217      }
218  
219      /**
220 <     *  Simple test to verify size returns the correct values
220 >     *   size returns the correct values
221       */
222      public void testSize(){
223          ConcurrentHashMap map = map5();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines