|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jmock.internal.InvocationExpectation
public class InvocationExpectation
An expectation of zero or more matching invocations.
| Constructor Summary | |
|---|---|
InvocationExpectation()
|
|
| Method Summary | |
|---|---|
void |
addOrderingConstraint(OrderingConstraint orderingConstraint)
|
void |
addSideEffect(SideEffect sideEffect)
|
boolean |
allowsMoreInvocations()
Can more Invocations expected by this Expectation still occur? |
void |
describeMismatch(Invocation invocation,
org.hamcrest.Description description)
|
void |
describeTo(org.hamcrest.Description description)
|
Object |
invoke(Invocation invocation)
Invokes the expectation: records that the invocation has occurred and fakes some behaviour in response. |
boolean |
isSatisfied()
Have enough Invocations expected by this Expectation occurred? |
boolean |
matches(Invocation invocation)
Can the Expectation be invoked with invocation? |
void |
setAction(Action action)
|
void |
setCardinality(Cardinality cardinality)
|
void |
setDefaultAction(Action action)
|
void |
setMethod(Method method)
|
void |
setMethodMatcher(org.hamcrest.Matcher<? super Method> matcher)
|
void |
setObjectMatcher(org.hamcrest.Matcher<?> objectMatcher)
|
void |
setParametersMatcher(ParametersMatcher parametersMatcher)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InvocationExpectation()
| Method Detail |
|---|
public void setCardinality(Cardinality cardinality)
public void setObjectMatcher(org.hamcrest.Matcher<?> objectMatcher)
public void setMethod(Method method)
public void setMethodMatcher(org.hamcrest.Matcher<? super Method> matcher)
public void setParametersMatcher(ParametersMatcher parametersMatcher)
public void addOrderingConstraint(OrderingConstraint orderingConstraint)
public void addSideEffect(SideEffect sideEffect)
public void setAction(Action action)
public void setDefaultAction(Action action)
public void describeTo(org.hamcrest.Description description)
describeTo in interface org.hamcrest.SelfDescribing
public void describeMismatch(Invocation invocation,
org.hamcrest.Description description)
describeMismatch in interface Expectationpublic boolean isSatisfied()
ExpectationInvocations expected by this Expectation occurred?
isSatisfied in interface Expectationtrue if the expectation has received enough
of its expected invocations, false otherwise.public boolean allowsMoreInvocations()
ExpectationInvocations expected by this Expectation still occur?
allowsMoreInvocations in interface Expectationtrue if invocations expected by this expectation can still
occur, false otherwise.public boolean matches(Invocation invocation)
Expectation
matches in interface Expectationtrue if the expectation can be invoked with
invocation, false otherwise.
public Object invoke(Invocation invocation)
throws Throwable
Expectation
invoke in interface Expectationinvocation - The invocation to record and fake.
Throwable - An exception that is eventually thrown from the method call
that caused the invocation.
IllegalStateException - The expectation has been invoked with a method that it doesn't
match or the faked behaviour has been set up incorrectly.
For example, IllegalStateException is thrown when trying to return
a value or throw a checked exception that is incompatible with the
return type of the method being mocked
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||