com.google.common.collect.testing.google
Class AbstractMultimapTester<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<Multimap<K,V>,Map.Entry<K,V>>
com.google.common.collect.testing.google.AbstractMultimapTester<K,V>
- All Implemented Interfaces:
- junit.framework.Test
- Direct Known Subclasses:
- MultimapContainsEntryTester, MultimapContainsKeyTester, MultimapContainsValueTester, MultimapGetTester, MultimapPutIterableTester, MultimapPutTester, MultimapRemoveAllTester, MultimapRemoveEntryTester, MultimapSizeTester
@GwtCompatible
public abstract class AbstractMultimapTester<K,V>
- extends AbstractContainerTester<Multimap<K,V>,Map.Entry<K,V>>
Superclass for all Multimap
testers.
- Author:
- Louis Wasserman
Method Summary |
protected Collection<Map.Entry<K,V>> |
actualContents()
|
protected void |
assertGet(K key,
Object... values)
|
protected Map.Entry<K,V>[] |
createArrayWithNullKey()
|
protected Map.Entry<K,V>[] |
createArrayWithNullKeyAndValue()
|
protected Map.Entry<K,V>[] |
createArrayWithNullValue()
|
protected K |
getKeyForNullValue()
|
protected V |
getValueForNullKey()
|
protected void |
initMultimapWithNullKey()
|
protected void |
initMultimapWithNullKeyAndValue()
|
protected void |
initMultimapWithNullValue()
|
protected Multimap<K,V> |
multimap()
|
protected void |
resetCollection()
|
protected Multimap<K,V> |
resetContainer(Map.Entry<K,V>... newContents)
|
protected Multimap<K,V> |
resetContainer(Multimap<K,V> newContents)
Replaces the existing container under test with a new container. |
protected SampleElements<K> |
sampleKeys()
|
protected SampleElements<V> |
sampleValues()
|
Methods inherited from class com.google.common.collect.testing.AbstractContainerTester |
createArrayWithDuplicateElement, createDisjointCollection, createSamplesArray, emptyCollection, expectAdded, expectAdded, expectAdded, expectContents, expectContents, expectMissing, expectUnchanged, getNullLocation, getNumElements, getOrderedElements, getSampleElements, getSampleElements, resetContainer, setUp |
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, run, run, runBare, runTest, setName, toString |
Methods inherited from class junit.framework.Assert |
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, fail, fail, failNotEquals, failNotSame, failSame, format |
AbstractMultimapTester
public AbstractMultimapTester()
multimap
protected Multimap<K,V> multimap()
createArrayWithNullKey
protected Map.Entry<K,V>[] createArrayWithNullKey()
- Returns:
- an array of the proper size with
null
as the key of the
middle element.
createArrayWithNullValue
protected Map.Entry<K,V>[] createArrayWithNullValue()
- Returns:
- an array of the proper size with
null
as the value of the
middle element.
createArrayWithNullKeyAndValue
protected Map.Entry<K,V>[] createArrayWithNullKeyAndValue()
- Returns:
- an array of the proper size with
null
as 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 Collection<Map.Entry<K,V>> actualContents()
- Specified by:
actualContents
in class AbstractContainerTester<Multimap<K,V>,Map.Entry<K,V>>
- Returns:
- the contents of the container under test, for use by
expectContents(E...)
and its friends.
resetContainer
protected Multimap<K,V> resetContainer(Multimap<K,V> newContents)
- Description copied from class:
AbstractContainerTester
- Replaces 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 use
expectContents(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:
resetContainer
in class AbstractContainerTester<Multimap<K,V>,Map.Entry<K,V>>
- Parameters:
newContents
- the new container instance
- Returns:
- the new container instance
resetContainer
protected Multimap<K,V> resetContainer(Map.Entry<K,V>... newContents)
resetCollection
protected void resetCollection()
- See Also:
AbstractContainerTester.resetContainer()
assertGet
protected void assertGet(K key,
Object... values)
Copyright © 2010-2012. All Rights Reserved.