Class CollectionAddTester<E>
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- com.google.common.collect.testing.AbstractTester<OneSizeTestContainerGenerator<C,E>>
-
- com.google.common.collect.testing.AbstractContainerTester<Collection<E>,E>
-
- com.google.common.collect.testing.AbstractCollectionTester<E>
-
- com.google.common.collect.testing.testers.CollectionAddTester<E>
-
- All Implemented Interfaces:
junit.framework.Test
@GwtCompatible(emulated=true) public class CollectionAddTester<E> extends AbstractCollectionTester<E>
A generic JUnit test which testsadd
operations on a collection. Can't be invoked directly; please seeCollectionTestSuiteBuilder
.- Author:
- Chris Povirk, Kevin Bourrillion
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.collect.testing.AbstractContainerTester
AbstractContainerTester.ArrayWithDuplicate<E extends @Nullable Object>
-
-
Field Summary
-
Fields inherited from class com.google.common.collect.testing.AbstractCollectionTester
collection
-
Fields inherited from class com.google.common.collect.testing.AbstractContainerTester
container, samples
-
-
Constructor Summary
Constructors Constructor Description CollectionAddTester()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Method
getAddNullSupportedMethod()
Returns theMethod
instance fortestAdd_nullSupported()
so that tests ofCollections.checkedCollection(java.util.Collection, Class)
can suppress it withFeatureSpecificTestSuiteBuilder.suppressing()
until JDK-6409434 is fixed.static Method
getAddNullUnsupportedMethod()
Returns theMethod
instance fortestAdd_nullSupported()
so that tests ofTreeSet
can suppress it withFeatureSpecificTestSuiteBuilder.suppressing()
until JDK-5045147 is fixed.static Method
getAddUnsupportedNotPresentMethod()
Returns theMethod
instance fortestAdd_unsupportedNotPresent()
so that tests can suppress it withFeatureSpecificTestSuiteBuilder.suppressing()
while we figure out what to do withConcurrentHashMap
support forentrySet().add()
.void
testAdd_nullSupported()
void
testAdd_nullUnsupported()
void
testAdd_supportedNotPresent()
void
testAdd_unsupportedNotPresent()
void
testAdd_unsupportedPresent()
void
testAddConcurrentWithIteration()
-
Methods inherited from class com.google.common.collect.testing.AbstractCollectionTester
actualContents, createArrayWithNullElement, expectNullMissingWhenNullUnsupported, initCollectionWithNullElement, resetCollection, resetContainer
-
Methods inherited from class com.google.common.collect.testing.AbstractContainerTester
createArrayWithDuplicateElement, createDisjointCollection, createOrderedArray, createSamplesArray, e0, e1, e2, e3, e4, emptyCollection, expectAdded, expectAdded, expectAdded, expectContents, expectContents, expectMissing, expectUnchanged, getNullLocation, getNumElements, getOrderedElements, getSampleElements, getSampleElements, resetContainer, setUp
-
Methods inherited from class com.google.common.collect.testing.AbstractTester
assertNull, getName, getSubjectGenerator, getTestMethodName, init, init, tearDown
-
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 Detail
-
CollectionAddTester
public CollectionAddTester()
-
-
Method Detail
-
testAdd_supportedNotPresent
public void testAdd_supportedNotPresent()
-
testAdd_unsupportedNotPresent
public void testAdd_unsupportedNotPresent()
-
testAdd_unsupportedPresent
public void testAdd_unsupportedPresent()
-
testAdd_nullSupported
public void testAdd_nullSupported()
-
testAdd_nullUnsupported
public void testAdd_nullUnsupported()
-
testAddConcurrentWithIteration
public void testAddConcurrentWithIteration()
-
getAddNullSupportedMethod
@GwtIncompatible public static Method getAddNullSupportedMethod()
Returns theMethod
instance fortestAdd_nullSupported()
so that tests ofCollections.checkedCollection(java.util.Collection, Class)
can suppress it withFeatureSpecificTestSuiteBuilder.suppressing()
until JDK-6409434 is fixed. It's unclear whether nulls were to be permitted or forbidden, but presumably the eventual fix will be to permit them, as it seems more likely that code would depend on that behavior than on the other. Thus, we say the bug is in add(), which fails to support null.
-
getAddNullUnsupportedMethod
@GwtIncompatible public static Method getAddNullUnsupportedMethod()
Returns theMethod
instance fortestAdd_nullSupported()
so that tests ofTreeSet
can suppress it withFeatureSpecificTestSuiteBuilder.suppressing()
until JDK-5045147 is fixed.
-
getAddUnsupportedNotPresentMethod
@GwtIncompatible public static Method getAddUnsupportedNotPresentMethod()
Returns theMethod
instance fortestAdd_unsupportedNotPresent()
so that tests can suppress it withFeatureSpecificTestSuiteBuilder.suppressing()
while we figure out what to do withConcurrentHashMap
support forentrySet().add()
.
-
-