Package org.jmock.internal
Class InvocationExpectationBuilder
- java.lang.Object
-
- org.jmock.internal.InvocationExpectationBuilder
-
- All Implemented Interfaces:
ExpectationCapture,MethodClause,ParametersClause,ReceiverClause
public class InvocationExpectationBuilder extends java.lang.Object implements ExpectationCapture, ReceiverClause, MethodClause, ParametersClause
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<org.hamcrest.Matcher<?>>capturedParameterMatchersprivate InvocationExpectationexpectationprivate booleanisFullySpecifiedprivate booleanneedsDefaultAction
-
Constructor Summary
Constructors Constructor Description InvocationExpectationBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInSequenceOrderingConstraint(Sequence sequence)voidaddOrderingConstraint(OrderingConstraint constraint)voidaddParameterMatcher(org.hamcrest.Matcher<?> matcher)voidaddSideEffect(SideEffect sideEffect)private <T> TasMockedType(T mockObject, java.lang.Object capturingImposter)private <T> TcaptureExpectedObject(T mockObject)private voidcheckParameterMatcherCount(Invocation invocation)voidcheckWasFullySpecified()voidcreateExpectationFrom(Invocation invocation)ParametersClausemethod(java.lang.String nameRegex)ParametersClausemethod(org.hamcrest.Matcher<java.lang.reflect.Method> methodMatcher)MethodClauseof(org.hamcrest.Matcher<?> objectMatcher)<T> Tof(T mockObject)voidsetAction(Action action)voidsetCardinality(Cardinality cardinality)ExpectationtoExpectation(Action defaultAction)voidwith(org.hamcrest.Matcher<?>... parameterMatchers)voidwithNoArguments()
-
-
-
Field Detail
-
expectation
private final InvocationExpectation expectation
-
isFullySpecified
private boolean isFullySpecified
-
needsDefaultAction
private boolean needsDefaultAction
-
capturedParameterMatchers
private java.util.List<org.hamcrest.Matcher<?>> capturedParameterMatchers
-
-
Method Detail
-
toExpectation
public Expectation toExpectation(Action defaultAction)
-
setCardinality
public void setCardinality(Cardinality cardinality)
-
addParameterMatcher
public void addParameterMatcher(org.hamcrest.Matcher<?> matcher)
-
addOrderingConstraint
public void addOrderingConstraint(OrderingConstraint constraint)
-
addInSequenceOrderingConstraint
public void addInSequenceOrderingConstraint(Sequence sequence)
-
setAction
public void setAction(Action action)
-
addSideEffect
public void addSideEffect(SideEffect sideEffect)
-
captureExpectedObject
private <T> T captureExpectedObject(T mockObject)
-
asMockedType
private <T> T asMockedType(T mockObject, java.lang.Object capturingImposter)
-
createExpectationFrom
public void createExpectationFrom(Invocation invocation)
- Specified by:
createExpectationFromin interfaceExpectationCapture
-
checkParameterMatcherCount
private void checkParameterMatcherCount(Invocation invocation)
-
checkWasFullySpecified
public void checkWasFullySpecified()
-
of
public <T> T of(T mockObject)
- Specified by:
ofin interfaceReceiverClause
-
of
public MethodClause of(org.hamcrest.Matcher<?> objectMatcher)
- Specified by:
ofin interfaceReceiverClause
-
method
public ParametersClause method(org.hamcrest.Matcher<java.lang.reflect.Method> methodMatcher)
- Specified by:
methodin interfaceMethodClause
-
method
public ParametersClause method(java.lang.String nameRegex)
- Specified by:
methodin interfaceMethodClause
-
with
public void with(org.hamcrest.Matcher<?>... parameterMatchers)
- Specified by:
within interfaceParametersClause
-
withNoArguments
public void withNoArguments()
- Specified by:
withNoArgumentsin interfaceParametersClause
-
-