Package org.testng.internal
Class MethodInvocationHelper
- java.lang.Object
-
- org.testng.internal.MethodInvocationHelper
-
public class MethodInvocationHelper extends Object
Collections of helper methods to help deal with invocation of TestNG methods- Author:
- Cedric Beust
, nullin
-
-
Constructor Summary
Constructors Constructor Description MethodInvocationHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static void
invokeConfigurable(Object instance, Object[] parameters, IConfigurable configurableInstance, Method thisMethod, ITestResult testResult)
protected static Iterator<Object[]>
invokeDataProvider(Object instance, Method dataProvider, ITestNGMethod method, ITestContext testContext, Object fedInstance, IAnnotationFinder annotationFinder)
protected static void
invokeHookable(Object testInstance, Object[] parameters, IHookable hookable, Method thisMethod, ITestResult testResult)
Invokes therun
method of theIHookable
.protected static Object
invokeMethod(Method thisMethod, Object instance, Object[] parameters)
protected static Object
invokeMethod(Method thisMethod, Object instance, List<Object> parameters)
protected static void
invokeMethodConsideringTimeout(ITestNGMethod tm, ConstructorOrMethod method, Object targetInstance, Object[] params, ITestResult testResult)
protected static Object
invokeMethodNoCheckedException(Method thisMethod, Object instance, List<Object> parameters)
protected static void
invokeWithTimeout(ITestNGMethod tm, Object instance, Object[] parameterValues, ITestResult testResult)
Invokes a method on a separate thread in order to allow us to timeout the invocation.protected static void
invokeWithTimeout(ITestNGMethod tm, Object instance, Object[] parameterValues, ITestResult testResult, IHookable hookable)
-
-
-
Method Detail
-
invokeMethodNoCheckedException
protected static Object invokeMethodNoCheckedException(Method thisMethod, Object instance, List<Object> parameters)
-
invokeMethodConsideringTimeout
protected static void invokeMethodConsideringTimeout(ITestNGMethod tm, ConstructorOrMethod method, Object targetInstance, Object[] params, ITestResult testResult) throws Throwable
- Throws:
Throwable
-
invokeMethod
protected static Object invokeMethod(Method thisMethod, Object instance, List<Object> parameters) throws InvocationTargetException, IllegalAccessException
-
invokeMethod
protected static Object invokeMethod(Method thisMethod, Object instance, Object[] parameters) throws InvocationTargetException, IllegalAccessException
-
invokeDataProvider
protected static Iterator<Object[]> invokeDataProvider(Object instance, Method dataProvider, ITestNGMethod method, ITestContext testContext, Object fedInstance, IAnnotationFinder annotationFinder)
-
invokeHookable
protected static void invokeHookable(Object testInstance, Object[] parameters, IHookable hookable, Method thisMethod, ITestResult testResult) throws Throwable
Invokes therun
method of theIHookable
.- Parameters:
testInstance
- the instance to invoke the method inparameters
- the parameters to be passed toIHookCallBack
thisMethod
- the method to be invoked through theIHookCallBack
testResult
- the currentITestResult
passed toIHookable.run
- Throws:
NoSuchMethodException
IllegalAccessException
InvocationTargetException
Throwable
- thrown if the reflective call to thisMethod results in an exception
-
invokeWithTimeout
protected static void invokeWithTimeout(ITestNGMethod tm, Object instance, Object[] parameterValues, ITestResult testResult) throws InterruptedException, ThreadExecutionException
Invokes a method on a separate thread in order to allow us to timeout the invocation. It uses as implementation anExecutor
and aCountDownLatch
.
-
invokeWithTimeout
protected static void invokeWithTimeout(ITestNGMethod tm, Object instance, Object[] parameterValues, ITestResult testResult, IHookable hookable) throws InterruptedException, ThreadExecutionException
-
invokeConfigurable
protected static void invokeConfigurable(Object instance, Object[] parameters, IConfigurable configurableInstance, Method thisMethod, ITestResult testResult) throws Throwable
- Throws:
Throwable
-
-