|
|||||||||
| 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.CollectionTest<B,E>
net.sf.molae.pipe.test.SetTest<B,E>
public class SetTest<B extends Set<E>,E>
Test methods to check the contract of set implementing classes.
| Constructor Summary | |
|---|---|
protected |
SetTest(B testObject)
Creates a new test with the specified candidate. |
| Method Summary | ||
|---|---|---|
void |
assertConsistency()
Checks consistency of all reading set methods. |
|
protected void |
checkAddAll(String message,
List<E> l)
This implementation uses Set.equals(Object). |
|
static
|
getInstance(Set<E> 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. |
|
protected void |
performSimpleCycle()
Performs a test cycle of methods that take single elements as argument ( Set.remove(Object) and
Set.add(Object)). |
|
| Methods inherited from class net.sf.molae.pipe.test.CollectionTest |
|---|
assertAddProhibited, assertEqualContent, assertEqualSequence, assertImmutability, assertValidArray, checkConsistency, getInstance, getTestValue, performBulkCycle, performIntegerTest, 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 SetTest(B testObject)
testObject - the candidate of the test
NullPointerException - if the specified test objects is
null.| Method Detail |
|---|
public static final <E> SetTest<Set<E>,E> getInstance(Set<E> testObject)
testObject - the candidate of the test
NullPointerException - if the specified test objects is
null.
protected void checkAddAll(String message,
List<E> l)
Set.equals(Object).
checkAddAll in class CollectionTest<B extends Set<E>,E>message - the message to be displayed if the assertion failsl - the list to compare
AssertionFailedError - if the specified list is not equal to the
test object.public void assertConsistency()
assertConsistency in class CollectionTest<B extends Set<E>,E>AssertionFailedError - if the set contract is broken by
the test object.protected void performSimpleCycle()
Set.remove(Object) and
Set.add(Object)).
AssertionFailedError - if the set contract is broken by
the specified set.
UnsupportedOperationException - if any of the called
methods is not implemented.public void performCycle()
performCycle in class CollectionTest<B extends Set<E>,E>AssertionFailedError - if the set contract is broken by
the specified set.
UnsupportedOperationException - if any of the called
methods is not implemented.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||