Package org.testng.internal
Class MethodGroupsHelper
java.lang.Object
org.testng.internal.MethodGroupsHelper
Collections of helper methods to help deal with test methods
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static void
collectMethodsByGroup
(ITestNGMethod[] methods, boolean forTests, List<ITestNGMethod> outIncludedMethods, List<ITestNGMethod> outExcludedMethods, RunInfo runInfo, IAnnotationFinder finder, boolean unique) Collect all the methods that belong to the included groups and exclude all the methods that belong to an excluded group.static Map<String,
List<ITestNGMethod>> findGroupsMethods
(Collection<ITestClass> classes, boolean before) protected static void
findGroupTransitiveClosure
(List<ITestNGMethod> includedMethods, List<ITestNGMethod> allMethods, String[] includedGroups, Set<String> outGroups, Set<ITestNGMethod> outMethods) private static ITestNGMethod
findMethodNamed
(String tm, List<ITestNGMethod> allMethods) protected static ITestNGMethod[]
findMethodsThatBelongToGroup
(ITestNGMethod[] methods, String groupRegexp) protected static ITestNGMethod[]
findMethodsThatBelongToGroup
(ITestNGMethod method, ITestNGMethod[] methods, String groupRegexp) Only used if a group is missing to flag an error on that methodprivate static Pattern
getPattern
(String groupRegexp) private static boolean
includeMethod
(ITestOrConfiguration annotation, RunInfo runInfo, ITestNGMethod tm, boolean forTests, boolean unique, List<ITestNGMethod> outIncludedMethods) private static Boolean
private static boolean
isMethodAlreadyNotPresent
(List<ITestNGMethod> result, ITestNGMethod tm)
-
Field Details
-
PATTERN_CACHE
-
MATCH_CACHE
-
-
Constructor Details
-
MethodGroupsHelper
public MethodGroupsHelper()
-
-
Method Details
-
collectMethodsByGroup
static void collectMethodsByGroup(ITestNGMethod[] methods, boolean forTests, List<ITestNGMethod> outIncludedMethods, List<ITestNGMethod> outExcludedMethods, RunInfo runInfo, IAnnotationFinder finder, boolean unique) Collect all the methods that belong to the included groups and exclude all the methods that belong to an excluded group. -
includeMethod
private static boolean includeMethod(ITestOrConfiguration annotation, RunInfo runInfo, ITestNGMethod tm, boolean forTests, boolean unique, List<ITestNGMethod> outIncludedMethods) -
isMethodAlreadyNotPresent
-
findGroupsMethods
public static Map<String,List<ITestNGMethod>> findGroupsMethods(Collection<ITestClass> classes, boolean before) - Returns:
- the map of groups and their corresponding methods from the extraction of
classes
.
-
findGroupTransitiveClosure
protected static void findGroupTransitiveClosure(List<ITestNGMethod> includedMethods, List<ITestNGMethod> allMethods, String[] includedGroups, Set<String> outGroups, Set<ITestNGMethod> outMethods) -
findMethodNamed
-
findMethodsThatBelongToGroup
protected static ITestNGMethod[] findMethodsThatBelongToGroup(ITestNGMethod method, ITestNGMethod[] methods, String groupRegexp) Only used if a group is missing to flag an error on that method- Parameters:
method
- if no group is found, group regex is set as this method's missing groupmethods
- list of methods to searchgroupRegexp
- regex representing the group- Returns:
- all the methods that belong to the group specified by the regular expression groupRegExp. methods[] is the list of all the methods we are choosing from and method is the method that owns the dependsOnGroups statement (only used if a group is missing to flag an error on that method).
-
findMethodsThatBelongToGroup
protected static ITestNGMethod[] findMethodsThatBelongToGroup(ITestNGMethod[] methods, String groupRegexp) - Parameters:
methods
- list of methods to searchgroupRegexp
- regex representing the group- Returns:
- all the methods that belong to the group specified by the regular expression groupRegExp. methods[] is the list of all the methods we are choosing from.
-
isMatch
-
getPattern
-