Top Description Constructors Methods
org.testng.internal.invokers

public Class MethodInvocationHelper

extends Object
Class Inheritance
Imports
java.lang.reflect.Constructor, .InvocationTargetException, .Method, .Modifier, .ParameterizedType, .Type, java.util.ArrayList, .Collection, .Iterator, .List, .Optional, java.util.concurrent.ExecutionException, .ExecutorService, .Future, .ThreadFactory, .ThreadPoolExecutor, .TimeUnit, java.util.concurrent.atomic.AtomicBoolean, .AtomicReference, java.util.function.Consumer, org.testng.IConfigurable, .IConfigureCallBack, .IHookCallBack, .IHookable, .ITestContext, .ITestNGMethod, .ITestResult, .TestNGException, .TestNotInvokedException, org.testng.internal.ConstructorOrMethod, .IConfiguration, .MethodHelper, .Utils, org.testng.internal.annotations.IAnnotationFinder, org.testng.internal.collections.ArrayIterator, .OneToTwoDimArrayIterator, .OneToTwoDimIterator, .Pair, org.testng.internal.invokers.InvokeMethodRunnable.TestNGRuntimeException, org.testng.internal.thread.TestNGThreadFactory, .ThreadExecutionException, .ThreadTimeoutException, .ThreadUtil, org.testng.xml.XmlSuite

Collections of helper methods to help deal with invocation of TestNG methods

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static boolean
canAccess(Method thisMethod)

private static List<Object>
getParameters(Method dataProvider, ITestNGMethod method, ITestContext testContext, Object fedInstance, IAnnotationFinder annotationFinder)

private static StackTraceElement[]
protected static boolean
invokeConfigurable(final Object instance, final Object[] parameters, final IConfigurable configurableInstance, final Method thisMethod, final ITestResult testResult)

public static Iterator<Object[]>
invokeDataProvider(Object instance, Method dataProvider, ITestNGMethod method, ITestContext testContext, Object fedInstance, IAnnotationFinder annotationFinder)

protected static boolean
invokeHookable(final Object testInstance, final Object[] parameters, final IHookable hookable, final Method thisMethod, final ITestResult testResult)

protected static Object
invokeMethod(Method thisMethod, Object instance, List<Object> parameters)

protected static Object
invokeMethod(Method thisMethod, Object instance, Object[] parameters)

protected static void
protected static Object
invokeMethodNoCheckedException(Method thisMethod, Object instance, List<Object> parameters)

protected static void
invokeWithTimeout(IConfiguration config, 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 boolean
invokeWithTimeout(IConfiguration config, ITestNGMethod tm, Object instance, Object[] parameterValues, ITestResult testResult, IHookable hookable)

private static boolean
invokeWithTimeoutWithNewExecutor(IConfiguration configuration, ITestNGMethod tm, Object instance, Object[] parameterValues, ITestResult testResult, IHookable hookable)

private static boolean
invokeWithTimeoutWithNoExecutor(ITestNGMethod tm, Object instance, Object[] parameterValues, ITestResult testResult, IHookable hookable)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MethodInvocationHelperback to summary
public MethodInvocationHelper()

Method Detail

canAccessback to summary
private static boolean canAccess(Method thisMethod)
Annotations
@SuppressWarnings:deprecation
getParametersback to summary
private static List<Object> getParameters(Method dataProvider, ITestNGMethod method, ITestContext testContext, Object fedInstance, IAnnotationFinder annotationFinder)
getRunningMethodStackTraceback to summary
private static StackTraceElement[] getRunningMethodStackTrace(ExecutorService exec)
invokeConfigurableback to summary
protected static boolean invokeConfigurable(final Object instance, final Object[] parameters, final IConfigurable configurableInstance, final Method thisMethod, final ITestResult testResult) throws Throwable
invokeDataProviderback to summary
public static Iterator<Object[]> invokeDataProvider(Object instance, Method dataProvider, ITestNGMethod method, ITestContext testContext, Object fedInstance, IAnnotationFinder annotationFinder)
Annotations
@SuppressWarnings:unchecked
invokeHookableback to summary
protected static boolean invokeHookable(final Object testInstance, final Object[] parameters, final IHookable hookable, final Method thisMethod, final ITestResult testResult) throws Throwable
invokeMethodback to summary
protected static Object invokeMethod(Method thisMethod, Object instance, List<Object> parameters) throws InvocationTargetException, IllegalAccessException
invokeMethodback to summary
protected static Object invokeMethod(Method thisMethod, Object instance, Object[] parameters) throws InvocationTargetException, IllegalAccessException
invokeMethodConsideringTimeoutback to summary
protected static void invokeMethodConsideringTimeout(ITestNGMethod tm, ConstructorOrMethod method, Object targetInstance, Object[] params, ITestResult testResult, IConfiguration config) throws Throwable
invokeMethodNoCheckedExceptionback to summary
protected static Object invokeMethodNoCheckedException(Method thisMethod, Object instance, List<Object> parameters)
invokeWithTimeoutback to summary
protected static void invokeWithTimeout(IConfiguration config, 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 an Executor and a CountDownLatch.

invokeWithTimeoutback to summary
protected static boolean invokeWithTimeout(IConfiguration config, ITestNGMethod tm, Object instance, Object[] parameterValues, ITestResult testResult, IHookable hookable) throws InterruptedException, ThreadExecutionException
invokeWithTimeoutWithNewExecutorback to summary
private static boolean invokeWithTimeoutWithNewExecutor(IConfiguration configuration, ITestNGMethod tm, Object instance, Object[] parameterValues, ITestResult testResult, IHookable hookable) throws InterruptedException, ThreadExecutionException
invokeWithTimeoutWithNoExecutorback to summary
private static boolean invokeWithTimeoutWithNoExecutor(ITestNGMethod tm, Object instance, Object[] parameterValues, ITestResult testResult, IHookable hookable)