aboutsummaryrefslogtreecommitdiffstats
path: root/guava-testlib/src/com/google/common/collect/testing/testers/MapPutTester.java
diff options
context:
space:
mode:
Diffstat (limited to 'guava-testlib/src/com/google/common/collect/testing/testers/MapPutTester.java')
-rw-r--r--guava-testlib/src/com/google/common/collect/testing/testers/MapPutTester.java60
1 files changed, 0 insertions, 60 deletions
diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/MapPutTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/MapPutTester.java
index 7c242d5..69b57ca 100644
--- a/guava-testlib/src/com/google/common/collect/testing/testers/MapPutTester.java
+++ b/guava-testlib/src/com/google/common/collect/testing/testers/MapPutTester.java
@@ -19,19 +19,12 @@ package com.google.common.collect.testing.testers;
import static com.google.common.collect.testing.features.CollectionSize.ZERO;
import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_KEYS;
import static com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_VALUES;
-import static com.google.common.collect.testing.features.MapFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION;
import static com.google.common.collect.testing.features.MapFeature.SUPPORTS_PUT;
-import com.google.common.annotations.GwtCompatible;
-import com.google.common.annotations.GwtIncompatible;
import com.google.common.collect.testing.AbstractMapTester;
-import com.google.common.collect.testing.Helpers;
import com.google.common.collect.testing.features.CollectionSize;
import com.google.common.collect.testing.features.MapFeature;
-import java.lang.reflect.Method;
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
@@ -46,7 +39,6 @@ import java.util.Map.Entry;
* @author Kevin Bourrillion
*/
@SuppressWarnings("unchecked") // too many "unchecked generic array creations"
-@GwtCompatible(emulated = true)
public class MapPutTester<K, V> extends AbstractMapTester<K, V> {
private Entry<K, V> nullKeyEntry;
private Entry<K, V> nullValueEntry;
@@ -67,45 +59,6 @@ public class MapPutTester<K, V> extends AbstractMapTester<K, V> {
expectAdded(samples.e3);
}
- @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_PUT})
- @CollectionSize.Require(absent = ZERO)
- public void testPutAbsentConcurrentWithEntrySetIteration() {
- try {
- Iterator<Entry<K, V>> iterator = getMap().entrySet().iterator();
- put(samples.e3);
- iterator.next();
- fail("Expected ConcurrentModificationException");
- } catch (ConcurrentModificationException expected) {
- // success
- }
- }
-
- @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_PUT})
- @CollectionSize.Require(absent = ZERO)
- public void testPutAbsentConcurrentWithKeySetIteration() {
- try {
- Iterator<K> iterator = getMap().keySet().iterator();
- put(samples.e3);
- iterator.next();
- fail("Expected ConcurrentModificationException");
- } catch (ConcurrentModificationException expected) {
- // success
- }
- }
-
- @MapFeature.Require({FAILS_FAST_ON_CONCURRENT_MODIFICATION, SUPPORTS_PUT})
- @CollectionSize.Require(absent = ZERO)
- public void testPutAbsentConcurrentWithValueIteration() {
- try {
- Iterator<V> iterator = getMap().values().iterator();
- put(samples.e3);
- iterator.next();
- fail("Expected ConcurrentModificationException");
- } catch (ConcurrentModificationException expected) {
- // success
- }
- }
-
@MapFeature.Require(absent = SUPPORTS_PUT)
public void testPut_unsupportedNotPresent() {
try {
@@ -240,17 +193,4 @@ public class MapPutTester<K, V> extends AbstractMapTester<K, V> {
private V put(Map.Entry<K, V> entry) {
return getMap().put(entry.getKey(), entry.getValue());
}
-
- /**
- * Returns the {@link Method} instance for {@link
- * #testPut_nullKeyUnsupported()} so that tests of {@link java.util.TreeMap}
- * can suppress it with {@code FeatureSpecificTestSuiteBuilder.suppressing()}
- * until <a
- * href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5045147">Sun bug
- * 5045147</a> is fixed.
- */
- @GwtIncompatible("reflection")
- public static Method getPutNullKeyUnsupportedMethod() {
- return Helpers.getMethod(MapPutTester.class, "testPut_nullKeyUnsupported");
- }
}