|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.omnaest.utils.proxy.MethodCallCapturer
public class MethodCallCapturer
A MethodCallCapturer allows to create stubs for given java types which capture the calls of methods of this stub.
MethodName,
BeanProperty,
methodName,
beanProperty,
newInstanceOfCapturedType(Class),
newInstanceOfCapturedTypeWhichIsMethodCallCapturerAware(Class),
newInstanceOfTransitivlyCapturedType(Class),
newInstanceOfTransitivlyCapturedTypeWhichIsMethodCallCapturerAware(Class),
getMethodCallCaptureContextList(),
#getCanonicalMethodNameToMethodCallCaptureMap(),
MethodCallCapture| Nested Class Summary | |
|---|---|
protected static class |
MethodCallCapturer.CapturedTypeInstanceCreationConfiguration
Configuration object when a MethodCallCapturer creates a new stub instance. |
static class |
MethodCallCapturer.MethodCallCaptureContext
Container class for the absolute canonical method name when a MethodCallCapture instance has been captured. |
static interface |
MethodCallCapturer.MethodCallCapturerAware
This interface stubs are implementing when they are created by newInstanceOfCapturedTypeWhichIsMethodCallCapturerAware(Class). |
protected class |
MethodCallCapturer.MethodCaptureMethodInvocationHandler
MethodInterceptor for the MethodCallCapturer. |
static class |
MethodCallCapturer.ReplayResult
Result of a replay action. |
static interface |
MethodCallCapturer.TypeCaptureAware
This interface stubs are always implementing when they are created by newInstanceOfCapturedType(Class). |
| Field Summary | |
|---|---|
BeanProperty |
beanProperty
|
protected Object |
lastActiveRootStub
|
MethodName |
methodName
|
protected Map<Object,List<MethodCallCapturer.MethodCallCaptureContext>> |
stubToMethodCallCaptureContextListMap
|
| Constructor Summary | |
|---|---|
MethodCallCapturer()
|
|
| Method Summary | ||
|---|---|---|
List<String> |
getCapturedCanonicalMethodNameList()
Returns a new list of all captured canonical method names for the last active stub object in order of their invocation. |
|
List<String> |
getCapturedCanonicalMethodNameList(Object stub)
Returns a new list of all captured canonical method names for a given stub object in order of their invocation. |
|
List<String> |
getCapturedCanonicalMethodNameListWithMergedHierarchyCalls()
Returns a List of the canonical method names captured by the last active stub. |
|
List<String> |
getCapturedCanonicalMethodNameListWithMergedHierarchyCalls(Object stub)
Returns a List of the canonical method names captured by the given stub but with all hierarchical calls like
testInterface.doTestSubInterface().doCalculateSomething() which result in
testInterface
testInterface.doTestSubInterface
testInterface.doTestSubInterface.doCalculateSomething
merged into a single representation like:
testInterface.doTestSubInterface.doCalculateSomething
|
|
List<String> |
getCapturedCanonicalPropertyNameList()
Returns a new list of all captured canonical property names for the last active stub object in order of their invocation. |
|
List<String> |
getCapturedCanonicalPropertyNameList(Object stub)
Returns a new list of all captured canonical property names for a given stub object in order of their invocation. |
|
List<String> |
getCapturedCanonicalPropertyNameListWithMergedHierarchyCalls()
Returns a List of the canonical property names captured by the last active stub. |
|
List<String> |
getCapturedCanonicalPropertyNameListWithMergedHierarchyCalls(Object stub)
Returns a List of the canonical method names captured by the given stub but with all hierarchical calls like
testInterface.doTestSubInterface().doCalculateSomething() which result in
testInterface
testInterface.fieldObject
testInterface.fieldObject.fieldString
merged into a single representation like:
testInterface.fieldObject.fieldString
|
|
MethodCallCapturer.MethodCallCaptureContext |
getLastMethodCallContext()
Returns the last MethodCallCapturer.MethodCallCaptureContext which has been reported to this MethodCallCapturer. |
|
List<MethodCallCapturer.MethodCallCaptureContext> |
getMethodCallCaptureContextList()
Returns a new list instance of all MethodCallCapturer.MethodCallCaptureContext instances. |
|
List<MethodCallCapturer.MethodCallCaptureContext> |
getMethodCallCaptureContextList(Object stub)
Returns a new list instance of all MethodCallCapturer.MethodCallCaptureContext instances for a given stub instance. |
|
List<MethodCallCapturer.MethodCallCaptureContext> |
getMethodCallCaptureContextWithMergedHierarchyList()
Returns a new list instance of all MethodCallCapturer.MethodCallCaptureContext instances for the last active stub instance. |
|
List<MethodCallCapturer.MethodCallCaptureContext> |
getMethodCallCaptureContextWithMergedHierarchyList(Object stub)
Returns a new list instance of all MethodCallCapturer.MethodCallCaptureContext instances for a given stub instance. |
|
protected List<MethodCallCapturer.MethodCallCaptureContext> |
getOrCreateMethodCallCaptureContextListForStub(Object stub)
Gets an available list for the given proxy object or creates a new one. |
|
protected void |
mergeHierarchicalMethodCallCaptureContextList(List<MethodCallCapturer.MethodCallCaptureContext> hierarchicalMethodCallCaptureContextList)
Merges hierarchies of MethodCallCapturer.MethodCallCaptureContexts into the most nested MethodCallCapturer.MethodCallCaptureContext for each group
of MethodCallCapturer.MethodCallCaptureContexts |
|
protected void |
mergeHierarchicalNameList(List<String> hierarchicalNameList)
Merges a list of hierarchical names. |
|
|
newInstanceOfCapturedType(Class<? extends E> clazz)
Creates a new stub instance for the given class or interface which records all method invocations to this MethodCallCapturer. |
|
protected
|
newInstanceOfCapturedType(MethodCallCapturer.CapturedTypeInstanceCreationConfiguration capturedTypeInstanceCreationConfiguration)
|
|
|
newInstanceOfCapturedTypeWhichIsMethodCallCapturerAware(Class<? extends E> clazz)
Creates a new instance like newInstanceOfCapturedType(Class) but makes the created stub implementing the
MethodCallCapturer.MethodCallCapturerAware interface which allows to get the underlying MethodCallCapturer through the generated
stub. |
|
|
newInstanceOfTransitivlyCapturedType(Class<? extends E> clazz)
Does create stubs whose objects returned by method invocations are stubs themselves. |
|
|
newInstanceOfTransitivlyCapturedTypeWhichIsMethodCallCapturerAware(Class<? extends E> clazz)
Creates a stub which implements the MethodCallCapturer.MethodCallCapturerAware interface and which generates method returned objects
which are stubs, too. |
|
|
replay(E object)
Replays the method invocations done to the last active stub for the given object like the object would have been invoked in the first place. |
|
|
replay(E stub,
E object)
Replays the method invocations done to the given stub for the given object like the object would have been invoked in the first place. |
|
MethodCallCapturer |
reset()
Resets the MethodCallCapturer. |
|
MethodCallCapturer |
reset(Object stub)
Clears the captured method calls for a special stub object. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final MethodName methodName
public final BeanProperty beanProperty
protected final Map<Object,List<MethodCallCapturer.MethodCallCaptureContext>> stubToMethodCallCaptureContextListMap
protected Object lastActiveRootStub
| Constructor Detail |
|---|
public MethodCallCapturer()
MethodCallCapturer| Method Detail |
|---|
public <E> E newInstanceOfCapturedType(Class<? extends E> clazz)
MethodCallCapturer.
getMethodCallCaptureContextList(),
MethodCallCapturer#getCanonicalMethodNameToMethodCallCaptureMap(),
#methodNameOf(Object)public <E> E newInstanceOfCapturedTypeWhichIsMethodCallCapturerAware(Class<? extends E> clazz)
newInstanceOfCapturedType(Class) but makes the created stub implementing the
MethodCallCapturer.MethodCallCapturerAware interface which allows to get the underlying MethodCallCapturer through the generated
stub.
E - clazz -
newInstanceOfCapturedType(Class)public <E> E newInstanceOfTransitivlyCapturedType(Class<? extends E> clazz)
E - clazz -
newInstanceOfCapturedType(Class),
#methodNameOf(Object)public <E> E newInstanceOfTransitivlyCapturedTypeWhichIsMethodCallCapturerAware(Class<? extends E> clazz)
MethodCallCapturer.MethodCallCapturerAware interface and which generates method returned objects
which are stubs, too.
E - clazz -
newInstanceOfCapturedType(Class),
newInstanceOfCapturedTypeWhichIsMethodCallCapturerAware(Class),
newInstanceOfTransitivlyCapturedType(Class)protected <E> E newInstanceOfCapturedType(MethodCallCapturer.CapturedTypeInstanceCreationConfiguration capturedTypeInstanceCreationConfiguration)
E - capturedTypeInstanceCreationConfiguration -
newInstanceOfCapturedType(Class),
newInstanceOfCapturedTypeWhichIsMethodCallCapturerAware(Class),
newInstanceOfTransitivlyCapturedType(Class),
newInstanceOfTransitivlyCapturedTypeWhichIsMethodCallCapturerAware(Class)protected List<MethodCallCapturer.MethodCallCaptureContext> getOrCreateMethodCallCaptureContextListForStub(Object stub)
stub -
public List<MethodCallCapturer.MethodCallCaptureContext> getMethodCallCaptureContextList()
MethodCallCapturer.MethodCallCaptureContext instances.
public List<MethodCallCapturer.MethodCallCaptureContext> getMethodCallCaptureContextList(Object stub)
MethodCallCapturer.MethodCallCaptureContext instances for a given stub instance.
stub -
public List<MethodCallCapturer.MethodCallCaptureContext> getMethodCallCaptureContextWithMergedHierarchyList()
MethodCallCapturer.MethodCallCaptureContext instances for the last active stub instance. All
MethodCallCapturer.MethodCallCaptureContext instances coming before an MethodCallCapturer.MethodCallCaptureContext which is based on a nested call
within the previous context will be merged into the nested call MethodCallCapturer.MethodCallCaptureContext.
public List<MethodCallCapturer.MethodCallCaptureContext> getMethodCallCaptureContextWithMergedHierarchyList(Object stub)
MethodCallCapturer.MethodCallCaptureContext instances for a given stub instance. All
MethodCallCapturer.MethodCallCaptureContext instances coming before an MethodCallCapturer.MethodCallCaptureContext which is based on a nested call
within the previous context will be merged into the nested call MethodCallCapturer.MethodCallCaptureContext.
stub -
public MethodCallCapturer.MethodCallCaptureContext getLastMethodCallContext()
MethodCallCapturer.MethodCallCaptureContext which has been reported to this MethodCallCapturer.
public MethodCallCapturer reset()
MethodCallCapturer.
public MethodCallCapturer reset(Object stub)
stub -
public List<String> getCapturedCanonicalPropertyNameList()
getCapturedCanonicalMethodNameList()public List<String> getCapturedCanonicalPropertyNameList(Object stub)
stub -
getCapturedCanonicalMethodNameList()public List<String> getCapturedCanonicalMethodNameList(Object stub)
stub -
getCapturedCanonicalMethodNameList()public List<String> getCapturedCanonicalMethodNameList()
getCapturedCanonicalMethodNameListWithMergedHierarchyCalls(Object)public List<String> getCapturedCanonicalMethodNameListWithMergedHierarchyCalls()
List of the canonical method names captured by the last active stub.
getCapturedCanonicalMethodNameListWithMergedHierarchyCalls(Object)public List<String> getCapturedCanonicalPropertyNameListWithMergedHierarchyCalls()
List of the canonical property names captured by the last active stub.
getCapturedCanonicalPropertyNameListWithMergedHierarchyCalls(Object)public List<String> getCapturedCanonicalPropertyNameListWithMergedHierarchyCalls(Object stub)
List of the canonical method names captured by the given stub but with all hierarchical calls like
testInterface.doTestSubInterface().doCalculateSomething() which result in
stub -
getCapturedCanonicalPropertyNameListWithMergedHierarchyCalls(),
getCapturedCanonicalMethodNameListWithMergedHierarchyCalls(Object)public List<String> getCapturedCanonicalMethodNameListWithMergedHierarchyCalls(Object stub)
List of the canonical method names captured by the given stub but with all hierarchical calls like
testInterface.doTestSubInterface().doCalculateSomething() which result in
stub -
getCapturedCanonicalMethodNameList(),
getCapturedCanonicalMethodNameListWithMergedHierarchyCalls()protected void mergeHierarchicalNameList(List<String> hierarchicalNameList)
testInterface.doTestSubInterface().doCalculateSomething() which result
in
hierarchicalNameList - protected void mergeHierarchicalMethodCallCaptureContextList(List<MethodCallCapturer.MethodCallCaptureContext> hierarchicalMethodCallCaptureContextList)
MethodCallCapturer.MethodCallCaptureContexts into the most nested MethodCallCapturer.MethodCallCaptureContext for each group
of MethodCallCapturer.MethodCallCaptureContexts
hierarchicalMethodCallCaptureContextList - public <E> MethodCallCapturer.ReplayResult replay(E object)
object - replay(Object, Object)
public <E> MethodCallCapturer.ReplayResult replay(E stub,
E object)
stub - object -
MethodCallCapturer.ReplayResultreplay(Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||