Package org.testng.internal.invokers
Class InvokedMethodListenerInvoker
- java.lang.Object
-
- org.testng.internal.invokers.InvokedMethodListenerInvoker
-
public class InvokedMethodListenerInvoker extends Object
Hides complexity of calling methods ofIInvokedMethodListener
andIInvokedMethodListener2
.- Author:
- Ansgar Konermann
-
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
invokeListener(IInvokedMethodListener listenerInstance, IInvokedMethod invokedMethod)
Invoke the givenlistenerInstance
, calling the method specified in the constructor of thisInvokedMethodListenerInvoker
.
-
-
-
Constructor Detail
-
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 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
- theIInvokedMethod
instance which should be passed to theIInvokedMethodListener.beforeInvocation(IInvokedMethod, ITestResult)
,IInvokedMethodListener.afterInvocation(IInvokedMethod, ITestResult)
,IInvokedMethodListener2.beforeInvocation(IInvokedMethod, ITestResult, ITestContext)
orIInvokedMethodListener2.afterInvocation(IInvokedMethod, ITestResult, ITestContext)
method.
-
-