Package org.testng.internal.invokers
Class TestNgMethodUtils
java.lang.Object
org.testng.internal.invokers.TestNgMethodUtils
Collections of helper methods to help deal with TestNG configuration methods
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static booleanprivate static booleancontainsConfigurationMethod(ITestNGMethod method, List<ITestNGMethod> methods) A helper method which checks if a given method is a configuration method and is part of list of TestNG methodsprivate static booleanprivate static booleanprivate static boolean(package private) static ITestNGMethod[]filterAfterTestMethods(ITestClass testClass, BiPredicate<ITestNGMethod, IClass> predicate) (package private) static ITestNGMethod[]filterBeforeTestMethods(ITestClass testClass, BiPredicate<ITestNGMethod, IClass> predicate) (package private) static ITestNGMethod[]filterMethods(IClass testClass, ITestNGMethod[] methods, BiPredicate<ITestNGMethod, IClass> predicate) (package private) static ITestNGMethod[]filterSetupConfigurationMethods(ITestNGMethod tm, ITestNGMethod[] methods) (package private) static ITestNGMethod[]filterTeardownConfigurationMethods(ITestNGMethod tm, ITestNGMethod[] methods) (package private) static ObjectgetMethodInvocationToken(ITestNGMethod method, Object instance) (package private) static booleanisConfigurationMethod(ITestNGMethod method) A helper method that checks to see if a method is a configuration method or not.private static booleanisConfigurationMethod(ITestNGMethod method, boolean includeGroupConfigs) A helper method that checks to see if a method is a configuration method or not.
-
Constructor Details
-
TestNgMethodUtils
private TestNgMethodUtils()
-
-
Method Details
-
isConfigurationMethod
A helper method that checks to see if a method is a configuration method or not.- Parameters:
method- - AITestNGMethodobject which needs to be checked.- Returns:
- -
trueif the method is a configuration method and false if its a test method.
-
isConfigurationMethod
A helper method that checks to see if a method is a configuration method or not.- Parameters:
method- - AITestNGMethodobject which needs to be checked.includeGroupConfigs- -trueif before/after group configuration annotations are also to be taken into consideration.- Returns:
- -
trueif the method is a configuration method and false if its a test method.
-
containsConfigurationMethod
private static boolean containsConfigurationMethod(ITestNGMethod method, List<ITestNGMethod> methods) A helper method which checks if a given method is a configuration method and is part of list of TestNG methods- Parameters:
method- - AITestNGMethodobject which needs to be checked.methods- - A List ofITestNGMethodin which the check needs to be done.- Returns:
- -
trueif the method is a configuration method and exists in the list of methods passed.
-
filterBeforeTestMethods
static ITestNGMethod[] filterBeforeTestMethods(ITestClass testClass, BiPredicate<ITestNGMethod, IClass> predicate) -
filterAfterTestMethods
static ITestNGMethod[] filterAfterTestMethods(ITestClass testClass, BiPredicate<ITestNGMethod, IClass> predicate) -
filterMethods
static ITestNGMethod[] filterMethods(IClass testClass, ITestNGMethod[] methods, BiPredicate<ITestNGMethod, IClass> predicate) - Returns:
- Only the ITestNGMethods applicable for this testClass
-
filterSetupConfigurationMethods
-
filterTeardownConfigurationMethods
static ITestNGMethod[] filterTeardownConfigurationMethods(ITestNGMethod tm, ITestNGMethod[] methods) -
cannotRunMethodIndependently
- Parameters:
tm- - TheITestNGMethodobject which is to be tested.- Returns:
- -
trueif the method depends on other methods and cannot be run independently.
-
getMethodInvocationToken
-
doesSetupMethodPassFirstTimeFilter
-
doesTeardownMethodPassLastTimeFilter
private static boolean doesTeardownMethodPassLastTimeFilter(ConfigurationMethod cm, ITestNGMethod tm) -
doesConfigMethodPassGroupFilters
-