|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
com.google.common.collect.testing.MapInterfaceTest<K,V>
K
- the type of keys used by the maps under testV
- the type of mapped values used the maps under testpublic abstract class MapInterfaceTest<K,V>
Tests representing the contract of Map
. Concrete subclasses of this
base class test conformance of concrete Map
subclasses to that
contract.
TODO: Descriptive assertion messages, with hints as to probable
fixes.
TODO: Add another constructor parameter indicating whether the
class under test is ordered, and check the order if so.
TODO: Refactor to share code with SetTestBuilder &c.
This class is GWT compatible.
Field Summary | |
---|---|
protected boolean |
allowsNullKeys
|
protected boolean |
allowsNullValues
|
protected boolean |
supportsClear
|
protected boolean |
supportsIteratorRemove
|
protected boolean |
supportsPut
|
protected boolean |
supportsRemove
|
Constructor Summary | |
---|---|
protected |
MapInterfaceTest(boolean allowsNullKeys,
boolean allowsNullValues,
boolean supportsPut,
boolean supportsRemove,
boolean supportsClear)
Constructor that assigns supportsIteratorRemove the same value as
supportsRemove . |
protected |
MapInterfaceTest(boolean allowsNullKeys,
boolean allowsNullValues,
boolean supportsPut,
boolean supportsRemove,
boolean supportsClear,
boolean supportsIteratorRemove)
Constructor with an explicit supportsIteratorRemove parameter. |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, 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 |
Field Detail |
---|
protected final boolean supportsPut
protected final boolean supportsRemove
protected final boolean supportsClear
protected final boolean allowsNullKeys
protected final boolean allowsNullValues
protected final boolean supportsIteratorRemove
Constructor Detail |
---|
protected MapInterfaceTest(boolean allowsNullKeys, boolean allowsNullValues, boolean supportsPut, boolean supportsRemove, boolean supportsClear)
supportsIteratorRemove
the same value as
supportsRemove
.
protected MapInterfaceTest(boolean allowsNullKeys, boolean allowsNullValues, boolean supportsPut, boolean supportsRemove, boolean supportsClear, boolean supportsIteratorRemove)
supportsIteratorRemove
parameter.
Method Detail |
---|
protected abstract Map<K,V> makeEmptyMap() throws UnsupportedOperationException
UnsupportedOperationException
- if it's not possible to make an
empty instance of the class under test.protected abstract Map<K,V> makePopulatedMap() throws UnsupportedOperationException
UnsupportedOperationException
- if it's not possible to make a
non-empty instance of the class under test.protected abstract K getKeyNotInPopulatedMap() throws UnsupportedOperationException
makePopulatedMap()
.
UnsupportedOperationException
- if it's not possible to make a key
that will not be found in the map.protected abstract V getValueNotInPopulatedMap() throws UnsupportedOperationException
makePopulatedMap()
.
UnsupportedOperationException
- if it's not possible to make a value
that will not be found in the map.protected Map<K,V> makeEitherMap()
protected final boolean supportsValuesHashCode(Map<K,V> map)
protected final void assertInvariants(Map<K,V> map)
assertMoreInvariants(java.util.Map)
to check invariants that are peculiar to
specific implementations.
map
- the map to check.assertMoreInvariants(java.util.Map)
protected void assertMoreInvariants(Map<K,V> map)
map
- the map whose additional invariants to check.public void testClear()
public void testContainsKey()
public void testContainsValue()
public void testEntrySet()
public void testEntrySetForEmptyMap()
public void testEntrySetContainsEntryIncompatibleKey()
public void testEntrySetContainsEntryNullKeyPresent()
public void testEntrySetContainsEntryNullKeyMissing()
public void testEntrySetIteratorRemove()
public void testEntrySetRemove()
public void testEntrySetRemoveMissingKey()
public void testEntrySetRemoveDifferentValue()
public void testEntrySetRemoveNullKeyPresent()
public void testEntrySetRemoveNullKeyMissing()
public void testEntrySetRemoveAll()
public void testEntrySetRemoveAllNullFromEmpty()
public void testEntrySetRetainAll()
public void testEntrySetRetainAllNullFromEmpty()
public void testEntrySetClear()
public void testEntrySetAddAndAddAll()
public void testEntrySetSetValue()
public void testEntrySetSetValueSameValue()
public void testEqualsForEqualMap()
public void testEqualsForLargerMap()
public void testEqualsForSmallerMap()
public void testEqualsForEmptyMap()
public void testGet()
public void testGetForEmptyMap()
public void testGetNull()
public void testHashCode()
public void testHashCodeForEmptyMap()
public void testPutNewKey()
public void testPutExistingKey()
public void testPutNullKey()
public void testPutNullValue()
public void testPutNullValueForExistingKey()
public void testPutAllNewKey()
public void testPutAllExistingKey()
public void testRemove()
public void testRemoveMissingKey()
public void testSize()
public void testKeySetRemove()
public void testKeySetRemoveAll()
public void testKeySetRetainAll()
public void testKeySetClear()
public void testKeySetRemoveAllNullFromEmpty()
public void testKeySetRetainAllNullFromEmpty()
public void testValues()
public void testValuesIteratorRemove()
public void testValuesRemove()
public void testValuesRemoveMissing()
public void testValuesRemoveAll()
public void testValuesRemoveAllNullFromEmpty()
public void testValuesRetainAll()
public void testValuesRetainAllNullFromEmpty()
public void testValuesClear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |