K - the key type of the map to be tested.V - the value type of the map to be tested.@GwtCompatible public abstract class AbstractMapTester<K,V> extends AbstractContainerTester<Map<K,V>,Map.Entry<K,V>>
AbstractContainerTester.ArrayWithDuplicate<E>container, samples| Constructor and Description |
|---|
AbstractMapTester() |
| Modifier and Type | Method and Description |
|---|---|
protected Collection<Map.Entry<K,V>> |
actualContents() |
protected Map.Entry<K,V>[] |
createArrayWithNullKey() |
protected Map.Entry<K,V>[] |
createArrayWithNullValue() |
protected MinimalCollection<Map.Entry<K,V>> |
createDisjointCollection() |
protected Map.Entry<K,V> |
entry(K key,
V value) |
protected void |
expectContents(Collection<Map.Entry<K,V>> expected)
Asserts that the collection under test contains exactly the given elements,
respecting cardinality but not order.
|
protected void |
expectMissing(Map.Entry<K,V>... entries) |
protected void |
expectMissingKeys(K... elements) |
protected void |
expectMissingValues(V... elements) |
protected void |
expectNullKeyMissingWhenNullKeysUnsupported(String message)
Equivalent to
expectMissingKeys
(null)
except that the call to contains(null) is permitted to throw a
NullPointerException. |
protected void |
expectNullValueMissingWhenNullValuesUnsupported(String message)
Equivalent to
expectMissingValues
(null)
except that the call to contains(null) is permitted to throw a
NullPointerException. |
protected void |
expectReplacement(Map.Entry<K,V> newEntry) |
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. |
protected K |
getKeyForNullValue() |
protected Map<K,V> |
getMap() |
protected int |
getNumEntries() |
protected Collection<Map.Entry<K,V>> |
getSampleEntries() |
protected Collection<Map.Entry<K,V>> |
getSampleEntries(int howMany) |
protected V |
getValueForNullKey() |
protected void |
initMapWithNullKey() |
protected void |
initMapWithNullValue() |
protected K |
k0() |
protected K |
k1() |
protected K |
k2() |
protected K |
k3() |
protected K |
k4() |
protected void |
resetMap() |
protected void |
resetMap(Map.Entry<K,V>[] entries) |
void |
setUp() |
protected V |
v0() |
protected V |
v1() |
protected V |
v2() |
protected V |
v3() |
protected V |
v4() |
createArrayWithDuplicateElement, createOrderedArray, createSamplesArray, e0, e1, e2, e3, e4, emptyCollection, expectAdded, expectAdded, expectAdded, expectContents, expectUnchanged, getNullLocation, getNumElements, getOrderedElements, getSampleElements, getSampleElements, resetContainer, resetContainergetName, getSubjectGenerator, getTestMethodName, init, init, tearDowncountTestCases, createResult, run, run, runBare, runTest, setName, toStringassertEquals, 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, formatpublic void setUp()
throws Exception
protected Collection<Map.Entry<K,V>> actualContents()
actualContents in class AbstractContainerTester<Map<K,V>,Map.Entry<K,V>>expectContents(E...) and its friends.protected void resetMap()
protected void expectMissingKeys(K... elements)
protected void expectMissingValues(V... elements)
protected Map.Entry<K,V>[] createArrayWithNullKey()
null as the key of the
middle element.protected V getValueForNullKey()
protected K getKeyForNullValue()
protected Map.Entry<K,V>[] createArrayWithNullValue()
null as the value of the
middle element.protected void initMapWithNullKey()
protected void initMapWithNullValue()
protected void expectNullKeyMissingWhenNullKeysUnsupported(String message)
expectMissingKeys
(null)
except that the call to contains(null) is permitted to throw a
NullPointerException.message - message to use upon assertion failureprotected void expectNullValueMissingWhenNullValuesUnsupported(String message)
expectMissingValues
(null)
except that the call to contains(null) is permitted to throw a
NullPointerException.message - message to use upon assertion failureprotected MinimalCollection<Map.Entry<K,V>> createDisjointCollection()
createDisjointCollection in class AbstractContainerTester<Map<K,V>,Map.Entry<K,V>>protected int getNumEntries()
protected Collection<Map.Entry<K,V>> getSampleEntries(int howMany)
protected Collection<Map.Entry<K,V>> getSampleEntries()
protected void expectMissing(Map.Entry<K,V>... entries)
expectMissing in class AbstractContainerTester<Map<K,V>,Map.Entry<K,V>>protected void expectContents(Collection<Map.Entry<K,V>> expected)
AbstractContainerTesterAbstractListTester, a call to expectContents() invokes this
version.expectContents in class AbstractContainerTester<Map<K,V>,Map.Entry<K,V>>expected - expected value of AbstractContainerTester.containerprotected V get(K key)
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.protected final K k0()
protected final V v0()
protected final K k1()
protected final V v1()
protected final K k2()
protected final V v2()
protected final K k3()
protected final V v3()
protected final K k4()
protected final V v4()
Copyright © 2010-2016. All Rights Reserved.