test/java/util/concurrent/tck/ConcurrentHashMapTest.java

Print this page
rev 16851 : 8176402: parameter name switcharoo in ConcurrentHashMap
Reviewed-by: martin, chegar


  26  * However, the following notice accompanied the original version of this
  27  * file:
  28  *
  29  * Written by Doug Lea with assistance from members of JCP JSR-166
  30  * Expert Group and released to the public domain, as explained at
  31  * http://creativecommons.org/publicdomain/zero/1.0/
  32  * Other contributors include Andrew Wright, Jeffrey Hayes,
  33  * Pat Fisher, Mike Judd.
  34  */
  35 
  36 import java.util.ArrayList;
  37 import java.util.Arrays;
  38 import java.util.Collection;
  39 import java.util.Collections;
  40 import java.util.Enumeration;
  41 import java.util.Iterator;
  42 import java.util.Map;
  43 import java.util.Random;
  44 import java.util.Set;
  45 import java.util.concurrent.ConcurrentHashMap;
  46 import java.util.concurrent.ExecutorService;
  47 import java.util.concurrent.Executors;
  48 
  49 import junit.framework.Test;
  50 import junit.framework.TestSuite;
  51 
  52 public class ConcurrentHashMapTest extends JSR166TestCase {
  53     public static void main(String[] args) {
  54         main(suite(), args);
  55     }
  56     public static Test suite() {
  57         return new TestSuite(ConcurrentHashMapTest.class);
  58     }
  59 
  60     /**
  61      * Returns a new map from Integers 1-5 to Strings "A"-"E".
  62      */
  63     private static ConcurrentHashMap<Integer, String> map5() {
  64         ConcurrentHashMap<Integer, String> map = new ConcurrentHashMap<>(5);
  65         assertTrue(map.isEmpty());
  66         map.put(one, "A");
  67         map.put(two, "B");




  26  * However, the following notice accompanied the original version of this
  27  * file:
  28  *
  29  * Written by Doug Lea with assistance from members of JCP JSR-166
  30  * Expert Group and released to the public domain, as explained at
  31  * http://creativecommons.org/publicdomain/zero/1.0/
  32  * Other contributors include Andrew Wright, Jeffrey Hayes,
  33  * Pat Fisher, Mike Judd.
  34  */
  35 
  36 import java.util.ArrayList;
  37 import java.util.Arrays;
  38 import java.util.Collection;
  39 import java.util.Collections;
  40 import java.util.Enumeration;
  41 import java.util.Iterator;
  42 import java.util.Map;
  43 import java.util.Random;
  44 import java.util.Set;
  45 import java.util.concurrent.ConcurrentHashMap;


  46 
  47 import junit.framework.Test;
  48 import junit.framework.TestSuite;
  49 
  50 public class ConcurrentHashMapTest extends JSR166TestCase {
  51     public static void main(String[] args) {
  52         main(suite(), args);
  53     }
  54     public static Test suite() {
  55         return new TestSuite(ConcurrentHashMapTest.class);
  56     }
  57 
  58     /**
  59      * Returns a new map from Integers 1-5 to Strings "A"-"E".
  60      */
  61     private static ConcurrentHashMap<Integer, String> map5() {
  62         ConcurrentHashMap<Integer, String> map = new ConcurrentHashMap<>(5);
  63         assertTrue(map.isEmpty());
  64         map.put(one, "A");
  65         map.put(two, "B");