Class ListSubListTester<E>
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
com.google.common.collect.testing.AbstractTester<OneSizeTestContainerGenerator<Collection<E>, E>>
com.google.common.collect.testing.AbstractContainerTester<Collection<E>, E>
com.google.common.collect.testing.AbstractCollectionTester<E>
com.google.common.collect.testing.testers.AbstractListTester<E>
com.google.common.collect.testing.testers.ListSubListTester<E>
- All Implemented Interfaces:
junit.framework.Test
A generic JUnit test which tests
subList() operations on a list. Can't be invoked
directly; please see ListTestSuiteBuilder.- Author:
- Chris Povirk
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractContainerTester
AbstractContainerTester.ArrayWithDuplicate<E>Modifier and TypeClassDescriptionstatic final classAbstractContainerTester.ArrayWithDuplicate<E extends @Nullable Object> -
Field Summary
Fields inherited from class AbstractCollectionTester
collectionFields inherited from class AbstractContainerTester
container, samples -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MethodReturns theMethodinstance fortestSubList_originalListSetAffectsSubListLargeList()so that tests ofCopyOnWriteArrayListcan suppress them withFeatureSpecificTestSuiteBuilder.suppressing()until JDK-6570631 is fixed.static MethodReturns theMethodinstance fortestSubList_originalListSetAffectsSubList()so that tests ofCopyOnWriteArrayListcan suppress them withFeatureSpecificTestSuiteBuilder.suppressing()until JDK-6570631 is fixed.static MethodReturns theMethodinstance fortestSubList_subListRemoveAffectsOriginalLargeList()so that tests ofCopyOnWriteArrayListcan suppress it withFeatureSpecificTestSuiteBuilder.suppressing()until JDK-6570575 is fixed.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidMethods inherited from class AbstractListTester
expectContents, getListModifier and TypeMethodDescriptionprotected voidexpectContents(Collection<E> expectedCollection) Asserts that the collection under test contains exactly the given elements, respecting cardinality but not order.getList()Methods inherited from class AbstractCollectionTester
actualContents, createArrayWithNullElement, expectNullMissingWhenNullUnsupported, initCollectionWithNullElement, resetCollection, resetContainerModifier and TypeMethodDescriptionprotected Collection<E> protected E[]protected voidEquivalent toexpectMissing(null)except that the call tocontains(null)is permitted to throw aNullPointerException.protected voidprotected voidprotected Collection<E> resetContainer(Collection<E> newContents) Replaces the existing container under test with a new container.Methods inherited from class AbstractContainerTester
createArrayWithDuplicateElement, createDisjointCollection, createOrderedArray, createSamplesArray, e0, e1, e2, e3, e4, emptyCollection, expectAdded, expectAdded, expectAdded, expectContents, expectMissing, expectUnchanged, getNullLocation, getNumElements, getOrderedElements, getSampleElements, getSampleElements, resetContainer, setUpModifier and TypeMethodDescriptionprotected AbstractContainerTester.ArrayWithDuplicate<E> protected MinimalCollection<E> protected E[]protected E[]protected final Ee0()protected final Ee1()protected final Ee2()protected final Ee3()protected final Ee4()protected MinimalCollection<E> protected final voidexpectAdded(int index, E... elements) protected final voidexpectAdded(int index, Collection<E> elements) protected final voidexpectAdded(E... elements) Asserts that the collection under test contains exactly the elements it was initialized with plus the given elements, according toAbstractContainerTester.expectContents(java.util.Collection).protected final voidexpectContents(E... elements) protected voidexpectMissing(E... elements) protected voidprotected intprotected intReturns the sample elements as ordered byTestContainerGenerator.order(List).protected Collection<E> protected Collection<E> getSampleElements(int howMany) protected Collection<E> Replaces the existing container under test with a new container created by the subject generator.voidsetUp()Methods inherited from class AbstractTester
assertNull, getName, getSubjectGenerator, getTestMethodName, init, init, tearDownModifier and TypeMethodDescriptionstatic voidassertNull(String message, @Nullable Object object) Asserts that the given object is non-null, with a better failure message thanTestCase.assertNull(String, Object).getName()final StringReturns the name of the test method invoked by this test instance.final voidinit(OneSizeTestContainerGenerator<Collection<E>, E> subjectGenerator, String suiteName) final voidinit(OneSizeTestContainerGenerator<Collection<E>, E> subjectGenerator, String suiteName, @Nullable Runnable setUp, @Nullable Runnable tearDown) voidtearDown()Methods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, run, run, runBare, runTest, setName, toString
-
Constructor Details
-
ListSubListTester
public ListSubListTester()
-
-
Method Details
-
testSubList_startNegative
public void testSubList_startNegative() -
testSubList_endTooLarge
public void testSubList_endTooLarge() -
testSubList_startGreaterThanEnd
public void testSubList_startGreaterThanEnd() -
testSubList_empty
public void testSubList_empty() -
testSubList_entireList
public void testSubList_entireList() -
testSubList_subListRemoveAffectsOriginal
public void testSubList_subListRemoveAffectsOriginal() -
testSubList_subListClearAffectsOriginal
public void testSubList_subListClearAffectsOriginal() -
testSubList_subListAddAffectsOriginal
public void testSubList_subListAddAffectsOriginal() -
testSubList_subListSetAffectsOriginal
public void testSubList_subListSetAffectsOriginal() -
testSubList_originalListSetAffectsSubList
public void testSubList_originalListSetAffectsSubList() -
testSubList_subListRemoveAffectsOriginalLargeList
public void testSubList_subListRemoveAffectsOriginalLargeList() -
testSubList_subListAddAtIndexAffectsOriginalLargeList
public void testSubList_subListAddAtIndexAffectsOriginalLargeList() -
testSubList_subListSetAffectsOriginalLargeList
public void testSubList_subListSetAffectsOriginalLargeList() -
testSubList_originalListSetAffectsSubListLargeList
public void testSubList_originalListSetAffectsSubListLargeList() -
testSubList_ofSubListEmpty
public void testSubList_ofSubListEmpty() -
testSubList_ofSubListNonEmpty
public void testSubList_ofSubListNonEmpty() -
testSubList_size
public void testSubList_size() -
testSubList_isEmpty
public void testSubList_isEmpty() -
testSubList_get
public void testSubList_get() -
testSubList_contains
public void testSubList_contains() -
testSubList_indexOf
public void testSubList_indexOf() -
testSubList_lastIndexOf
public void testSubList_lastIndexOf() -
testReserializeWholeSubList
public void testReserializeWholeSubList() -
testReserializeEmptySubList
public void testReserializeEmptySubList() -
testReserializeSubList
public void testReserializeSubList() -
getSubListOriginalListSetAffectsSubListMethod
Returns theMethodinstance fortestSubList_originalListSetAffectsSubList()so that tests ofCopyOnWriteArrayListcan suppress them withFeatureSpecificTestSuiteBuilder.suppressing()until JDK-6570631 is fixed. -
getSubListOriginalListSetAffectsSubListLargeListMethod
Returns theMethodinstance fortestSubList_originalListSetAffectsSubListLargeList()so that tests ofCopyOnWriteArrayListcan suppress them withFeatureSpecificTestSuiteBuilder.suppressing()until JDK-6570631 is fixed. -
getSubListSubListRemoveAffectsOriginalLargeListMethod
Returns theMethodinstance fortestSubList_subListRemoveAffectsOriginalLargeList()so that tests ofCopyOnWriteArrayListcan suppress it withFeatureSpecificTestSuiteBuilder.suppressing()until JDK-6570575 is fixed.
-