Keel 2.1RC2

org.apache.commons.collections
Class TestDoubleOrderedMap

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.apache.commons.collections.BulkTest
              extended byorg.apache.commons.collections.TestObject
                  extended byorg.apache.commons.collections.TestMap
                      extended byorg.apache.commons.collections.TestDoubleOrderedMap
All Implemented Interfaces:
java.lang.Cloneable, junit.framework.Test

public class TestDoubleOrderedMap
extends TestMap

Class TestDoubleOrderedMap Test cases for DoubleOrderedMap. This class cannot implement TestMap.SupportsPut, because it is a special Map that does not support duplicate keys, duplicate values, or null values.

Author:
Marc Johnson (marcj at users dot sourceforge dot net)

Nested Class Summary
 
Nested classes inherited from class org.apache.commons.collections.TestMap
TestMap.TestMapEntrySet, TestMap.TestMapKeySet, TestMap.TestMapValues
 
Field Summary
 
Fields inherited from class org.apache.commons.collections.TestMap
confirmed, entrySet, keySet, map, values
 
Fields inherited from class org.apache.commons.collections.TestObject
COLLECTIONS_MAJOR_VERSION
 
Fields inherited from class org.apache.commons.collections.BulkTest
verboseName
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
TestDoubleOrderedMap(java.lang.String name)
          constructor
 
Method Summary
static void main(java.lang.String[] unusedArgs)
          Method main
 java.util.Map makeEmptyMap()
          Return a new, empty Map to be used for testing.
private  LocalTestNode[] makeLocalNodes()
           
 java.util.Map makeMap()
           
static junit.framework.Test suite()
          create a suite of the tests in this class
 void testClear()
          test clear() method
 void testConstructors()
          test constructors
 void testContainsKey()
          test containsKey() method
 void testContainsValue()
          test containsValue() method
 void testEntrySet()
          test entrySet() method
private  void testEntrySet(java.util.Map m)
           
 void testEntrySetByValue()
          test entrySetByValue() method
private  void testEntrySetByValue(DoubleOrderedMap m)
           
 void testEquals()
          Method testEquals
 void testGet()
          test get() method
 void testGetKeyForValue()
          test getKeyForValue() method
 void testHashCode()
          test hashCode() method
 void testIsEmpty()
          test IsEmpty() method
 void testKeySet()
          test keySet() method
private  void testKeySet(java.util.Map m)
           
 void testKeySetByValue()
          test keySetByValue() method
private  void testKeySetByValue(DoubleOrderedMap m)
           
 void testMapPut()
          Override the Map.put() test because it tries put with the same key which is invalid in the modified double ordered map contract.
 void testPut()
          test put() method
 void testPutAll()
          Method testPutAll
 void testRemove()
          test remove() method
 void testRemoveValue()
          test removeValue() method
 void testSize()
          test size() method
 void testValues()
          test values() method
private  void testValues(java.util.Map m)
           
 void testValuesByValue()
          test valuesByValue() method
private  void testValuesByValue(DoubleOrderedMap m)
           
 boolean useDuplicateValues()
          Double ordered map does not support duplicate values
 boolean useNullKey()
          The default comparator in double ordered map does not allow null keys.
 boolean useNullValue()
          The default comparator in double ordered map does not allow null keys, and values are keys in this map.
 
Methods inherited from class org.apache.commons.collections.TestMap
addSampleMappings, bulkTestMapEntrySet, bulkTestMapKeySet, bulkTestMapValues, getNewSampleValues, getOtherKeys, getOtherValues, getSampleKeys, getSampleValues, isAddRemoveModifiable, isChangeable, makeFullMap, makeObject, resetEmpty, resetFull, tearDown, testEmptyMapCompatibility, testFullMapCompatibility, testMakeMap, testMapClear, testMapContainsKey, testMapContainsValue, testMapEquals, testMapGet, testMapHashCode, testMapIsEmpty, testMapPutAll, testMapRemove, testMapSize, testMapToString, testSampleMappings, verify, verifyEntrySet, verifyKeySet, verifyMap, verifyValues
 
Methods inherited from class org.apache.commons.collections.TestObject
getCanonicalEmptyCollectionName, getCanonicalFullCollectionName, getCompatibilityVersion, readExternalFormFromBytes, readExternalFormFromDisk, supportsEmptyCollections, supportsFullCollections, testCanonicalEmptyCollectionExists, testCanonicalFullCollectionExists, testObjectEqualsSelf, testObjectHashCodeEqualsContract, testObjectHashCodeEqualsSelfHashCode, testSimpleSerialization, writeExternalFormToBytes, writeExternalFormToDisk
 
Methods inherited from class org.apache.commons.collections.BulkTest
clone, ignoredSimpleTests, makeSuite, toString
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, setUp
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestDoubleOrderedMap

public TestDoubleOrderedMap(java.lang.String name)
constructor

Parameters:
name -
Method Detail

suite

public static junit.framework.Test suite()
create a suite of the tests in this class

Returns:
the test suite

useNullKey

public boolean useNullKey()
The default comparator in double ordered map does not allow null keys.

Overrides:
useNullKey in class TestMap

useNullValue

public boolean useNullValue()
The default comparator in double ordered map does not allow null keys, and values are keys in this map.

Overrides:
useNullValue in class TestMap

useDuplicateValues

public boolean useDuplicateValues()
Double ordered map does not support duplicate values

Overrides:
useDuplicateValues in class TestMap

makeEmptyMap

public java.util.Map makeEmptyMap()
Description copied from class: TestMap
Return a new, empty Map to be used for testing.

Specified by:
makeEmptyMap in class TestMap

makeMap

public java.util.Map makeMap()

testSize

public void testSize()
test size() method


testIsEmpty

public void testIsEmpty()
test IsEmpty() method


testContainsKey

public void testContainsKey()
test containsKey() method


testContainsValue

public void testContainsValue()
test containsValue() method


testGet

public void testGet()
test get() method


testPut

public void testPut()
test put() method


testRemove

public void testRemove()
test remove() method


testPutAll

public void testPutAll()
Method testPutAll


testClear

public void testClear()
test clear() method


testKeySet

public void testKeySet()
test keySet() method


testValues

public void testValues()
test values() method


testEntrySet

public void testEntrySet()
test entrySet() method


testEquals

public void testEquals()
Method testEquals


testHashCode

public void testHashCode()
test hashCode() method


testConstructors

public void testConstructors()
test constructors


testGetKeyForValue

public void testGetKeyForValue()
test getKeyForValue() method


testRemoveValue

public void testRemoveValue()
test removeValue() method


testEntrySetByValue

public void testEntrySetByValue()
test entrySetByValue() method


testKeySetByValue

public void testKeySetByValue()
test keySetByValue() method


testValuesByValue

public void testValuesByValue()
test valuesByValue() method


testKeySet

private void testKeySet(java.util.Map m)

testKeySetByValue

private void testKeySetByValue(DoubleOrderedMap m)

testValues

private void testValues(java.util.Map m)

testValuesByValue

private void testValuesByValue(DoubleOrderedMap m)

testEntrySet

private void testEntrySet(java.util.Map m)

testEntrySetByValue

private void testEntrySetByValue(DoubleOrderedMap m)

makeLocalNodes

private LocalTestNode[] makeLocalNodes()

main

public static void main(java.lang.String[] unusedArgs)
Method main

Parameters:
unusedArgs -

testMapPut

public void testMapPut()
Override the Map.put() test because it tries put with the same key which is invalid in the modified double ordered map contract. (The DoubleOrderedMap documentation states that an IllegalArgumentException is thrown when a key is tried to be put into the map again. This differs from the standard Map contract which would replace the value for that key and return it.

Overrides:
testMapPut in class TestMap

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.