Class TreeMapTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by JSR166TestCase
              extended by TreeMapTest
All Implemented Interfaces:
junit.framework.Test

public class TreeMapTest
extends JSR166TestCase


Nested Class Summary
 
Nested classes/interfaces inherited from class JSR166TestCase
JSR166TestCase.AdjustablePolicy, JSR166TestCase.CallableOne, JSR166TestCase.CheckedBarrier, JSR166TestCase.CheckedCallable<T>, JSR166TestCase.CheckedInterruptedCallable<T>, JSR166TestCase.CheckedInterruptedRunnable, JSR166TestCase.CheckedRecursiveAction, JSR166TestCase.CheckedRecursiveTask<T>, JSR166TestCase.CheckedRunnable, JSR166TestCase.LongPossiblyInterruptedRunnable, JSR166TestCase.MediumInterruptedRunnable, JSR166TestCase.MediumPossiblyInterruptedRunnable, JSR166TestCase.MediumRunnable, JSR166TestCase.NoOpCallable, JSR166TestCase.NoOpREHandler, JSR166TestCase.NoOpRunnable, JSR166TestCase.NPETask, JSR166TestCase.RunnableShouldThrow, JSR166TestCase.ShortInterruptedRunnable, JSR166TestCase.ShortRunnable, JSR166TestCase.SimpleThreadFactory, JSR166TestCase.SmallCallable, JSR166TestCase.SmallPossiblyInterruptedRunnable, JSR166TestCase.SmallRunnable, JSR166TestCase.StringTask, JSR166TestCase.ThreadShouldThrow, JSR166TestCase.TrackedCallable, JSR166TestCase.TrackedLongRunnable, JSR166TestCase.TrackedMediumRunnable, JSR166TestCase.TrackedNoOpRunnable, JSR166TestCase.TrackedRunnable, JSR166TestCase.TrackedShortRunnable, JSR166TestCase.TrackedSmallRunnable
 
Field Summary
 
Fields inherited from class JSR166TestCase
eight, expensiveTests, five, four, LONG_DELAY_MS, m1, m10, m2, m3, m4, m5, m6, MEDIUM_DELAY_MS, nine, one, seven, SHORT_DELAY_MS, six, SIZE, SMALL_DELAY_MS, TEST_STRING, three, two, zero
 
Constructor Summary
TreeMapTest()
           
 
Method Summary
static void main(java.lang.String[] args)
           
static junit.framework.Test suite()
           
 void testCeilingEntry()
          ceilingEntry returns next entry.
 void testCeilingKey()
          ceilingKey returns next element
 void testClear()
          clear removes all pairs
 void testConstructFromSorted()
           
 void testContainsKey_NullPointerException()
          containsKey(null) of nonempty map throws NPE
 void testContainsKey()
          containsKey returns true for contained key
 void testContainsValue()
          containsValue returns true for held values
 void testDescendingEntrySet()
          descendingEntrySet contains all pairs
 void testDescendingEntrySetToArray()
          descendingEntrySet.toArray contains all entries
 void testDescendingKeySetDescendingIteratorOrder()
          descending iterator of descendingKeySet is ordered
 void testDescendingKeySetOrder()
          descendingKeySet is ordered
 void testDescendingKeySetToArray()
          descendingkeySet.toArray returns contains all keys
 void testEntrySet()
          entrySet contains all pairs
 void testEntrySetToArray()
          entrySet.toArray contains all entries
 void testEquals()
          Maps with same contents are equal
 void testFirstKey()
          firstKey returns first key
 void testFloorEntry()
          floorEntry returns preceding entry.
 void testFloorKey()
          floorKey returns preceding element
 void testGet_NullPointerException()
          get(null) of nonempty map throws NPE
 void testGet()
          get returns the correct element at the given key, or null if not present
 void testHeadMapContents()
          headMap returns map with keys in requested range
 void testHigherEntry()
          higherEntry returns next entry.
 void testHigherKey()
          higherKey returns next element
 void testIsEmpty()
          isEmpty is true of empty map and false for non-empty
 void testKeySet()
          keySet returns a Set containing all the keys
 void testKeySetDescendingIteratorOrder()
          descending iterator of key set is inverse ordered
 void testKeySetOrder()
          keySet is ordered
 void testKeySetToArray()
          keySet.toArray returns contains all keys
 void testLastKey()
          lastKey returns last key
 void testLowerEntry()
          lowerEntry returns preceding entry.
 void testLowerKey()
          lowerKey returns preceding element
 void testPollFirstEntry()
          pollFirstEntry returns entries in order
 void testPollLastEntry()
          pollLastEntry returns entries in order
 void testPutAll()
          putAll adds all key-value pairs from the given map
 void testRecursiveSubMaps()
          Submaps of submaps subdivide correctly
 void testRemove()
          remove removes the correct key-value pair from the map
 void testRemove1_NullPointerException()
          remove(null) throws NPE for nonempty map
 void testSerialization()
          A deserialized map equals original
 void testSize()
          size returns the correct values
 void testSubMapContents()
          subMap returns map with keys in requested range
 void testSubMapContents2()
           
 void testTailMapContents()
          headMap returns map with keys in requested range
 void testToString()
          toString contains toString of elements
 void testValues()
          values collection contains all values
 
Methods inherited from class JSR166TestCase
assertThreadJoinTimesOut, awaiter, checkEmpty, delay, getShortDelay, joinPool, latchAwaitingStringTask, newTestSuite, permissivePolicy, possiblyInterruptedRunnable, runTest, runTestProfiled, runWithoutPermissions, runWithPermissions, setDelays, setUp, shouldThrow, shouldThrow, tearDown, threadAssertEquals, threadAssertEquals, threadAssertFalse, threadAssertNull, threadAssertSame, threadAssertTrue, threadFail, threadRecordFailure, threadShouldThrow, threadShouldThrow, threadUnexpectedException, trackedRunnable
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, setName, 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

TreeMapTest

public TreeMapTest()
Method Detail

main

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

suite

public static junit.framework.Test suite()

testClear

public void testClear()
clear removes all pairs


testConstructFromSorted

public void testConstructFromSorted()

testEquals

public void testEquals()
Maps with same contents are equal


testContainsKey

public void testContainsKey()
containsKey returns true for contained key


testContainsValue

public void testContainsValue()
containsValue returns true for held values


testGet

public void testGet()
get returns the correct element at the given key, or null if not present


testIsEmpty

public void testIsEmpty()
isEmpty is true of empty map and false for non-empty


testFirstKey

public void testFirstKey()
firstKey returns first key


testLastKey

public void testLastKey()
lastKey returns last key


testKeySetToArray

public void testKeySetToArray()
keySet.toArray returns contains all keys


testDescendingKeySetToArray

public void testDescendingKeySetToArray()
descendingkeySet.toArray returns contains all keys


testKeySet

public void testKeySet()
keySet returns a Set containing all the keys


testKeySetOrder

public void testKeySetOrder()
keySet is ordered


testKeySetDescendingIteratorOrder

public void testKeySetDescendingIteratorOrder()
descending iterator of key set is inverse ordered


testDescendingKeySetOrder

public void testDescendingKeySetOrder()
descendingKeySet is ordered


testDescendingKeySetDescendingIteratorOrder

public void testDescendingKeySetDescendingIteratorOrder()
descending iterator of descendingKeySet is ordered


testValues

public void testValues()
values collection contains all values


testEntrySet

public void testEntrySet()
entrySet contains all pairs


testDescendingEntrySet

public void testDescendingEntrySet()
descendingEntrySet contains all pairs


testEntrySetToArray

public void testEntrySetToArray()
entrySet.toArray contains all entries


testDescendingEntrySetToArray

public void testDescendingEntrySetToArray()
descendingEntrySet.toArray contains all entries


testPutAll

public void testPutAll()
putAll adds all key-value pairs from the given map


testRemove

public void testRemove()
remove removes the correct key-value pair from the map


testLowerEntry

public void testLowerEntry()
lowerEntry returns preceding entry.


testHigherEntry

public void testHigherEntry()
higherEntry returns next entry.


testFloorEntry

public void testFloorEntry()
floorEntry returns preceding entry.


testCeilingEntry

public void testCeilingEntry()
ceilingEntry returns next entry.


testLowerKey

public void testLowerKey()
lowerKey returns preceding element


testHigherKey

public void testHigherKey()
higherKey returns next element


testFloorKey

public void testFloorKey()
floorKey returns preceding element


testCeilingKey

public void testCeilingKey()
ceilingKey returns next element


testPollFirstEntry

public void testPollFirstEntry()
pollFirstEntry returns entries in order


testPollLastEntry

public void testPollLastEntry()
pollLastEntry returns entries in order


testSize

public void testSize()
size returns the correct values


testToString

public void testToString()
toString contains toString of elements


testGet_NullPointerException

public void testGet_NullPointerException()
get(null) of nonempty map throws NPE


testContainsKey_NullPointerException

public void testContainsKey_NullPointerException()
containsKey(null) of nonempty map throws NPE


testRemove1_NullPointerException

public void testRemove1_NullPointerException()
remove(null) throws NPE for nonempty map


testSerialization

public void testSerialization()
                       throws java.lang.Exception
A deserialized map equals original

Throws:
java.lang.Exception

testSubMapContents

public void testSubMapContents()
subMap returns map with keys in requested range


testSubMapContents2

public void testSubMapContents2()

testHeadMapContents

public void testHeadMapContents()
headMap returns map with keys in requested range


testTailMapContents

public void testTailMapContents()
headMap returns map with keys in requested range


testRecursiveSubMaps

public void testRecursiveSubMaps()
                          throws java.lang.Exception
Submaps of submaps subdivide correctly

Throws:
java.lang.Exception