com.google.common.collect.testing
Class SortedMapInterfaceTest<K,V>

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.google.common.collect.testing.MapInterfaceTest<K,V>
              extended by com.google.common.collect.testing.SortedMapInterfaceTest<K,V>
All Implemented Interfaces:
junit.framework.Test

public abstract class SortedMapInterfaceTest<K,V>
extends MapInterfaceTest<K,V>

Tests representing the contract of SortedMap. Concrete subclasses of this base class test conformance of concrete SortedMap subclasses to that contract.

This class is GWT compatible.

Author:
Jared Levy

Field Summary
 
Fields inherited from class com.google.common.collect.testing.MapInterfaceTest
allowsNullKeys, allowsNullValues, supportsClear, supportsIteratorRemove, supportsPut, supportsRemove
 
Constructor Summary
protected SortedMapInterfaceTest(boolean allowsNullKeys, boolean allowsNullValues, boolean supportsPut, boolean supportsRemove, boolean supportsClear)
           
 
Method Summary
protected  SortedMap<K,V> makeEitherMap()
          Used by tests that require a map, but don't care whether it's populated or not.
protected abstract  SortedMap<K,V> makeEmptyMap()
          Creates a new, empty instance of the class under test.
protected abstract  SortedMap<K,V> makePopulatedMap()
          Creates a new, non-empty instance of the class under test.
 void testEntrySetContainsEntryIncompatibleComparableKey()
           
 void testFirstKeyEmpty()
           
 void testFirstKeyNonEmpty()
           
 void testHeadMap()
           
 void testHeadMapEntrySet()
           
 void testLastKeyEmpty()
           
 void testLastKeyNonEmpty()
           
 void testOrdering()
           
 void testSubMap()
           
 void testSubMapIllegal()
           
 void testTailMap()
           
 void testTailMapClearThrough()
           
 void testTailMapEntrySet()
           
 void testTailMapRemoveThrough()
           
 void testTailMapWriteThrough()
           
 
Methods inherited from class com.google.common.collect.testing.MapInterfaceTest
assertInvariants, assertMoreInvariants, getKeyNotInPopulatedMap, getValueNotInPopulatedMap, supportsValuesHashCode, testClear, testContainsKey, testContainsValue, testEntrySet, testEntrySetAddAndAddAll, testEntrySetClear, testEntrySetContainsEntryIncompatibleKey, testEntrySetContainsEntryNullKeyMissing, testEntrySetContainsEntryNullKeyPresent, testEntrySetForEmptyMap, testEntrySetIteratorRemove, testEntrySetRemove, testEntrySetRemoveAll, testEntrySetRemoveAllNullFromEmpty, testEntrySetRemoveDifferentValue, testEntrySetRemoveMissingKey, testEntrySetRemoveNullKeyMissing, testEntrySetRemoveNullKeyPresent, testEntrySetRetainAll, testEntrySetRetainAllNullFromEmpty, testEntrySetSetValue, testEntrySetSetValueSameValue, testEqualsForEmptyMap, testEqualsForEqualMap, testEqualsForLargerMap, testEqualsForSmallerMap, testGet, testGetForEmptyMap, testGetNull, testHashCode, testHashCodeForEmptyMap, testKeySetClear, testKeySetRemove, testKeySetRemoveAll, testKeySetRemoveAllNullFromEmpty, testKeySetRetainAll, testKeySetRetainAllNullFromEmpty, testPutAllExistingKey, testPutAllNewKey, testPutExistingKey, testPutNewKey, testPutNullKey, testPutNullValue, testPutNullValueForExistingKey, testRemove, testRemoveMissingKey, testSize, testValues, testValuesClear, testValuesIteratorRemove, testValuesRemove, testValuesRemoveAll, testValuesRemoveAllNullFromEmpty, testValuesRemoveMissing, testValuesRetainAll, testValuesRetainAllNullFromEmpty
 
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
 

Constructor Detail

SortedMapInterfaceTest

protected SortedMapInterfaceTest(boolean allowsNullKeys,
                                 boolean allowsNullValues,
                                 boolean supportsPut,
                                 boolean supportsRemove,
                                 boolean supportsClear)
Method Detail

makeEmptyMap

protected abstract SortedMap<K,V> makeEmptyMap()
                                        throws UnsupportedOperationException
Description copied from class: MapInterfaceTest
Creates a new, empty instance of the class under test.

Specified by:
makeEmptyMap in class MapInterfaceTest<K,V>
Returns:
a new, empty map instance.
Throws:
UnsupportedOperationException - if it's not possible to make an empty instance of the class under test.

makePopulatedMap

protected abstract SortedMap<K,V> makePopulatedMap()
                                            throws UnsupportedOperationException
Description copied from class: MapInterfaceTest
Creates a new, non-empty instance of the class under test.

Specified by:
makePopulatedMap in class MapInterfaceTest<K,V>
Returns:
a new, non-empty map instance.
Throws:
UnsupportedOperationException - if it's not possible to make a non-empty instance of the class under test.

makeEitherMap

protected SortedMap<K,V> makeEitherMap()
Description copied from class: MapInterfaceTest
Used by tests that require a map, but don't care whether it's populated or not.

Overrides:
makeEitherMap in class MapInterfaceTest<K,V>
Returns:
a new map instance.

testOrdering

public void testOrdering()

testEntrySetContainsEntryIncompatibleComparableKey

public void testEntrySetContainsEntryIncompatibleComparableKey()

testFirstKeyEmpty

public void testFirstKeyEmpty()

testFirstKeyNonEmpty

public void testFirstKeyNonEmpty()

testLastKeyEmpty

public void testLastKeyEmpty()

testLastKeyNonEmpty

public void testLastKeyNonEmpty()

testHeadMap

public void testHeadMap()

testTailMap

public void testTailMap()

testSubMap

public void testSubMap()

testSubMapIllegal

public void testSubMapIllegal()

testTailMapEntrySet

public void testTailMapEntrySet()

testHeadMapEntrySet

public void testHeadMapEntrySet()

testTailMapWriteThrough

public void testTailMapWriteThrough()

testTailMapRemoveThrough

public void testTailMapRemoveThrough()

testTailMapClearThrough

public void testTailMapClearThrough()


Copyright © 2010-2011. All Rights Reserved.