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 voidinvokeConfigurable(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 voidinvokeHookable(Object testInstance, Object[] parameters, IHookable hookable, Method thisMethod, ITestResult testResult)Invokes therunmethod of theIHookable.protected static ObjectinvokeMethod(Method thisMethod, Object instance, Object[] parameters)protected static ObjectinvokeMethod(Method thisMethod, Object instance, List<Object> parameters)protected static voidinvokeMethodConsideringTimeout(ITestNGMethod tm, ConstructorOrMethod method, Object targetInstance, Object[] params, ITestResult testResult)protected static ObjectinvokeMethodNoCheckedException(Method thisMethod, Object instance, List<Object> parameters)protected static voidinvokeWithTimeout(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 voidinvokeWithTimeout(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 therunmethod of theIHookable.- Parameters:
testInstance- the instance to invoke the method inparameters- the parameters to be passed toIHookCallBackthisMethod- the method to be invoked through theIHookCallBacktestResult- the currentITestResultpassed toIHookable.run- Throws:
NoSuchMethodExceptionIllegalAccessExceptionInvocationTargetExceptionThrowable- 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 anExecutorand 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
-
-