Package org.testng.internal
Class MethodHelper
- java.lang.Object
-
- org.testng.internal.MethodHelper
-
public class MethodHelper extends Object
Collection of helper methods to help sort and arrange methods.- Author:
- Cedric Beust, Alexandru Popescu
-
-
Constructor Summary
Constructors Constructor Description MethodHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static String
calculateMethodCanonicalName(Class<?> methodClass, String methodName)
protected static String
calculateMethodCanonicalName(ITestNGMethod m)
protected static long
calculateTimeOut(ITestNGMethod tm)
static ITestNGMethod[]
collectAndOrderMethods(List<ITestNGMethod> methods, boolean forTests, RunInfo runInfo, IAnnotationFinder finder, boolean unique, List<ITestNGMethod> outExcludedMethods, Comparator<ITestNGMethod> comparator)
Collects and orders test or configuration methodsstatic void
dumpInvokedMethodsInfoToConsole(Collection<IInvokedMethod> iInvokedMethods, int currentVerbosity)
protected static ITestNGMethod[]
findDependedUponMethods(ITestNGMethod m, List<ITestNGMethod> methods)
Finds TestNG methods that the specified TestNG method depends uponprotected static ITestNGMethod[]
findDependedUponMethods(ITestNGMethod m, ITestNGMethod[] methods)
Finds TestNG methods that the specified TestNG method depends uponstatic void
fixMethodsWithClass(ITestNGMethod[] methods, ITestClass testCls, List<ITestNGMethod> methodList)
static List<ITestNGMethod>
getMethodsDependedUpon(ITestNGMethod method, ITestNGMethod[] methods, Comparator<ITestNGMethod> comparator)
static List<ITestNGMethod>
invokedMethodsToMethods(Collection<IInvokedMethod> invokedMethods)
protected static boolean
isEnabled(Class<?> objectClass, IAnnotationFinder finder)
protected static boolean
isEnabled(Method m, IAnnotationFinder finder)
protected static boolean
isEnabled(ITestOrConfiguration test)
static List<ITestNGMethod>
methodInstancesToMethods(List<IMethodInstance> methodInstances)
static List<IMethodInstance>
methodsToMethodInstances(List<ITestNGMethod> sl)
static List<ITestNGMethod>
uniqueMethodList(Collection<List<ITestNGMethod>> methods)
Extracts the unique list ofITestNGMethod
s.
-
-
-
Method Detail
-
collectAndOrderMethods
public static ITestNGMethod[] collectAndOrderMethods(List<ITestNGMethod> methods, boolean forTests, RunInfo runInfo, IAnnotationFinder finder, boolean unique, List<ITestNGMethod> outExcludedMethods, Comparator<ITestNGMethod> comparator)
Collects and orders test or configuration methods- Parameters:
methods
- methods to be worked onforTests
- true for test methods, false for configuration methodsrunInfo
-finder
- annotation finderunique
- true for unique methods, false otherwiseoutExcludedMethods
-- Returns:
- list of ordered methods
-
findDependedUponMethods
protected static ITestNGMethod[] findDependedUponMethods(ITestNGMethod m, List<ITestNGMethod> methods)
Finds TestNG methods that the specified TestNG method depends upon- Parameters:
m
- TestNG methodmethods
- list of methods to search for depended upon methods- Returns:
- list of methods that match the criteria
-
findDependedUponMethods
protected static ITestNGMethod[] findDependedUponMethods(ITestNGMethod m, ITestNGMethod[] methods)
Finds TestNG methods that the specified TestNG method depends upon- Parameters:
m
- TestNG methodmethods
- list of methods to search for depended upon methods- Returns:
- list of methods that match the criteria
-
isEnabled
protected static boolean isEnabled(Class<?> objectClass, IAnnotationFinder finder)
-
isEnabled
protected static boolean isEnabled(Method m, IAnnotationFinder finder)
-
isEnabled
protected static boolean isEnabled(ITestOrConfiguration test)
-
uniqueMethodList
public static List<ITestNGMethod> uniqueMethodList(Collection<List<ITestNGMethod>> methods)
Extracts the unique list ofITestNGMethod
s.
-
calculateMethodCanonicalName
protected static String calculateMethodCanonicalName(ITestNGMethod m)
-
getMethodsDependedUpon
public static List<ITestNGMethod> getMethodsDependedUpon(ITestNGMethod method, ITestNGMethod[] methods, Comparator<ITestNGMethod> comparator)
- Returns:
- A sorted array containing all the methods 'method' depends on
-
fixMethodsWithClass
public static void fixMethodsWithClass(ITestNGMethod[] methods, ITestClass testCls, List<ITestNGMethod> methodList)
-
invokedMethodsToMethods
public static List<ITestNGMethod> invokedMethodsToMethods(Collection<IInvokedMethod> invokedMethods)
-
methodsToMethodInstances
public static List<IMethodInstance> methodsToMethodInstances(List<ITestNGMethod> sl)
-
methodInstancesToMethods
public static List<ITestNGMethod> methodInstancesToMethods(List<IMethodInstance> methodInstances)
-
dumpInvokedMethodsInfoToConsole
public static void dumpInvokedMethodsInfoToConsole(Collection<IInvokedMethod> iInvokedMethods, int currentVerbosity)
-
calculateMethodCanonicalName
protected static String calculateMethodCanonicalName(Class<?> methodClass, String methodName)
-
calculateTimeOut
protected static long calculateTimeOut(ITestNGMethod tm)
-
-