public class MethodGroupsHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<Pair<java.lang.String,java.lang.String>,java.lang.Boolean> |
MATCH_CACHE |
private static java.util.Map<java.lang.String,java.util.regex.Pattern> |
PATTERN_CACHE |
Constructor and Description |
---|
MethodGroupsHelper() |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
collectMethodsByGroup(ITestNGMethod[] methods,
boolean forTests,
java.util.List<ITestNGMethod> outIncludedMethods,
java.util.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 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 . |
protected 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) |
private static ITestNGMethod |
findMethodNamed(java.lang.String tm,
java.util.List<ITestNGMethod> allMethods) |
protected static ITestNGMethod[] |
findMethodsThatBelongToGroup(ITestNGMethod[] methods,
java.lang.String groupRegexp) |
protected static ITestNGMethod[] |
findMethodsThatBelongToGroup(ITestNGMethod method,
ITestNGMethod[] methods,
java.lang.String groupRegexp)
Only used if a group is missing to flag an error on that method
|
private static java.util.regex.Pattern |
getPattern(java.lang.String groupRegexp) |
private static boolean |
includeMethod(ITestOrConfiguration annotation,
RunInfo runInfo,
ITestNGMethod tm,
boolean forTests,
boolean unique,
java.util.List<ITestNGMethod> outIncludedMethods) |
private static java.lang.Boolean |
isMatch(java.util.regex.Pattern pattern,
java.lang.String group) |
private static boolean |
isMethodAlreadyPresent(java.util.List<ITestNGMethod> result,
ITestNGMethod tm) |
private static final java.util.Map<java.lang.String,java.util.regex.Pattern> PATTERN_CACHE
private static final java.util.Map<Pair<java.lang.String,java.lang.String>,java.lang.Boolean> MATCH_CACHE
static void collectMethodsByGroup(ITestNGMethod[] methods, boolean forTests, java.util.List<ITestNGMethod> outIncludedMethods, java.util.List<ITestNGMethod> outExcludedMethods, RunInfo runInfo, IAnnotationFinder finder, boolean unique)
private static boolean includeMethod(ITestOrConfiguration annotation, RunInfo runInfo, ITestNGMethod tm, boolean forTests, boolean unique, java.util.List<ITestNGMethod> outIncludedMethods)
private static boolean isMethodAlreadyPresent(java.util.List<ITestNGMethod> result, ITestNGMethod tm)
result
- tm
- public static java.util.Map<java.lang.String,java.util.List<ITestNGMethod>> findGroupsMethods(java.util.Collection<ITestClass> classes, boolean before)
classes
.protected 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)
private static ITestNGMethod findMethodNamed(java.lang.String tm, java.util.List<ITestNGMethod> allMethods)
protected static ITestNGMethod[] findMethodsThatBelongToGroup(ITestNGMethod method, ITestNGMethod[] methods, java.lang.String groupRegexp)
method
- if no group is found, group regex is set as this method's missing groupmethods
- list of methods to searchgroupRegexp
- regex representing the groupprotected static ITestNGMethod[] findMethodsThatBelongToGroup(ITestNGMethod[] methods, java.lang.String groupRegexp)
methods
- list of methods to searchgroupRegexp
- regex representing the groupprivate static java.lang.Boolean isMatch(java.util.regex.Pattern pattern, java.lang.String group)
private static java.util.regex.Pattern getPattern(java.lang.String groupRegexp)