Class AbstractMultimapTester<K,V,M extends Multimap<K,V>>
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- com.google.common.collect.testing.AbstractTester<OneSizeTestContainerGenerator<C,E>>
-
- com.google.common.collect.testing.AbstractContainerTester<M,java.util.Map.Entry<K,V>>
-
- com.google.common.collect.testing.google.AbstractMultimapTester<K,V,M>
-
- All Implemented Interfaces:
junit.framework.Test
- Direct Known Subclasses:
AbstractListMultimapTester,MultimapAsMapGetTester,MultimapAsMapTester,MultimapClearTester,MultimapContainsEntryTester,MultimapContainsKeyTester,MultimapContainsValueTester,MultimapEntriesTester,MultimapEqualsTester,MultimapGetTester,MultimapKeySetTester,MultimapKeysTester,MultimapPutAllMultimapTester,MultimapPutIterableTester,MultimapPutTester,MultimapRemoveAllTester,MultimapRemoveEntryTester,MultimapReplaceValuesTester,MultimapSizeTester,MultimapToStringTester,MultimapValuesTester,SetMultimapAsMapTester,SetMultimapEqualsTester,SetMultimapPutAllTester,SetMultimapPutTester,SetMultimapReplaceValuesTester,SortedSetMultimapAsMapTester,SortedSetMultimapGetTester
@GwtCompatible public abstract class AbstractMultimapTester<K,V,M extends Multimap<K,V>> extends AbstractContainerTester<M,java.util.Map.Entry<K,V>>
Superclass for allMultimaptesters.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.collect.testing.AbstractContainerTester
AbstractContainerTester.ArrayWithDuplicate<E>
-
-
Field Summary
-
Fields inherited from class com.google.common.collect.testing.AbstractContainerTester
container, samples
-
-
Constructor Summary
Constructors Constructor Description AbstractMultimapTester()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Collection<java.util.Map.Entry<K,V>>actualContents()protected voidassertGet(K key, java.util.Collection<V> values)protected voidassertGet(K key, V... values)protected java.util.Map.Entry<K,V>[]createArrayWithNullKey()protected java.util.Map.Entry<K,V>[]createArrayWithNullKeyAndValue()protected java.util.Map.Entry<K,V>[]createArrayWithNullValue()protected KgetKeyForNullValue()protected VgetValueForNullKey()protected voidinitMultimapWithNullKey()protected voidinitMultimapWithNullKeyAndValue()protected voidinitMultimapWithNullValue()protected Kk0()protected Kk1()protected Kk2()protected Kk3()protected Kk4()protected Mmultimap()protected voidresetCollection()protected Multimap<K,V>resetContainer(java.util.Map.Entry<K,V>... newContents)protected MresetContainer(M newContents)Replaces the existing container under test with a new container.protected SampleElements<K>sampleKeys()protected SampleElements<V>sampleValues()protected Vv0()protected Vv1()protected Vv2()protected Vv3()protected Vv4()-
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
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, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, run, run, runBare, runTest, setName, toString
-
-
-
-
Method Detail
-
multimap
protected M multimap()
-
createArrayWithNullKey
protected java.util.Map.Entry<K,V>[] createArrayWithNullKey()
- Returns:
- an array of the proper size with
nullas the key of the middle element.
-
createArrayWithNullValue
protected java.util.Map.Entry<K,V>[] createArrayWithNullValue()
- Returns:
- an array of the proper size with
nullas the value of the middle element.
-
createArrayWithNullKeyAndValue
protected java.util.Map.Entry<K,V>[] createArrayWithNullKeyAndValue()
- Returns:
- an array of the proper size with
nullas the key and value of the middle element.
-
getValueForNullKey
protected V getValueForNullKey()
-
getKeyForNullValue
protected K getKeyForNullValue()
-
initMultimapWithNullKey
protected void initMultimapWithNullKey()
-
initMultimapWithNullValue
protected void initMultimapWithNullValue()
-
initMultimapWithNullKeyAndValue
protected void initMultimapWithNullKeyAndValue()
-
sampleKeys
protected SampleElements<K> sampleKeys()
-
sampleValues
protected SampleElements<V> sampleValues()
-
actualContents
protected java.util.Collection<java.util.Map.Entry<K,V>> actualContents()
- Specified by:
actualContentsin classAbstractContainerTester<M extends Multimap<K,V>,java.util.Map.Entry<K,V>>- Returns:
- the contents of the container under test, for use by
expectContents(E...)and its friends.
-
resetContainer
protected M resetContainer(M newContents)
Description copied from class:AbstractContainerTesterReplaces the existing container under test with a new container. This is useful when a single test method needs to create multiple containers while retaining the ability to useexpectContents(E...)and other convenience methods. The creation of multiple containers in a single method is discouraged in most cases, but it is vital to the iterator tests.- Overrides:
resetContainerin classAbstractContainerTester<M extends Multimap<K,V>,java.util.Map.Entry<K,V>>- Parameters:
newContents- the new container instance- Returns:
- the new container instance
-
resetCollection
protected void resetCollection()
- See Also:
AbstractContainerTester.resetContainer()
-
k0
protected final K k0()
-
v0
protected final V v0()
-
k1
protected final K k1()
-
v1
protected final V v1()
-
k2
protected final K k2()
-
v2
protected final V v2()
-
k3
protected final K k3()
-
v3
protected final V v3()
-
k4
protected final K k4()
-
v4
protected final V v4()
-
-