aboutsummaryrefslogtreecommitdiff
path: root/guava-testlib/src/com/google/common/collect/testing/testers/ListListIteratorTester.java
diff options
context:
space:
mode:
Diffstat (limited to 'guava-testlib/src/com/google/common/collect/testing/testers/ListListIteratorTester.java')
-rw-r--r--guava-testlib/src/com/google/common/collect/testing/testers/ListListIteratorTester.java53
1 files changed, 30 insertions, 23 deletions
diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/ListListIteratorTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/ListListIteratorTester.java
index 0d4b13e68..589273d3e 100644
--- a/guava-testlib/src/com/google/common/collect/testing/testers/ListListIteratorTester.java
+++ b/guava-testlib/src/com/google/common/collect/testing/testers/ListListIteratorTester.java
@@ -31,23 +31,25 @@ import com.google.common.collect.testing.IteratorFeature;
import com.google.common.collect.testing.ListIteratorTester;
import com.google.common.collect.testing.features.CollectionFeature;
import com.google.common.collect.testing.features.ListFeature;
+
import java.lang.reflect.Method;
import java.util.List;
import java.util.ListIterator;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
-import org.junit.Ignore;
/**
- * A generic JUnit test which tests {@code listIterator} operations on a list. Can't be invoked
- * directly; please see {@link com.google.common.collect.testing.ListTestSuiteBuilder}.
+ * A generic JUnit test which tests {@code listIterator} operations on a list.
+ * Can't be invoked directly; please see
+ * {@link com.google.common.collect.testing.ListTestSuiteBuilder}.
*
* @author Chris Povirk
* @author Kevin Bourrillion
*/
@GwtCompatible(emulated = true)
-@Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
public class ListListIteratorTester<E> extends AbstractListTester<E> {
+ // TODO: switch to DerivedIteratorTestSuiteBuilder
+
@CollectionFeature.Require(absent = SUPPORTS_REMOVE)
@ListFeature.Require(absent = {SUPPORTS_SET, SUPPORTS_ADD_WITH_INDEX})
public void testListIterator_unmodifiable() {
@@ -66,19 +68,19 @@ public class ListListIteratorTester<E> extends AbstractListTester<E> {
private void runListIteratorTest(Set<IteratorFeature> features) {
new ListIteratorTester<E>(
- listListIteratorTesterNumIterations(),
- singleton(e4()),
- features,
- Helpers.copyToList(getOrderedElements()),
- 0) {
- @Override
- protected ListIterator<E> newTargetIterator() {
+ listListIteratorTesterNumIterations(), singleton(samples.e4), features,
+ Helpers.copyToList(getOrderedElements()), 0) {
+ {
+ // TODO: don't set this universally
+ stopTestingWhenAddThrowsException();
+ }
+
+ @Override protected ListIterator<E> newTargetIterator() {
resetCollection();
return getList().listIterator();
}
- @Override
- protected void verify(List<E> elements) {
+ @Override protected void verify(List<E> elements) {
expectContents(elements);
}
}.test();
@@ -106,22 +108,27 @@ public class ListListIteratorTester<E> extends AbstractListTester<E> {
}
/**
- * Returns the {@link Method} instance for {@link #testListIterator_fullyModifiable()} so that
- * tests of {@link CopyOnWriteArraySet} can suppress it with {@code
- * FeatureSpecificTestSuiteBuilder.suppressing()} until <a
- * href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6570575">Sun bug 6570575</a> is fixed.
+ * Returns the {@link Method} instance for
+ * {@link #testListIterator_fullyModifiable()} so that tests of
+ * {@link CopyOnWriteArraySet} can suppress it with
+ * {@code FeatureSpecificTestSuiteBuilder.suppressing()} until <a
+ * href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6570575">Sun bug
+ * 6570575</a> is fixed.
*/
- @GwtIncompatible // reflection
+ @GwtIncompatible("reflection")
public static Method getListIteratorFullyModifiableMethod() {
- return Helpers.getMethod(ListListIteratorTester.class, "testListIterator_fullyModifiable");
+ return Helpers.getMethod(
+ ListListIteratorTester.class, "testListIterator_fullyModifiable");
}
/**
- * Returns the {@link Method} instance for {@link #testListIterator_unmodifiable()} so that it can
- * be suppressed in GWT tests.
+ * Returns the {@link Method} instance for
+ * {@link #testListIterator_unmodifiable()} so that it can be suppressed in
+ * GWT tests.
*/
- @GwtIncompatible // reflection
+ @GwtIncompatible("reflection")
public static Method getListIteratorUnmodifiableMethod() {
- return Helpers.getMethod(ListListIteratorTester.class, "testListIterator_unmodifiable");
+ return Helpers.getMethod(
+ ListListIteratorTester.class, "testListIterator_unmodifiable");
}
}