Class AbstractMapTester<K,​V>

    • Constructor Detail

      • AbstractMapTester

        public AbstractMapTester()
    • Method Detail

      • getMap

        protected java.util.Map<K,​V> getMap()
      • setUp

        public void setUp()
                   throws java.lang.Exception
        Overrides:
        setUp in class AbstractContainerTester<java.util.Map<K,​V>,​java.util.Map.Entry<K,​V>>
        Throws:
        java.lang.Exception
      • expectMissingKeys

        protected void expectMissingKeys​(K... elements)
      • expectMissingValues

        protected void expectMissingValues​(V... elements)
      • createArrayWithNullKey

        protected java.util.Map.Entry<K,​V>[] createArrayWithNullKey()
        Returns:
        an array of the proper size with null as the key of the middle element.
      • getValueForNullKey

        protected V getValueForNullKey()
      • getKeyForNullValue

        protected K getKeyForNullValue()
      • createArrayWithNullValue

        protected java.util.Map.Entry<K,​V>[] createArrayWithNullValue()
        Returns:
        an array of the proper size with null as the value of the middle element.
      • initMapWithNullKey

        protected void initMapWithNullKey()
      • initMapWithNullValue

        protected void initMapWithNullValue()
      • expectNullKeyMissingWhenNullKeysUnsupported

        protected void expectNullKeyMissingWhenNullKeysUnsupported​(java.lang.String message)
        Equivalent to expectMissingKeys (null) except that the call to contains(null) is permitted to throw a NullPointerException.
        Parameters:
        message - message to use upon assertion failure
      • expectNullValueMissingWhenNullValuesUnsupported

        protected void expectNullValueMissingWhenNullValuesUnsupported​(java.lang.String message)
        Equivalent to expectMissingValues (null) except that the call to contains(null) is permitted to throw a NullPointerException.
        Parameters:
        message - message to use upon assertion failure
      • getNumEntries

        protected int getNumEntries()
      • getSampleEntries

        protected java.util.Collection<java.util.Map.Entry<K,​V>> getSampleEntries​(int howMany)
      • getSampleEntries

        protected java.util.Collection<java.util.Map.Entry<K,​V>> getSampleEntries()
      • entry

        protected java.util.Map.Entry<K,​V> entry​(K key,
                                                       V value)
      • expectContents

        protected void expectContents​(java.util.Collection<java.util.Map.Entry<K,​V>> expected)
        Description copied from class: AbstractContainerTester
        Asserts that the collection under test contains exactly the given elements, respecting cardinality but not order. Subclasses may override this method to provide stronger assertions, e.g., to check ordering in lists, but realize that unless a test extends AbstractListTester, a call to expectContents() invokes this version.
        Overrides:
        expectContents in class AbstractContainerTester<java.util.Map<K,​V>,​java.util.Map.Entry<K,​V>>
        Parameters:
        expected - expected value of AbstractContainerTester.container
      • expectReplacement

        protected final void expectReplacement​(java.util.Map.Entry<K,​V> newEntry)
      • get

        protected V get​(K key)
        Wrapper for Map.get(Object) that forces the caller to pass in a key of the same type as the map. Besides being slightly shorter than code that uses getMap(), it also ensures that callers don't pass an Map.Entry by mistake.
      • resetMap

        protected void resetMap​(java.util.Map.Entry<K,​V>[] entries)
      • 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()