|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.junit.Assert
net.sf.molae.pipe.test.ObjectTest<B>
net.sf.molae.pipe.test.MapTest<B,K,V>
net.sf.molae.pipe.test.SortedMapTest<B,K,V>
public class SortedMapTest<B extends SortedMap<K,V>,K,V>
Test methods to check the contract of
SortedMap
implementing classes.
Field Summary |
---|
Fields inherited from class net.sf.molae.pipe.test.MapTest |
---|
TO_KEY_TRANSFORMER, TO_VALUE_TRANSFORMER |
Constructor Summary | |
---|---|
protected |
SortedMapTest(B testObject)
Creates a new test with the specified candidate. |
Method Summary | ||
---|---|---|
void |
addHeadMapTest(K toKey)
Adds a head map test to the list of sub map tests that are performed simultaneously. |
|
void |
addSubMapTest(K fromKey,
K toKey)
Adds a subMap test to the list of sub map tests that are performed simultaneously. |
|
void |
addTailMapTest(K fromKey)
Adds a tail map test to the list of sub map tests that are performed simultaneously. |
|
void |
assertConsistency()
Checks consistency of reading SortedMap methods. |
|
protected static void |
assertEqualSequence(String message,
Iterator expected,
Iterator actual)
Compares the specified iterators. |
|
static
|
getInstance(SortedMap<K,V> testObject)
Creates a new instance of this class with the specified testObject as test object. |
|
void |
performCycle()
Performs a test cycle that uses modifying methods but is expected to leave the test object in an equal state as at the start - if everything works fine. |
|
void |
performIntegerTest()
Deprecated. Use setIntegerTestValues(net.sf.molae.pipe.test.SortedMapTest, ? super java.lang.Integer, ? super java.lang.Integer>)
and MapTest.performValuesTest() instead. |
|
static void |
setIntegerTestValues(SortedMapTest<?,? super Integer,? super Integer> test)
Sets default values for the test values. |
Methods inherited from class net.sf.molae.pipe.test.MapTest |
---|
assertImmutablity, checkConsistency, getInstance, performBulkCycle, performCycle, performValuesTest, setIntegerTestValues, setTestValues |
Methods inherited from class net.sf.molae.pipe.test.ObjectTest |
---|
assertFalse, assertTestValuesSet, getTestObject, setTestValuesSet, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected SortedMapTest(B testObject)
testObject
- the candidate of the test
NullPointerException
- if the specified test objects is
null
.Method Detail |
---|
protected static void assertEqualSequence(String message, Iterator expected, Iterator actual)
CollectionTest.assertEqualSequence(String,Iterator,Iterator)
.
message
- the message to be displayed if the assertion failsexpected
- expected valueactual
- actual valuepublic static final <K,V> SortedMapTest<SortedMap<K,V>,K,V> getInstance(SortedMap<K,V> testObject)
testObject
- the candidate of the test
NullPointerException
- if the specified test objects is
null
.public void assertConsistency()
assertConsistency
in class MapTest<B extends SortedMap<K,V>,K,V>
AssertionFailedError
- if the SortedMap contract is broken by
the specified sorted map.public void performCycle()
performCycle
in class MapTest<B extends SortedMap<K,V>,K,V>
AssertionFailedError
- if the test object does not pass the test.public static void setIntegerTestValues(SortedMapTest<?,? super Integer,? super Integer> test)
public void performIntegerTest()
setIntegerTestValues(net.sf.molae.pipe.test.SortedMapTest, ? super java.lang.Integer, ? super java.lang.Integer>)
and MapTest.performValuesTest()
instead.
performIntegerTest
in class MapTest<B extends SortedMap<K,V>,K,V>
public void addSubMapTest(K fromKey, K toKey)
fromKey
- low endpoint (inclusive) of the subMap.toKey
- high endpoint (exclusive) of the subMap.public void addHeadMapTest(K toKey)
toKey
- high endpoint (exclusive) of the subMap.public void addTailMapTest(K fromKey)
fromKey
- low endpoint (inclusive) of the tailMap.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |