|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--junit.framework.Assert
|
+--net.sf.molae.pipe.test.ObjectTest
|
+--net.sf.molae.pipe.test.CollectionTest
|
+--net.sf.molae.pipe.test.ListTest
Test methods to check the contract of list implementing classes.
| Inner Class Summary | |
static class |
ListTest.SubListTest
Test methods to check the contract of sub lists. |
| Constructor Summary | |
protected |
ListTest(List testObject)
Creates a new test with the specified candidate. |
| Method Summary | |
void |
assertConsistency()
Checks consistency of all reading list methods. |
void |
assertImmutability()
Calls all modifying methods of the underlying list and checks if they throw an UnsupportedOperationException. |
protected void |
assertValidArray(String message,
Object[] a)
Checks if the specified array is a valid result of the toArray() or
toArray(Object[])
operation, respectively. |
protected void |
checkAddAll(String message,
List l)
This implementation uses List.equals(Object). |
static ListTest |
getInstance(List testObject)
Creates a new instance of this class with the specified testObject as test object. |
void |
performCycle()
Checks consistency of all list methods. |
protected void |
performCycle(int index,
Object subst)
Checks consistency of all list methods. |
| Methods inherited from class net.sf.molae.pipe.test.CollectionTest |
assertAddProhibited, assertEqualContent, assertEqualSequence, checkConsistency, getInstance, performBulkCycle, performIntegerTest |
| Methods inherited from class net.sf.molae.pipe.test.ObjectTest |
assertFalse, getTestObject, toString |
| 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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
protected ListTest(List testObject)
testObject - the candidate of the testNullPointerException - if the specified test objects is
null.| Method Detail |
public static final ListTest getInstance(List testObject)
testObject - the candidate of the testNullPointerException - if the specified test objects is
null.
protected void checkAddAll(String message,
List l)
List.equals(Object).checkAddAll in class CollectionTestmessage - the message to be displayed if the assertion failsl - the list to compareAssertionFailedError - if the specified list is not equal to the
test object.
protected void assertValidArray(String message,
Object[] a)
Checks if the specified array is a valid result of the
toArray() or
toArray(Object[])
operation, respectively.
This implementation uses List.equals(Object).
assertValidArray in class CollectionTestmessage - the message to be displayed if the assertion failsa - the result of a toArray() operation.AssertionFailedError - if the specified array is not a valid
result.public void assertConsistency()
assertConsistency in class CollectionTestAssertionFailedError - if the list contract is broken by
the tested list.public void assertImmutability()
UnsupportedOperationException.assertImmutability in class CollectionTestAssertionFailedError - if any of the called operations
did not throw an UnsupportedOperationException
protected void performCycle(int index,
Object subst)
index - the index of the element that is testedsubst - a value to which the list entry is set during the cycle.AssertionFailedError - if the list contract is broken by
the specified list.UnsupportedOperationException - if any of the called
methods is not implemented.public void performCycle()
performCycle in class CollectionTestAssertionFailedError - if the list contract is broken by
the specified list.UnsupportedOperationException - if any of the called
methods is not implemented.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||