org.jmock.expectation

Class AbstractExpectation

Implemented Interfaces:
Expectation, Verifiable
Known Direct Subclasses:
AbstractExpectationCollection, ExpectationCounter, ExpectationDoubleValue, ExpectationSegment, ExpectationValue

public abstract class AbstractExpectation
extends Object
implements Verifiable, Expectation

Field Summary

protected boolean
myFailureModeIsImmediate
protected String
myName

Constructor Summary

AbstractExpectation(String name)

Method Summary

protected void
assertEquals(String msg, Object expectedValue, Object actualValue)
Due to junit Assert being a Singleton implemented with static methods, and java's unfortunate implementation of class methods (e.g.
protected void
assertEquals(String msg, int expectedValue, int actualValue)
void
clearActual()
boolean
hasExpectations()
void
setFailOnVerify()
protected void
setHasExpectations()
protected boolean
shouldCheckImmediately()
void
verify()

Field Details

myFailureModeIsImmediate

protected boolean myFailureModeIsImmediate

myName

protected String myName

Constructor Details

AbstractExpectation

public AbstractExpectation(String name)

Method Details

assertEquals

protected void assertEquals(String msg,
                            Object expectedValue,
                            Object actualValue)
Due to junit Assert being a Singleton implemented with static methods, and java's unfortunate implementation of class methods (e.g. no late binding) it is necessary to re-implement this invokedMethod here instead of over-riding failNotEquals

assertEquals

protected void assertEquals(String msg,
                            int expectedValue,
                            int actualValue)

clearActual

public void clearActual()

hasExpectations

public boolean hasExpectations()
Specified by:
hasExpectations in interface Expectation

setFailOnVerify

public void setFailOnVerify()
Specified by:
setFailOnVerify in interface Expectation

setHasExpectations

protected void setHasExpectations()

shouldCheckImmediately

protected boolean shouldCheckImmediately()

verify

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