public class InvokedMethodListenerInvoker
extends java.lang.Object
IInvokedMethodListener
and
IInvokedMethodListener2
.Modifier and Type | Class and Description |
---|---|
private static interface |
InvokedMethodListenerInvoker.InvocationStrategy<LISTENER_TYPE extends IInvokedMethodListener> |
private static class |
InvokedMethodListenerInvoker.InvokeAfterInvocationWithContextStrategy |
private static class |
InvokedMethodListenerInvoker.InvokeAfterInvocationWithoutContextStrategy |
private static class |
InvokedMethodListenerInvoker.InvokeBeforeInvocationWithContextStrategy |
private static class |
InvokedMethodListenerInvoker.InvokeBeforeInvocationWithoutContextStrategy |
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<InvokedMethodListenerMethod,InvokedMethodListenerInvoker.InvocationStrategy> |
INVOKE_WITH_CONTEXT_STRATEGIES |
private static java.util.Map<InvokedMethodListenerMethod,InvokedMethodListenerInvoker.InvocationStrategy> |
INVOKE_WITHOUT_CONTEXT_STRATEGIES |
private InvokedMethodListenerMethod |
m_listenerMethod |
private ITestContext |
m_testContext |
private ITestResult |
m_testResult |
private static java.util.Map<InvokedMethodListenerSubtype,java.util.Map<InvokedMethodListenerMethod,InvokedMethodListenerInvoker.InvocationStrategy>> |
strategies |
Constructor and Description |
---|
InvokedMethodListenerInvoker(InvokedMethodListenerMethod listenerMethod,
ITestResult testResult,
ITestContext testContext)
Creates a new invoker instance which can be used to call the specified
listenerMethod
on any number of IInvokedMethodListener s. |
Modifier and Type | Method and Description |
---|---|
void |
invokeListener(IInvokedMethodListener listenerInstance,
IInvokedMethod invokedMethod)
Invoke the given
listenerInstance , calling the method specified in the constructor of
this InvokedMethodListenerInvoker . |
private InvokedMethodListenerInvoker.InvocationStrategy |
obtainStrategyFor(IInvokedMethodListener listenerInstance,
InvokedMethodListenerMethod listenerMethod) |
private InvokedMethodListenerMethod m_listenerMethod
private ITestContext m_testContext
private ITestResult m_testResult
private static final java.util.Map<InvokedMethodListenerSubtype,java.util.Map<InvokedMethodListenerMethod,InvokedMethodListenerInvoker.InvocationStrategy>> strategies
private static final java.util.Map<InvokedMethodListenerMethod,InvokedMethodListenerInvoker.InvocationStrategy> INVOKE_WITH_CONTEXT_STRATEGIES
private static final java.util.Map<InvokedMethodListenerMethod,InvokedMethodListenerInvoker.InvocationStrategy> INVOKE_WITHOUT_CONTEXT_STRATEGIES
public InvokedMethodListenerInvoker(InvokedMethodListenerMethod listenerMethod, ITestResult testResult, ITestContext testContext)
listenerMethod
on any number of IInvokedMethodListener
s.listenerMethod
- method which should be calledtestResult
- test result which should be passed to the listener method upon invocationtestContext
- test context which should be passed to the listener method upon invocation.
This parameter is only used when calling methods on an IInvokedMethodListener2
.public void invokeListener(IInvokedMethodListener listenerInstance, IInvokedMethod invokedMethod)
listenerInstance
, calling the method specified in the constructor of
this InvokedMethodListenerInvoker
.listenerInstance
- the listener instance which should be invoked.invokedMethod
- the IInvokedMethod
instance which should be passed to the
IInvokedMethodListener.beforeInvocation(IInvokedMethod, ITestResult)
,
IInvokedMethodListener.afterInvocation(IInvokedMethod, ITestResult)
,
IInvokedMethodListener2.beforeInvocation(IInvokedMethod, ITestResult, ITestContext)
or IInvokedMethodListener2.afterInvocation(IInvokedMethod, ITestResult, ITestContext)
method.private InvokedMethodListenerInvoker.InvocationStrategy obtainStrategyFor(IInvokedMethodListener listenerInstance, InvokedMethodListenerMethod listenerMethod)