|
|||||||||
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.IteratorTest<B>
public class IteratorTest<B extends Iterator<?>>
Test methods to check the contract of iterator implementing classes.
Constructor Summary | |
---|---|
protected |
IteratorTest(B testObject)
Creates a new test with the specified candidate. |
Method Summary | |
---|---|
protected void |
assertUnmodifying()
Calls all modifying methods of the underlying iterator and checks if they throw an UnsupportedOperationException . |
protected static IteratorTest<Iterator<?>> |
getInstance(Iterator<?> testObject)
Creates a new test with the specified candidate. |
protected void |
modifyAtStartTest()
Asserts that a call of remove before
next throws an
IllegalStateException . |
protected void |
readTest()
Performs all tests that do not change the collection underlying the iterator. |
Methods inherited from class net.sf.molae.pipe.test.ObjectTest |
---|
assertConsistency, 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 IteratorTest(B testObject)
testObject
- the candidate of the test
NullPointerException
- if the specified test objects is
null
.Method Detail |
---|
protected static IteratorTest<Iterator<?>> getInstance(Iterator<?> testObject)
testObject
- the candidate of the test
NullPointerException
- if the specified test objects is
null
.protected void assertUnmodifying()
UnsupportedOperationException
.
AssertionFailedError
- if any of the called operations
did not throw an UnsupportedOperationException
protected void readTest()
next
at the end throws an
NoSuchElementException
.
AssertionFailedError
- if the test object does not pass the test.
NoSuchElementException
- if next()
returns no
element although hasNext()
was true
.protected void modifyAtStartTest()
remove
before
next
throws an
IllegalStateException
.
AssertionFailedError
- if the test object does not pass the test.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |