|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mockejb.interceptor.InvocationRecorder
Stores the information about all calls to the target object
in the list. Clients can examine the list to see the parameters of the calls.
Example of usage:
InvocationRecorder recorder = new InvocationRecorder();
aspectSystem.add( new ClassPointcut( SampleHelper.class, false), recorder);
InvocationContext dummyMethodInvocation = recorder.findByTargetMethod( "dummyMethod");
assertNotNull(dummyMethodInvocation);
Constructor Summary | |
InvocationRecorder()
|
Method Summary | |
void |
clear()
Clears all currently stored invocations |
InvocationContext |
findByInterceptedMethod(java.lang.String methodPattern)
Deprecated. Use findByProxyMethod instead |
InvocationContext |
findByProxyMethod(java.lang.String methodPattern)
Finds the first invocation for a given proxy method pattern. |
InvocationContext |
findByTargetMethod(java.lang.String methodPattern)
Finds the first invocation for a given target method pattern. |
java.util.List |
getMethodInvocationList()
Returns the list of all invocations that happened since the recorder was added. |
boolean |
hasRecords()
Returns true is it has at least one record |
void |
intercept(InvocationContext invocationContext)
Performs pre and post invocation actions for the target object call. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public InvocationRecorder()
Method Detail |
public void intercept(InvocationContext invocationContext) throws java.lang.Exception
Interceptor
intercept
in interface Interceptor
invocationContext
- provides the info about this call. Also calls interceptors in
turn according to their order in the chain. invocationContext provides access to the return value
and thrown exceptions of this call.
java.lang.Exception
public java.util.List getMethodInvocationList()
public boolean hasRecords()
public void clear()
public InvocationContext findByTargetMethod(java.lang.String methodPattern)
methodPattern
- regexp pattern to run against the string representation of a method
public InvocationContext findByInterceptedMethod(java.lang.String methodPattern)
methodPattern
- regexp pattern to run against the string representation of a method
public InvocationContext findByProxyMethod(java.lang.String methodPattern)
methodPattern
- regexp pattern to run against the string representation of a method
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |