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.36 by dl, Sun Jul 21 22:24:18 2013 UTC vs.
Revision 1.38 by jsr166, Tue Sep 24 17:03:14 2013 UTC

# Line 160 | Line 160 | public class ConcurrentHashMapTest exten
160       * can be inserted and found.
161       */
162      public void testMixedComparable() {
163 <        int size = 10000;
163 >        int size = 1200;        // makes measured test run time -> 35ms
164          ConcurrentHashMap<Object, Object> map =
165              new ConcurrentHashMap<Object, Object>();
166 <        Random rng = new Random(1370014958369218000L);
166 >        Random rng = new Random();
167          for (int i = 0; i < size; i++) {
168              Object x;
169              switch (rng.nextInt(4)) {
# Line 212 | Line 212 | public class ConcurrentHashMapTest exten
212          assertFalse(map2.equals(map1));
213      }
214  
215
215      /**
216 <      * hashCode() equals sum of each key.hashCode ^ value.hashCode
217 <      */
216 >     * hashCode() equals sum of each key.hashCode ^ value.hashCode
217 >     */
218      public void testHashCode() {
219          ConcurrentHashMap<Integer,String> map = map5();
220          int sum = 0;
# Line 525 | Line 524 | public class ConcurrentHashMapTest exten
524          try {
525              new ConcurrentHashMap(-1, .75f);
526              shouldThrow();
527 <        } catch (IllegalArgumentException e) {}        
528 <        
527 >        } catch (IllegalArgumentException e) {}
528 >
529          try {
530              new ConcurrentHashMap(16, -1);
531              shouldThrow();
532 <        } catch (IllegalArgumentException e) {}        
532 >        } catch (IllegalArgumentException e) {}
533      }
534 <    
535 <     /**
536 <      * Constructor (initialCapacity, loadFactor, concurrencyLevel)
537 <      * throws IllegalArgumentException if any argument is negative
538 <      */
534 >
535 >    /**
536 >     * Constructor (initialCapacity, loadFactor, concurrencyLevel)
537 >     * throws IllegalArgumentException if any argument is negative
538 >     */
539      public void testConstructor3() {
540 <         try {
541 <             new ConcurrentHashMap(-1, .75f, 1);
542 <             shouldThrow();
543 <         } catch (IllegalArgumentException e) {}        
544 <
545 <         try {
546 <             new ConcurrentHashMap(16, -1, 1);
547 <             shouldThrow();
548 <         } catch (IllegalArgumentException e) {}
549 <        
550 <         try {
551 <             new ConcurrentHashMap(16, .75f, -1);
552 <             shouldThrow();
553 <         } catch (IllegalArgumentException e) {}
554 <     }
540 >        try {
541 >            new ConcurrentHashMap(-1, .75f, 1);
542 >            shouldThrow();
543 >        } catch (IllegalArgumentException e) {}
544 >
545 >        try {
546 >            new ConcurrentHashMap(16, -1, 1);
547 >            shouldThrow();
548 >        } catch (IllegalArgumentException e) {}
549 >
550 >        try {
551 >            new ConcurrentHashMap(16, .75f, -1);
552 >            shouldThrow();
553 >        } catch (IllegalArgumentException e) {}
554 >    }
555  
556      /**
557       * ConcurrentHashMap(map) throws NullPointerException if the given

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines