Package org.testng.internal
Class MethodInvocationHelper
- java.lang.Object
-
- org.testng.internal.MethodInvocationHelper
-
public class MethodInvocationHelper extends java.lang.ObjectCollections of helper methods to help deal with invocation of TestNG methods
-
-
Constructor Summary
Constructors Constructor Description MethodInvocationHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static voidcleanInterruptStatus()private static java.util.List<java.lang.Object>getParameters(java.lang.reflect.Method dataProvider, ITestNGMethod method, ITestContext testContext, java.lang.Object fedInstance, IAnnotationFinder annotationFinder)protected static voidinvokeConfigurable(java.lang.Object instance, java.lang.Object[] parameters, IConfigurable configurableInstance, java.lang.reflect.Method thisMethod, ITestResult testResult)protected static java.util.Iterator<java.lang.Object[]>invokeDataProvider(java.lang.Object instance, java.lang.reflect.Method dataProvider, ITestNGMethod method, ITestContext testContext, java.lang.Object fedInstance, IAnnotationFinder annotationFinder)protected static voidinvokeHookable(java.lang.Object testInstance, java.lang.Object[] parameters, IHookable hookable, java.lang.reflect.Method thisMethod, ITestResult testResult)protected static java.lang.ObjectinvokeMethod(java.lang.reflect.Method thisMethod, java.lang.Object instance, java.lang.Object[] parameters)protected static java.lang.ObjectinvokeMethod(java.lang.reflect.Method thisMethod, java.lang.Object instance, java.util.List<java.lang.Object> parameters)protected static voidinvokeMethodConsideringTimeout(ITestNGMethod tm, ConstructorOrMethod method, java.lang.Object targetInstance, java.lang.Object[] params, ITestResult testResult)protected static java.lang.ObjectinvokeMethodNoCheckedException(java.lang.reflect.Method thisMethod, java.lang.Object instance, java.util.List<java.lang.Object> parameters)protected static voidinvokeWithTimeout(ITestNGMethod tm, java.lang.Object instance, java.lang.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, java.lang.Object instance, java.lang.Object[] parameterValues, ITestResult testResult, IHookable hookable)private static voidinvokeWithTimeoutWithNewExecutor(ITestNGMethod tm, java.lang.Object instance, java.lang.Object[] parameterValues, ITestResult testResult, IHookable hookable)private static voidinvokeWithTimeoutWithNoExecutor(ITestNGMethod tm, java.lang.Object instance, java.lang.Object[] parameterValues, ITestResult testResult, IHookable hookable)
-
-
-
Method Detail
-
invokeMethodNoCheckedException
protected static java.lang.Object invokeMethodNoCheckedException(java.lang.reflect.Method thisMethod, java.lang.Object instance, java.util.List<java.lang.Object> parameters)
-
invokeMethodConsideringTimeout
protected static void invokeMethodConsideringTimeout(ITestNGMethod tm, ConstructorOrMethod method, java.lang.Object targetInstance, java.lang.Object[] params, ITestResult testResult) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
invokeMethod
protected static java.lang.Object invokeMethod(java.lang.reflect.Method thisMethod, java.lang.Object instance, java.util.List<java.lang.Object> parameters) throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException- Throws:
java.lang.reflect.InvocationTargetExceptionjava.lang.IllegalAccessException
-
invokeMethod
protected static java.lang.Object invokeMethod(java.lang.reflect.Method thisMethod, java.lang.Object instance, java.lang.Object[] parameters) throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException- Throws:
java.lang.reflect.InvocationTargetExceptionjava.lang.IllegalAccessException
-
invokeDataProvider
protected static java.util.Iterator<java.lang.Object[]> invokeDataProvider(java.lang.Object instance, java.lang.reflect.Method dataProvider, ITestNGMethod method, ITestContext testContext, java.lang.Object fedInstance, IAnnotationFinder annotationFinder)
-
getParameters
private static java.util.List<java.lang.Object> getParameters(java.lang.reflect.Method dataProvider, ITestNGMethod method, ITestContext testContext, java.lang.Object fedInstance, IAnnotationFinder annotationFinder)
-
invokeHookable
protected static void invokeHookable(java.lang.Object testInstance, java.lang.Object[] parameters, IHookable hookable, java.lang.reflect.Method thisMethod, ITestResult testResult) throws java.lang.Throwable- Throws:
java.lang.Throwable
-
invokeWithTimeout
protected static void invokeWithTimeout(ITestNGMethod tm, java.lang.Object instance, java.lang.Object[] parameterValues, ITestResult testResult) throws java.lang.InterruptedException, ThreadExecutionException
Invokes a method on a separate thread in order to allow us to timeout the invocation. It uses as implementation anExecutorand aCountDownLatch.- Throws:
java.lang.InterruptedExceptionThreadExecutionException
-
invokeWithTimeout
protected static void invokeWithTimeout(ITestNGMethod tm, java.lang.Object instance, java.lang.Object[] parameterValues, ITestResult testResult, IHookable hookable) throws java.lang.InterruptedException, ThreadExecutionException
- Throws:
java.lang.InterruptedExceptionThreadExecutionException
-
cleanInterruptStatus
private static void cleanInterruptStatus()
-
invokeWithTimeoutWithNoExecutor
private static void invokeWithTimeoutWithNoExecutor(ITestNGMethod tm, java.lang.Object instance, java.lang.Object[] parameterValues, ITestResult testResult, IHookable hookable)
-
invokeWithTimeoutWithNewExecutor
private static void invokeWithTimeoutWithNewExecutor(ITestNGMethod tm, java.lang.Object instance, java.lang.Object[] parameterValues, ITestResult testResult, IHookable hookable) throws java.lang.InterruptedException, ThreadExecutionException
- Throws:
java.lang.InterruptedExceptionThreadExecutionException
-
invokeConfigurable
protected static void invokeConfigurable(java.lang.Object instance, java.lang.Object[] parameters, IConfigurable configurableInstance, java.lang.reflect.Method thisMethod, ITestResult testResult) throws java.lang.Throwable- Throws:
java.lang.Throwable
-
-