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.47 by jsr166, Mon Jul 27 03:12:26 2015 UTC vs.
Revision 1.48 by jsr166, Sun Jul 17 03:40:07 2016 UTC

# Line 803 | Line 803 | public class ConcurrentHashMapTest exten
803          }
804      }
805  
806 +    /**
807 +     * Tests performance of removeAll when the other collection is much smaller.
808 +     * ant -Djsr166.tckTestClass=ConcurrentHashMapTest -Djsr166.methodFilter=testRemoveAll_performance -Djsr166.expensiveTests=true tck
809 +     */
810 +    public void testRemoveAll_performance() {
811 +        int mapSize = expensiveTests ? 1_000_000 : 100;
812 +        int iterations = expensiveTests ? 500 : 2;
813 +        ConcurrentHashMap<Integer, Integer> map = new ConcurrentHashMap<>();
814 +        for (int i = 0; i < mapSize; i++)
815 +            map.put(i, i);
816 +        Set<Integer> keySet = map.keySet();
817 +        Collection<Integer> removeMe = Arrays.asList(new Integer[] { -99, -86 });
818 +        for (int i = 0; i < iterations; i++)
819 +            assertFalse(keySet.removeAll(removeMe));
820 +        assertEquals(mapSize, map.size());
821 +    }
822   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines