Package org.testng.internal
Class MethodInvocationHelper
java.lang.Object
org.testng.internal.MethodInvocationHelper
Collections of helper methods to help deal with invocation of TestNG methods
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
getParameters
(Method dataProvider, ITestNGMethod method, ITestContext testContext, Object fedInstance, IAnnotationFinder annotationFinder) protected static void
invokeConfigurable
(Object instance, Object[] parameters, IConfigurable configurableInstance, Method thisMethod, ITestResult testResult) 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) 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) private static void
invokeWithTimeoutWithNewExecutor
(ITestNGMethod tm, Object instance, Object[] parameterValues, ITestResult testResult, IHookable hookable) private static void
invokeWithTimeoutWithNoExecutor
(ITestNGMethod tm, Object instance, Object[] parameterValues, ITestResult testResult, IHookable hookable)
-
Constructor Details
-
MethodInvocationHelper
public MethodInvocationHelper()
-
-
Method Details
-
invokeMethodNoCheckedException
-
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) -
getParameters
private static List<Object> getParameters(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 - Throws:
Throwable
-
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 -
cleanInterruptStatus
private static void cleanInterruptStatus() -
invokeWithTimeoutWithNoExecutor
private static void invokeWithTimeoutWithNoExecutor(ITestNGMethod tm, Object instance, Object[] parameterValues, ITestResult testResult, IHookable hookable) -
invokeWithTimeoutWithNewExecutor
private static void invokeWithTimeoutWithNewExecutor(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
-