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
public class InvokedRecorder extends java.lang.Object implements InvocationMatcher
-
-
Constructor Summary
Constructors Constructor Description InvokedRecorder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringBufferdescribeTo(java.lang.StringBuffer buffer)Appends the description of this object to the buffer.intgetInvocationCount()booleanhasBeenInvoked()booleanhasDescription()voidinvoked(Invocation invocation)booleanmatches(Invocation invocation)voidverify()Throw an AssertionFailedException if any expectations have not been met.voidverifyHasBeenInvoked()voidverifyHasBeenInvokedExactly(int expectedCount)
-
-
-
Method Detail
-
getInvocationCount
public int getInvocationCount()
-
hasBeenInvoked
public boolean hasBeenInvoked()
-
matches
public boolean matches(Invocation invocation)
- Specified by:
matchesin interfaceInvocationMatcher
-
invoked
public void invoked(Invocation invocation)
- Specified by:
invokedin interfaceInvocationMatcher
-
hasDescription
public boolean hasDescription()
- Specified by:
hasDescriptionin interfaceInvocationMatcher
-
describeTo
public java.lang.StringBuffer describeTo(java.lang.StringBuffer buffer)
Description copied from interface:SelfDescribingAppends the description of this object to the buffer.- Specified by:
describeToin 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:VerifiableThrow 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:
verifyin interfaceVerifiable
-
verifyHasBeenInvoked
public void verifyHasBeenInvoked()
-
verifyHasBeenInvokedExactly
public void verifyHasBeenInvokedExactly(int expectedCount)
-
-