Package org.jmock.expectation
Class AbstractExpectationCollection
java.lang.Object
org.jmock.expectation.AbstractExpectation
org.jmock.expectation.AbstractExpectationCollection
- All Implemented Interfaces:
Verifiable,Expectation,ExpectationCollection
- Direct Known Subclasses:
ExpectationList,ExpectationSet
public abstract class AbstractExpectationCollection
extends AbstractExpectation
implements ExpectationCollection
-
Field Summary
Fields inherited from class org.jmock.expectation.AbstractExpectation
myFailureModeIsImmediate, myName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddActual(int actualItem) voidaddActual(long actual) voidvoidaddActualMany(Object[] items) voidaddActualMany(Enumeration items) voidaddActualMany(Iterator items) voidaddExpected(int expectedItem) voidaddExpected(long expected) voidaddExpected(Object expectedItem) voidaddExpectedMany(Object[] expectedItems) voidaddExpectedMany(Enumeration expectedItems) voidaddExpectedMany(Iterator expectedItems) protected abstract voidcheckImmediateValues(Object actualItem) voidprotected voidprotected abstract Collectionprotected abstract CollectionvoidTell the object to expect nothing to happen to it, perhaps because the test is exercising the handling of an error.voidverify()Throw an AssertionFailedException if any expectations have not been met.Methods inherited from class org.jmock.expectation.AbstractExpectation
assertEquals, assertEquals, hasExpectations, setFailOnVerify, setHasExpectations, shouldCheckImmediatelyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jmock.expectation.Expectation
hasExpectations, setFailOnVerify
-
Constructor Details
-
AbstractExpectationCollection
-
-
Method Details
-
addActual
- Specified by:
addActualin interfaceExpectationCollection
-
addActual
public void addActual(int actualItem) -
addActualMany
- Specified by:
addActualManyin interfaceExpectationCollection
-
addActualMany
- Specified by:
addActualManyin interfaceExpectationCollection
-
addActualMany
- Specified by:
addActualManyin interfaceExpectationCollection
-
addExpected
public void addExpected(int expectedItem) -
addExpected
- Specified by:
addExpectedin interfaceExpectationCollection
-
addExpectedMany
- Specified by:
addExpectedManyin interfaceExpectationCollection
-
addExpectedMany
- Specified by:
addExpectedManyin interfaceExpectationCollection
-
addExpectedMany
- Specified by:
addExpectedManyin interfaceExpectationCollection
-
checkImmediateValues
-
clearActual
public void clearActual()- Specified by:
clearActualin classAbstractExpectation
-
clearExpectation
protected void clearExpectation() -
getActualCollection
-
getExpectedCollection
-
setExpectNothing
public void setExpectNothing()Description copied from interface:ExpectationTell the object to expect nothing to happen to it, perhaps because the test is exercising the handling of an error. The Expectation will fail if any actual values are set. Note that this is not the same as not setting any expectations, in which case verify() will do nothing.- Specified by:
setExpectNothingin interfaceExpectation
-
verify
public void verify()Description copied from interface:VerifiableThrow an AssertionFailedException if any expectations have not been met. Implementations of this method must be idempotent: jMock can call this method more than once when verifying expectations at the end of a test.- Specified by:
verifyin interfaceVerifiable- Specified by:
verifyin classAbstractExpectation
-
addActual
public void addActual(long actual) - Specified by:
addActualin interfaceExpectationCollection
-
addExpected
public void addExpected(long expected) - Specified by:
addExpectedin interfaceExpectationCollection
-