Package org.jmock.core.matcher
Class InvokedRecorder
java.lang.Object
org.jmock.core.matcher.InvokedRecorder
- All Implemented Interfaces:
InvocationMatcher
,SelfDescribing
,Verifiable
- Direct Known Subclasses:
InvokeAtLeastOnceMatcher
,InvokeAtMostOnceMatcher
,InvokeCountMatcher
,InvokeOnceMatcher
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondescribeTo
(StringBuffer buffer) Appends the description of this object to the buffer.int
boolean
boolean
void
invoked
(Invocation invocation) boolean
matches
(Invocation invocation) void
verify()
Throw an AssertionFailedException if any expectations have not been met.void
void
verifyHasBeenInvokedExactly
(int expectedCount)
-
Constructor Details
-
InvokedRecorder
public InvokedRecorder()
-
-
Method Details
-
getInvocationCount
public int getInvocationCount() -
hasBeenInvoked
public boolean hasBeenInvoked() -
matches
- Specified by:
matches
in interfaceInvocationMatcher
-
invoked
- Specified by:
invoked
in interfaceInvocationMatcher
-
hasDescription
public boolean hasDescription()- Specified by:
hasDescription
in interfaceInvocationMatcher
-
describeTo
Description copied from interface:SelfDescribing
Appends the description of this object to the buffer.- Specified by:
describeTo
in interfaceSelfDescribing
- Parameters:
buffer
- The buffer that the description is appended to.- Returns:
- The buffer passed to the invokedMethod.
-
verify
public void verify()Description copied from interface:Verifiable
Throw an AssertionFailedException if any expectations have not been met. Implementations of this method must be idempotent: jMock can call this method more than once when verifying expectations at the end of a test.- Specified by:
verify
in interfaceVerifiable
-
verifyHasBeenInvoked
public void verifyHasBeenInvoked() -
verifyHasBeenInvokedExactly
public void verifyHasBeenInvokedExactly(int expectedCount)
-