Package org.testng.internal
Class MethodHelper
- java.lang.Object
-
- org.testng.internal.MethodHelper
-
public class MethodHelper extends java.lang.Object
Collection of helper methods to help sort and arrange methods.
-
-
Constructor Summary
Constructors Constructor Description MethodHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static java.lang.String
calculateMethodCanonicalName(java.lang.Class<?> methodClass, java.lang.String methodName)
protected static java.lang.String
calculateMethodCanonicalName(ITestNGMethod m)
static long
calculateTimeOut(ITestNGMethod tm)
static void
clear(java.util.stream.Stream<java.lang.reflect.Method> methods)
static ITestNGMethod[]
collectAndOrderMethods(java.util.List<ITestNGMethod> methods, boolean forTests, RunInfo runInfo, IAnnotationFinder finder, boolean unique, java.util.List<ITestNGMethod> outExcludedMethods, java.util.Comparator<ITestNGMethod> comparator)
Collects and orders test or configuration methodsstatic void
dumpInvokedMethodInfoToConsole(ITestNGMethod[] methods, int currentVerbosity)
protected static ITestNGMethod[]
findDependedUponMethods(ITestNGMethod m, java.util.List<ITestNGMethod> methods)
Finds TestNG methods that the specified TestNG method depends uponstatic ITestNGMethod[]
findDependedUponMethods(ITestNGMethod m, ITestNGMethod[] incoming)
Finds TestNG methods that the specified TestNG method depends uponstatic void
fixMethodsWithClass(ITestNGMethod[] methods, ITestClass testCls, java.util.List<ITestNGMethod> methodList)
static java.util.List<ITestNGMethod>
getMethodsDependedUpon(ITestNGMethod method, ITestNGMethod[] methods, java.util.Comparator<ITestNGMethod> comparator)
static boolean
isAlwaysRun(IConfigurationAnnotation configurationAnnotation)
static boolean
isEnabled(java.lang.Class<?> objectClass, IAnnotationFinder finder)
static boolean
isEnabled(java.lang.reflect.Method m, IAnnotationFinder finder)
static boolean
isEnabled(ITestOrConfiguration test)
static java.util.List<ITestNGMethod>
methodInstancesToMethods(java.util.List<IMethodInstance> methodInstances)
static java.util.List<IMethodInstance>
methodsToMethodInstances(java.util.List<ITestNGMethod> sl)
static java.util.List<ITestNGMethod>
uniqueMethodList(java.util.Collection<java.util.List<ITestNGMethod>> methods)
Extracts the unique list ofITestNGMethod
s.
-
-
-
Method Detail
-
collectAndOrderMethods
public static ITestNGMethod[] collectAndOrderMethods(java.util.List<ITestNGMethod> methods, boolean forTests, RunInfo runInfo, IAnnotationFinder finder, boolean unique, java.util.List<ITestNGMethod> outExcludedMethods, java.util.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
- -RunInfo
object.finder
- annotation finderunique
- true for unique methods, false otherwiseoutExcludedMethods
- - A List of excludedITestNGMethod
methods.- Returns:
- an array of ordered methods
-
findDependedUponMethods
protected static ITestNGMethod[] findDependedUponMethods(ITestNGMethod m, java.util.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:
- an array of methods that match the criteria
-
findDependedUponMethods
public static ITestNGMethod[] findDependedUponMethods(ITestNGMethod m, ITestNGMethod[] incoming)
Finds TestNG methods that the specified TestNG method depends upon- Parameters:
m
- TestNG methodincoming
- list of methods to search for depended upon methods- Returns:
- an array of methods that match the criteria
-
isEnabled
public static boolean isEnabled(java.lang.Class<?> objectClass, IAnnotationFinder finder)
-
isEnabled
public static boolean isEnabled(java.lang.reflect.Method m, IAnnotationFinder finder)
-
isEnabled
public static boolean isEnabled(ITestOrConfiguration test)
-
isAlwaysRun
public static boolean isAlwaysRun(IConfigurationAnnotation configurationAnnotation)
-
uniqueMethodList
public static java.util.List<ITestNGMethod> uniqueMethodList(java.util.Collection<java.util.List<ITestNGMethod>> methods)
Extracts the unique list ofITestNGMethod
s.
-
calculateMethodCanonicalName
protected static java.lang.String calculateMethodCanonicalName(ITestNGMethod m)
-
getMethodsDependedUpon
public static java.util.List<ITestNGMethod> getMethodsDependedUpon(ITestNGMethod method, ITestNGMethod[] methods, java.util.Comparator<ITestNGMethod> comparator)
- Returns:
- A sorted array containing all the methods 'method' depends on
-
fixMethodsWithClass
public static void fixMethodsWithClass(ITestNGMethod[] methods, ITestClass testCls, java.util.List<ITestNGMethod> methodList)
-
methodsToMethodInstances
public static java.util.List<IMethodInstance> methodsToMethodInstances(java.util.List<ITestNGMethod> sl)
-
methodInstancesToMethods
public static java.util.List<ITestNGMethod> methodInstancesToMethods(java.util.List<IMethodInstance> methodInstances)
-
dumpInvokedMethodInfoToConsole
public static void dumpInvokedMethodInfoToConsole(ITestNGMethod[] methods, int currentVerbosity)
-
calculateMethodCanonicalName
protected static java.lang.String calculateMethodCanonicalName(java.lang.Class<?> methodClass, java.lang.String methodName)
-
clear
public static void clear(java.util.stream.Stream<java.lang.reflect.Method> methods)
-
calculateTimeOut
public static long calculateTimeOut(ITestNGMethod tm)
-
-