org.jmock.expectation

Class AbstractExpectationCollection

Implemented Interfaces:
Expectation, ExpectationCollection, Verifiable
Known Direct 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

AbstractExpectationCollection(String name)

Method Summary

void
addActual(Object actualItem)
void
addActual(int actualItem)
void
addActual(long actual)
void
addActualMany(Enumeration items)
void
addActualMany(Iterator items)
void
addActualMany(Object[] items)
void
addExpected(Object expectedItem)
void
addExpected(int expectedItem)
void
addExpected(long expected)
void
addExpectedMany(Enumeration expectedItems)
void
addExpectedMany(Iterator expectedItems)
void
addExpectedMany(Object[] expectedItems)
protected void
checkImmediateValues(Object actualItem)
void
clearActual()
protected void
clearExpectation()
protected Collection
getActualCollection()
protected Collection
getExpectedCollection()
void
setExpectNothing()
Tell the object to expect nothing to happen to it, perhaps because the test is exercising the handling of an error.
void
verify()

Methods inherited from class org.jmock.expectation.AbstractExpectation

assertEquals, assertEquals, clearActual, hasExpectations, setFailOnVerify, setHasExpectations, shouldCheckImmediately, verify

Constructor Details

AbstractExpectationCollection

public AbstractExpectationCollection(String name)

Method Details

addActual

public void addActual(Object actualItem)
Specified by:
addActual in interface ExpectationCollection

addActual

public void addActual(int actualItem)

addActual

public void addActual(long actual)
Specified by:
addActual in interface ExpectationCollection

addActualMany

public void addActualMany(Enumeration items)
Specified by:
addActualMany in interface ExpectationCollection

addActualMany

public void addActualMany(Iterator items)
Specified by:
addActualMany in interface ExpectationCollection

addActualMany

public void addActualMany(Object[] items)
Specified by:
addActualMany in interface ExpectationCollection

addExpected

public void addExpected(Object expectedItem)
Specified by:
addExpected in interface ExpectationCollection

addExpected

public void addExpected(int expectedItem)

addExpected

public void addExpected(long expected)
Specified by:
addExpected in interface ExpectationCollection

addExpectedMany

public void addExpectedMany(Enumeration expectedItems)
Specified by:
addExpectedMany in interface ExpectationCollection

addExpectedMany

public void addExpectedMany(Iterator expectedItems)
Specified by:
addExpectedMany in interface ExpectationCollection

addExpectedMany

public void addExpectedMany(Object[] expectedItems)
Specified by:
addExpectedMany in interface ExpectationCollection

checkImmediateValues

protected void checkImmediateValues(Object actualItem)

clearActual

public void clearActual()
Overrides:
clearActual in interface AbstractExpectation

clearExpectation

protected void clearExpectation()

getActualCollection

protected Collection getActualCollection()

getExpectedCollection

protected Collection getExpectedCollection()

setExpectNothing

public void setExpectNothing()
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 interface Expectation

verify

public void verify()
Specified by:
verify in interface Verifiable
Overrides:
verify in interface AbstractExpectation