Package org.testng.internal.invokers
Class InvokedMethodListenerInvoker
java.lang.Object
org.testng.internal.invokers.InvokedMethodListenerInvoker
Hides complexity of calling methods of
IInvokedMethodListener
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final InvokedMethodListenerMethod
private final ITestContext
private final ITestResult
-
Constructor Summary
ConstructorsConstructorDescriptionInvokedMethodListenerInvoker
(InvokedMethodListenerMethod listenerMethod, ITestResult testResult, ITestContext testContext) Creates a new invoker instance which can be used to call the specifiedlistenerMethod
on any number ofIInvokedMethodListener
s. -
Method Summary
Modifier and TypeMethodDescriptionvoid
invokeListener
(IInvokedMethodListener listenerInstance, IInvokedMethod invokedMethod) Invokes the givenlistenerInstance
, calling the method specified in the constructor of thisInvokedMethodListenerInvoker
.
-
Field Details
-
m_listenerMethod
-
m_testContext
-
m_testResult
-
-
Constructor Details
-
InvokedMethodListenerInvoker
public InvokedMethodListenerInvoker(InvokedMethodListenerMethod listenerMethod, ITestResult testResult, ITestContext testContext) Creates a new invoker instance which can be used to call the specifiedlistenerMethod
on any number ofIInvokedMethodListener
s.- Parameters:
listenerMethod
- method which should be called.testResult
- test result which should be passed to the listener method upon invocation.testContext
- test context which should be passed to the listener method upon invocation. This parameter is only used when calling methods on anIInvokedMethodListener
.
-
-
Method Details
-
invokeListener
Invokes the givenlistenerInstance
, calling the method specified in the constructor of thisInvokedMethodListenerInvoker
.- Parameters:
listenerInstance
- the listener instance which should be invoked.invokedMethod
- theIInvokedMethod
instance which should be passed to theIInvokedMethodListener.beforeInvocation(IInvokedMethod, ITestResult)
,IInvokedMethodListener.afterInvocation(IInvokedMethod, ITestResult)
,IInvokedMethodListener.beforeInvocation(IInvokedMethod, ITestResult, ITestContext)
orIInvokedMethodListener.afterInvocation(IInvokedMethod, ITestResult, ITestContext)
method.
-