Class AbstractMultimapTester<K,V,M extends Multimap<K,V>>

java.lang.Object
junit.framework.Assert
junit.framework.TestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractListMultimapTester, MultimapAsMapGetTester, MultimapAsMapTester, MultimapClearTester, MultimapContainsEntryTester, MultimapContainsKeyTester, MultimapContainsValueTester, MultimapEntriesTester, MultimapEqualsTester, MultimapForEachTester, MultimapGetTester, MultimapKeySetTester, MultimapKeysTester, MultimapPutAllMultimapTester, MultimapPutIterableTester, MultimapPutTester, MultimapRemoveAllTester, MultimapRemoveEntryTester, MultimapReplaceValuesTester, MultimapSizeTester, MultimapToStringTester, MultimapValuesTester, SetMultimapAsMapTester, SetMultimapEqualsTester, SetMultimapPutAllTester, SetMultimapPutTester, SetMultimapReplaceValuesTester, SortedSetMultimapAsMapTester, SortedSetMultimapGetTester

public abstract class AbstractMultimapTester<K,V,M extends Multimap<K,V>> extends AbstractContainerTester<M,Map.Entry<K,V>>
Superclass for all Multimap testers.
  • Field Details

  • Constructor Details

    • AbstractMultimapTester

      public AbstractMultimapTester()
  • Method Details

    • 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()
    • getEntryNullReplaces

      private Map.Entry<K,V> getEntryNullReplaces()
    • 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 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 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:
    • assertGet

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

      protected void assertGet(K key, Collection<? extends V> values)
    • 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()