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 TypeMethodDescriptionvoid
addActual
(int actualItem) void
addActual
(long actual) void
void
addActualMany
(Object[] items) void
addActualMany
(Enumeration items) void
addActualMany
(Iterator items) void
addExpected
(int expectedItem) void
addExpected
(long expected) void
addExpected
(Object expectedItem) void
addExpectedMany
(Object[] expectedItems) void
addExpectedMany
(Enumeration expectedItems) void
addExpectedMany
(Iterator expectedItems) protected abstract void
checkImmediateValues
(Object actualItem) void
protected void
protected abstract Collection
protected abstract Collection
void
Tell the object to expect nothing to happen to it, perhaps because the test is exercising the handling of an error.void
verify()
Throw an AssertionFailedException if any expectations have not been met.Methods inherited from class org.jmock.expectation.AbstractExpectation
assertEquals, assertEquals, hasExpectations, setFailOnVerify, setHasExpectations, shouldCheckImmediately
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jmock.expectation.Expectation
hasExpectations, setFailOnVerify
-
Constructor Details
-
AbstractExpectationCollection
-
-
Method Details
-
addActual
- Specified by:
addActual
in interfaceExpectationCollection
-
addActual
public void addActual(int actualItem) -
addActualMany
- Specified by:
addActualMany
in interfaceExpectationCollection
-
addActualMany
- Specified by:
addActualMany
in interfaceExpectationCollection
-
addActualMany
- Specified by:
addActualMany
in interfaceExpectationCollection
-
addExpected
public void addExpected(int expectedItem) -
addExpected
- Specified by:
addExpected
in interfaceExpectationCollection
-
addExpectedMany
- Specified by:
addExpectedMany
in interfaceExpectationCollection
-
addExpectedMany
- Specified by:
addExpectedMany
in interfaceExpectationCollection
-
addExpectedMany
- Specified by:
addExpectedMany
in interfaceExpectationCollection
-
checkImmediateValues
-
clearActual
public void clearActual()- Specified by:
clearActual
in classAbstractExpectation
-
clearExpectation
protected void clearExpectation() -
getActualCollection
-
getExpectedCollection
-
setExpectNothing
public void setExpectNothing()Description copied from interface:Expectation
Tell 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:
setExpectNothing
in interfaceExpectation
-
verify
public void verify()Description copied from interface:Verifiable
Throw 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:
verify
in interfaceVerifiable
- Specified by:
verify
in classAbstractExpectation
-
addActual
public void addActual(long actual) - Specified by:
addActual
in interfaceExpectationCollection
-
addExpected
public void addExpected(long expected) - Specified by:
addExpected
in interfaceExpectationCollection
-