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<?>>
capturedParameterMatchers
private InvocationExpectation
expectation
private boolean
isFullySpecified
private boolean
needsDefaultAction
-
Constructor Summary
Constructors Constructor Description InvocationExpectationBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInSequenceOrderingConstraint(Sequence sequence)
void
addOrderingConstraint(OrderingConstraint constraint)
void
addParameterMatcher(org.hamcrest.Matcher<?> matcher)
void
addSideEffect(SideEffect sideEffect)
private <T> T
asMockedType(T mockObject, java.lang.Object capturingImposter)
private <T> T
captureExpectedObject(T mockObject)
private void
checkParameterMatcherCount(Invocation invocation)
void
checkWasFullySpecified()
void
createExpectationFrom(Invocation invocation)
ParametersClause
method(java.lang.String nameRegex)
ParametersClause
method(org.hamcrest.Matcher<java.lang.reflect.Method> methodMatcher)
MethodClause
of(org.hamcrest.Matcher<?> objectMatcher)
<T> T
of(T mockObject)
void
setAction(Action action)
void
setCardinality(Cardinality cardinality)
Expectation
toExpectation(Action defaultAction)
void
with(org.hamcrest.Matcher<?>... parameterMatchers)
void
withNoArguments()
-
-
-
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:
createExpectationFrom
in interfaceExpectationCapture
-
checkParameterMatcherCount
private void checkParameterMatcherCount(Invocation invocation)
-
checkWasFullySpecified
public void checkWasFullySpecified()
-
of
public <T> T of(T mockObject)
- Specified by:
of
in interfaceReceiverClause
-
of
public MethodClause of(org.hamcrest.Matcher<?> objectMatcher)
- Specified by:
of
in interfaceReceiverClause
-
method
public ParametersClause method(org.hamcrest.Matcher<java.lang.reflect.Method> methodMatcher)
- Specified by:
method
in interfaceMethodClause
-
method
public ParametersClause method(java.lang.String nameRegex)
- Specified by:
method
in interfaceMethodClause
-
with
public void with(org.hamcrest.Matcher<?>... parameterMatchers)
- Specified by:
with
in interfaceParametersClause
-
withNoArguments
public void withNoArguments()
- Specified by:
withNoArguments
in interfaceParametersClause
-
-