com.google.common.collect.testing.google
Class AbstractMultimapTester<K,V,M extends com.google.common.collect.Multimap<K,V>>

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.google.common.collect.testing.AbstractTester<OneSizeTestContainerGenerator<C,E>>
              extended by com.google.common.collect.testing.AbstractContainerTester<M,Map.Entry<K,V>>
                  extended by com.google.common.collect.testing.google.AbstractMultimapTester<K,V,M>
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractListMultimapTester, MultimapContainsEntryTester, MultimapContainsKeyTester, MultimapContainsValueTester, MultimapGetTester, MultimapPutIterableTester, MultimapPutTester, MultimapRemoveAllTester, MultimapRemoveEntryTester, MultimapReplaceValuesTester, MultimapSizeTester, SetMultimapPutAllTester, SetMultimapPutTester, SetMultimapReplaceValuesTester, SortedSetMultimapGetTester

@GwtCompatible
public abstract class AbstractMultimapTester<K,V,M extends com.google.common.collect.Multimap<K,V>>
extends AbstractContainerTester<M,Map.Entry<K,V>>

Superclass for all Multimap testers.

Author:
Louis Wasserman

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
AbstractMultimapTester()
           
 
Method Summary
protected  Collection<Map.Entry<K,V>> actualContents()
           
protected  void assertGet(K key, Collection<V> values)
           
protected  void assertGet(K key, V... 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  M multimap()
           
protected  void resetCollection()
           
protected  M resetContainer(M newContents)
          Replaces the existing container under test with a new container.
protected  com.google.common.collect.Multimap<K,V> resetContainer(Map.Entry<K,V>... newContents)
           
protected  SampleElements<K> sampleKeys()
           
protected  SampleElements<V> sampleValues()
           
 
Methods inherited from class com.google.common.collect.testing.AbstractContainerTester
createArrayWithDuplicateElement, createDisjointCollection, createOrderedArray, createSamplesArray, 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
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractMultimapTester

public AbstractMultimapTester()
Method Detail

multimap

protected M 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<M extends com.google.common.collect.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 M resetContainer(M 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<M extends com.google.common.collect.Multimap<K,V>,Map.Entry<K,V>>
Parameters:
newContents - the new container instance
Returns:
the new container instance

resetContainer

protected com.google.common.collect.Multimap<K,V> resetContainer(Map.Entry<K,V>... newContents)

resetCollection

protected void resetCollection()
See Also:
AbstractContainerTester.resetContainer()

assertGet

protected void assertGet(K key,
                         V... values)

assertGet

protected void assertGet(K key,
                         Collection<V> values)


Copyright © 2010-2013. All Rights Reserved.