Package org.testng.internal.invokers
Class InvokedMethodListenerInvoker
- java.lang.Object
-
- org.testng.internal.invokers.InvokedMethodListenerInvoker
-
public class InvokedMethodListenerInvoker extends java.lang.ObjectHides complexity of calling methods ofIInvokedMethodListenerandIInvokedMethodListener2.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static interfaceInvokedMethodListenerInvoker.InvocationStrategy<LISTENER_TYPE extends IInvokedMethodListener>private static classInvokedMethodListenerInvoker.InvokeAfterInvocationWithContextStrategyprivate static classInvokedMethodListenerInvoker.InvokeAfterInvocationWithoutContextStrategyprivate static classInvokedMethodListenerInvoker.InvokeBeforeInvocationWithContextStrategyprivate static classInvokedMethodListenerInvoker.InvokeBeforeInvocationWithoutContextStrategy
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map<InvokedMethodListenerMethod,InvokedMethodListenerInvoker.InvocationStrategy>INVOKE_WITH_CONTEXT_STRATEGIESprivate static java.util.Map<InvokedMethodListenerMethod,InvokedMethodListenerInvoker.InvocationStrategy>INVOKE_WITHOUT_CONTEXT_STRATEGIESprivate InvokedMethodListenerMethodm_listenerMethodprivate ITestContextm_testContextprivate ITestResultm_testResultprivate static java.util.Map<InvokedMethodListenerSubtype,java.util.Map<InvokedMethodListenerMethod,InvokedMethodListenerInvoker.InvocationStrategy>>strategies
-
Constructor Summary
Constructors Constructor Description InvokedMethodListenerInvoker(InvokedMethodListenerMethod listenerMethod, ITestResult testResult, ITestContext testContext)Creates a new invoker instance which can be used to call the specifiedlistenerMethodon any number ofIInvokedMethodListeners.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinvokeListener(IInvokedMethodListener listenerInstance, IInvokedMethod invokedMethod)Invoke the givenlistenerInstance, calling the method specified in the constructor of thisInvokedMethodListenerInvoker.private InvokedMethodListenerInvoker.InvocationStrategyobtainStrategyFor(IInvokedMethodListener listenerInstance, InvokedMethodListenerMethod listenerMethod)
-
-
-
Field Detail
-
m_listenerMethod
private InvokedMethodListenerMethod m_listenerMethod
-
m_testContext
private ITestContext m_testContext
-
m_testResult
private ITestResult m_testResult
-
strategies
private static final java.util.Map<InvokedMethodListenerSubtype,java.util.Map<InvokedMethodListenerMethod,InvokedMethodListenerInvoker.InvocationStrategy>> strategies
-
INVOKE_WITH_CONTEXT_STRATEGIES
private static final java.util.Map<InvokedMethodListenerMethod,InvokedMethodListenerInvoker.InvocationStrategy> INVOKE_WITH_CONTEXT_STRATEGIES
-
INVOKE_WITHOUT_CONTEXT_STRATEGIES
private static final java.util.Map<InvokedMethodListenerMethod,InvokedMethodListenerInvoker.InvocationStrategy> INVOKE_WITHOUT_CONTEXT_STRATEGIES
-
-
Constructor Detail
-
InvokedMethodListenerInvoker
public InvokedMethodListenerInvoker(InvokedMethodListenerMethod listenerMethod, ITestResult testResult, ITestContext testContext)
Creates a new invoker instance which can be used to call the specifiedlistenerMethodon any number ofIInvokedMethodListeners.- Parameters:
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 anIInvokedMethodListener2.
-
-
Method Detail
-
invokeListener
public void invokeListener(IInvokedMethodListener listenerInstance, IInvokedMethod invokedMethod)
Invoke the givenlistenerInstance, calling the method specified in the constructor of thisInvokedMethodListenerInvoker.- Parameters:
listenerInstance- the listener instance which should be invoked.invokedMethod- theIInvokedMethodinstance which should be passed to theIInvokedMethodListener.beforeInvocation(IInvokedMethod, ITestResult),IInvokedMethodListener.afterInvocation(IInvokedMethod, ITestResult),IInvokedMethodListener2.beforeInvocation(IInvokedMethod, ITestResult, ITestContext)orIInvokedMethodListener2.afterInvocation(IInvokedMethod, ITestResult, ITestContext)method.
-
obtainStrategyFor
private InvokedMethodListenerInvoker.InvocationStrategy obtainStrategyFor(IInvokedMethodListener listenerInstance, InvokedMethodListenerMethod listenerMethod)
-
-