diff options
Diffstat (limited to 'guava-testlib/src/com/google/common/collect/testing/google/AbstractMultisetSetCountTester.java')
-rw-r--r-- | guava-testlib/src/com/google/common/collect/testing/google/AbstractMultisetSetCountTester.java | 65 |
1 files changed, 2 insertions, 63 deletions
diff --git a/guava-testlib/src/com/google/common/collect/testing/google/AbstractMultisetSetCountTester.java b/guava-testlib/src/com/google/common/collect/testing/google/AbstractMultisetSetCountTester.java index 55749b2..9219e3e 100644 --- a/guava-testlib/src/com/google/common/collect/testing/google/AbstractMultisetSetCountTester.java +++ b/guava-testlib/src/com/google/common/collect/testing/google/AbstractMultisetSetCountTester.java @@ -17,7 +17,6 @@ package com.google.common.collect.testing.google; import static com.google.common.collect.testing.features.CollectionFeature.ALLOWS_NULL_VALUES; -import static com.google.common.collect.testing.features.CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION; import static com.google.common.collect.testing.features.CollectionFeature.RESTRICTS_ELEMENTS; import static com.google.common.collect.testing.features.CollectionFeature.SUPPORTS_ADD; import static com.google.common.collect.testing.features.CollectionFeature.SUPPORTS_REMOVE; @@ -25,17 +24,12 @@ import static com.google.common.collect.testing.features.CollectionSize.SEVERAL; import static com.google.common.collect.testing.features.CollectionSize.ZERO; import com.google.common.annotations.GwtCompatible; -import com.google.common.annotations.GwtIncompatible; import com.google.common.collect.Multiset; -import com.google.common.collect.Multiset.Entry; -import com.google.common.collect.testing.Helpers; import com.google.common.collect.testing.features.CollectionFeature; import com.google.common.collect.testing.features.CollectionSize; import java.lang.reflect.Method; import java.util.Arrays; -import java.util.ConcurrentModificationException; -import java.util.Iterator; import java.util.List; /** @@ -47,7 +41,7 @@ import java.util.List; * * @author Chris Povirk */ -@GwtCompatible(emulated = true) +@GwtCompatible public abstract class AbstractMultisetSetCountTester<E> extends AbstractMultisetTester<E> { /* @@ -191,32 +185,6 @@ public abstract class AbstractMultisetSetCountTester<E> assertSetCount(samples.e3, 1); } - @CollectionFeature.Require({SUPPORTS_ADD, - FAILS_FAST_ON_CONCURRENT_MODIFICATION}) - public void testSetCountZeroToOneConcurrentWithIteration() { - try { - Iterator<E> iterator = collection.iterator(); - assertSetCount(samples.e3, 1); - iterator.next(); - fail("Expected ConcurrentModificationException"); - } catch (ConcurrentModificationException expected) { - // success - } - } - - @CollectionFeature.Require({SUPPORTS_ADD, - FAILS_FAST_ON_CONCURRENT_MODIFICATION}) - public void testSetCountZeroToOneConcurrentWithEntrySetIteration() { - try { - Iterator<Entry<E>> iterator = getMultiset().entrySet().iterator(); - assertSetCount(samples.e3, 1); - iterator.next(); - fail("Expected ConcurrentModificationException"); - } catch (ConcurrentModificationException expected) { - // success - } - } - @CollectionFeature.Require(SUPPORTS_ADD) public void testSetCount_zeroToThree_supported() { assertSetCount(samples.e3, 3); @@ -252,33 +220,6 @@ public abstract class AbstractMultisetSetCountTester<E> assertSetCount(samples.e0, 0); } - @CollectionFeature.Require({SUPPORTS_REMOVE, - FAILS_FAST_ON_CONCURRENT_MODIFICATION}) - @CollectionSize.Require(absent = ZERO) - public void testSetCountOneToZeroConcurrentWithIteration() { - try { - Iterator<E> iterator = collection.iterator(); - assertSetCount(samples.e0, 0); - iterator.next(); - fail("Expected ConcurrentModificationException"); - } catch (ConcurrentModificationException expected) { - // success - } - } - - @CollectionFeature.Require({SUPPORTS_REMOVE, - FAILS_FAST_ON_CONCURRENT_MODIFICATION}) - public void testSetCountOneToZeroConcurrentWithEntrySetIteration() { - try { - Iterator<Entry<E>> iterator = getMultiset().entrySet().iterator(); - assertSetCount(samples.e0, 0); - iterator.next(); - fail("Expected ConcurrentModificationException"); - } catch (ConcurrentModificationException expected) { - // success - } - } - @CollectionSize.Require(SEVERAL) @CollectionFeature.Require(SUPPORTS_REMOVE) public void testSetCount_threeToZero_supported() { @@ -394,7 +335,6 @@ public abstract class AbstractMultisetSetCountTester<E> * assume multisets support duplicates so that the test of {@code * Multisets.forSet()} can suppress them. */ - @GwtIncompatible("reflection") public static List<Method> getSetCountDuplicateInitializingMethods() { return Arrays.asList( getMethod("testSetCount_threeToThree_removeSupported"), @@ -402,8 +342,7 @@ public abstract class AbstractMultisetSetCountTester<E> getMethod("testSetCount_threeToOne_supported")); } - @GwtIncompatible("reflection") private static Method getMethod(String methodName) { - return Helpers.getMethod(AbstractMultisetSetCountTester.class, methodName); + return Platform.getMethod(AbstractMultisetSetCountTester.class, methodName); } } |