|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.testng.internal.MethodHelper
public class MethodHelper
Collection of helper methods to help sort and arrange methods.
| Constructor Summary | |
|---|---|
MethodHelper()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
calculateMethodCanonicalName(java.lang.Class<?> methodClass,
java.lang.String methodName)
|
static java.lang.String |
calculateMethodCanonicalName(ITestNGMethod m)
|
static ITestNGMethod[] |
collectAndOrderConfigurationMethods(java.util.List<ITestNGMethod> methods,
RunInfo runInfo,
IAnnotationFinder finder,
boolean unique,
java.util.List<ITestNGMethod> outExcludedMethods)
|
static ITestNGMethod[] |
collectAndOrderMethods(java.util.List<ITestNGMethod> methods,
RunInfo runInfo,
IAnnotationFinder finder,
java.util.List<ITestNGMethod> outExcludedMethods)
|
static java.util.Iterator<java.lang.Object[]> |
createArrayIterator(java.lang.Object[][] objects)
|
static java.lang.Class<?>[] |
findExpectedExceptions(IAnnotationFinder finder,
java.lang.reflect.Method method)
Read the expected exceptions, if any (need to handle both the old and new syntax |
static java.util.Map<java.lang.String,java.util.List<ITestNGMethod>> |
findGroupsMethods(java.util.Collection<ITestClass> classes,
boolean before)
Extracts the map of groups and their corresponding methods from the classes. |
static void |
findGroupTransitiveClosure(XmlMethodSelector xms,
java.util.List<ITestNGMethod> includedMethods,
java.util.List<ITestNGMethod> allMethods,
java.lang.String[] includedGroups,
java.util.Set<java.lang.String> outGroups,
java.util.Set<ITestNGMethod> outMethods)
|
static ITestNGMethod[] |
findMethodsNamed(java.lang.String mainMethod,
ITestNGMethod[] methods,
java.lang.String[] regexps)
|
static ITestNGMethod[] |
findMethodsThatBelongToGroup(ITestNGMethod method,
ITestNGMethod[] methods,
java.lang.String groupRegexp)
|
static ITestNGMethod[] |
findMethodsThatBelongToGroup(ITestNGMethod method,
java.util.List<ITestNGMethod> methods,
java.lang.String groupRegexp)
|
static java.util.List<ITestNGMethod> |
getMethodsDependedUpon(ITestNGMethod method,
ITestNGMethod[] methods)
|
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)
|
static void |
invokeHookable(java.lang.Object instance,
java.lang.Object[] parameters,
ITestClass testClass,
java.lang.reflect.Method thisMethod,
TestResult testResult)
Invokes the run method of the IHookable. |
static java.lang.Object |
invokeMethod(java.lang.reflect.Method thisMethod,
java.lang.Object instance,
java.lang.Object[] parameters)
|
static void |
invokeWithTimeout(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. |
static boolean |
isEnabled(java.lang.Class<?> objectClass,
IAnnotationFinder finder)
|
static boolean |
isEnabled(ITestOrConfiguration test)
|
static boolean |
isEnabled(java.lang.reflect.Method m,
IAnnotationFinder finder)
|
static void |
ppp(java.lang.String s)
|
static Graph<ITestNGMethod> |
topologicalSort(ITestNGMethod[] methods,
java.util.List<ITestNGMethod> sequentialList,
java.util.List<ITestNGMethod> parallelList)
|
static java.util.List<ITestNGMethod> |
uniqueMethodList(java.util.Collection<java.util.List<ITestNGMethod>> methods)
Extracts the unique list of ITestNGMethods. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MethodHelper()
| Method Detail |
|---|
public static ITestNGMethod[] collectAndOrderMethods(java.util.List<ITestNGMethod> methods,
RunInfo runInfo,
IAnnotationFinder finder,
java.util.List<ITestNGMethod> outExcludedMethods)
public static ITestNGMethod[] collectAndOrderConfigurationMethods(java.util.List<ITestNGMethod> methods,
RunInfo runInfo,
IAnnotationFinder finder,
boolean unique,
java.util.List<ITestNGMethod> outExcludedMethods)
methods -
public static ITestNGMethod[] findMethodsThatBelongToGroup(ITestNGMethod method,
ITestNGMethod[] methods,
java.lang.String groupRegexp)
public static ITestNGMethod[] findMethodsNamed(java.lang.String mainMethod,
ITestNGMethod[] methods,
java.lang.String[] regexps)
public static java.lang.Class<?>[] findExpectedExceptions(IAnnotationFinder finder,
java.lang.reflect.Method method)
public static boolean isEnabled(java.lang.Class<?> objectClass,
IAnnotationFinder finder)
public static boolean isEnabled(java.lang.reflect.Method m,
IAnnotationFinder finder)
public static boolean isEnabled(ITestOrConfiguration test)
public static ITestNGMethod[] findMethodsThatBelongToGroup(ITestNGMethod method,
java.util.List<ITestNGMethod> methods,
java.lang.String groupRegexp)
public static void findGroupTransitiveClosure(XmlMethodSelector xms,
java.util.List<ITestNGMethod> includedMethods,
java.util.List<ITestNGMethod> allMethods,
java.lang.String[] includedGroups,
java.util.Set<java.lang.String> outGroups,
java.util.Set<ITestNGMethod> outMethods)
public static java.util.Map<java.lang.String,java.util.List<ITestNGMethod>> findGroupsMethods(java.util.Collection<ITestClass> classes,
boolean before)
classes.
public static java.util.List<ITestNGMethod> uniqueMethodList(java.util.Collection<java.util.List<ITestNGMethod>> methods)
ITestNGMethods.
public static Graph<ITestNGMethod> topologicalSort(ITestNGMethod[] methods,
java.util.List<ITestNGMethod> sequentialList,
java.util.List<ITestNGMethod> parallelList)
public static java.lang.String calculateMethodCanonicalName(ITestNGMethod m)
public static void ppp(java.lang.String s)
public static java.util.List<ITestNGMethod> getMethodsDependedUpon(ITestNGMethod method,
ITestNGMethod[] methods)
method - allTestMethods -
public 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
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessExceptionpublic static java.util.Iterator<java.lang.Object[]> createArrayIterator(java.lang.Object[][] objects)
public 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)
public static java.lang.String calculateMethodCanonicalName(java.lang.Class<?> methodClass,
java.lang.String methodName)
public static void invokeHookable(java.lang.Object instance,
java.lang.Object[] parameters,
ITestClass testClass,
java.lang.reflect.Method thisMethod,
TestResult testResult)
throws java.lang.NoSuchMethodException,
java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.lang.Throwable
run method of the IHookable.
instance - the instance to invoke the method inparameters - the parameters to be passed to IHookCallBacktestClass - the test classthisMethod - the method to be invoked through the IHookCallBacktestResult - the current ITestResult passed to IHookable.run
java.lang.NoSuchMethodException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.Throwable - thrown if the reflective call to thisMethod results in an exception
public static void invokeWithTimeout(ITestNGMethod tm,
java.lang.Object instance,
java.lang.Object[] parameterValues,
ITestResult testResult)
throws java.lang.InterruptedException,
ThreadExecutionException
Executor and a CountDownLatch.
tm - theinstance - parameterValues - testResult -
java.lang.InterruptedException
ThreadExecutionException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||