Package org.testng.internal
Class ConfigurationGroupMethods
- java.lang.Object
-
- org.testng.internal.ConfigurationGroupMethods
-
public class ConfigurationGroupMethods extends java.lang.ObjectThis class wraps access to beforeGroups and afterGroups methods, since they are passed around the various invokers and potentially modified in different threads.- Since:
- 5.3 (Mar 2, 2006)
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<java.lang.String>afterGroupsThatHaveAlreadyRunprivate java.util.Set<java.lang.String>beforeGroupsThatHaveAlreadyRunprivate java.util.Map<java.lang.String,java.util.List<ITestNGMethod>>m_afterGroupsMapA map that returns the last method belonging to the given groupprivate java.util.Map<java.lang.String,java.util.List<ITestNGMethod>>m_afterGroupsMethodsThe list of afterGroups methods keyed by the name of the groupprivate ITestNGMethod[]m_allMethodsThe list of all test methodsprivate java.util.Map<java.lang.String,java.util.List<ITestNGMethod>>m_beforeGroupsMethodsThe list of beforeGroups methods keyed by the name of the group
-
Constructor Summary
Constructors Constructor Description ConfigurationGroupMethods(ITestNGMethod[] allMethods, java.util.Map<java.lang.String,java.util.List<ITestNGMethod>> beforeGroupsMethods, java.util.Map<java.lang.String,java.util.List<ITestNGMethod>> afterGroupsMethods)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<ITestNGMethod>getAfterGroupMethodsForGroup(java.lang.String group)java.util.Map<java.lang.String,java.util.List<ITestNGMethod>>getAfterGroupsMethods()ITestNGMethod[]getAllTestMethods()java.util.List<ITestNGMethod>getBeforeGroupMethodsForGroup(java.lang.String group)java.util.Map<java.lang.String,java.util.List<ITestNGMethod>>getBeforeGroupsMethods()private java.util.Map<java.lang.String,java.util.List<ITestNGMethod>>initializeAfterGroupsMap()booleanisLastMethodForGroup(java.lang.String group, ITestNGMethod method)voidremoveAfterGroups(java.util.Collection<java.lang.String> groups)voidremoveBeforeGroups(java.lang.String[] groups)private static java.util.List<ITestNGMethod>retrieve(java.util.Set<java.lang.String> tracker, java.util.Map<java.lang.String,java.util.List<ITestNGMethod>> map, java.lang.String group)
-
-
-
Field Detail
-
m_beforeGroupsMethods
private final java.util.Map<java.lang.String,java.util.List<ITestNGMethod>> m_beforeGroupsMethods
The list of beforeGroups methods keyed by the name of the group
-
beforeGroupsThatHaveAlreadyRun
private final java.util.Set<java.lang.String> beforeGroupsThatHaveAlreadyRun
-
afterGroupsThatHaveAlreadyRun
private final java.util.Set<java.lang.String> afterGroupsThatHaveAlreadyRun
-
m_afterGroupsMethods
private final java.util.Map<java.lang.String,java.util.List<ITestNGMethod>> m_afterGroupsMethods
The list of afterGroups methods keyed by the name of the group
-
m_allMethods
private final ITestNGMethod[] m_allMethods
The list of all test methods
-
m_afterGroupsMap
private volatile java.util.Map<java.lang.String,java.util.List<ITestNGMethod>> m_afterGroupsMap
A map that returns the last method belonging to the given group
-
-
Constructor Detail
-
ConfigurationGroupMethods
public ConfigurationGroupMethods(ITestNGMethod[] allMethods, java.util.Map<java.lang.String,java.util.List<ITestNGMethod>> beforeGroupsMethods, java.util.Map<java.lang.String,java.util.List<ITestNGMethod>> afterGroupsMethods)
-
-
Method Detail
-
getAllTestMethods
public ITestNGMethod[] getAllTestMethods()
-
getBeforeGroupsMethods
public java.util.Map<java.lang.String,java.util.List<ITestNGMethod>> getBeforeGroupsMethods()
-
getAfterGroupsMethods
public java.util.Map<java.lang.String,java.util.List<ITestNGMethod>> getAfterGroupsMethods()
-
isLastMethodForGroup
public boolean isLastMethodForGroup(java.lang.String group, ITestNGMethod method)- Parameters:
group- The group namemethod- The test method- Returns:
- true if the passed method is the last to run for the group. This method is used to figure out when is the right time to invoke afterGroups methods.
-
initializeAfterGroupsMap
private java.util.Map<java.lang.String,java.util.List<ITestNGMethod>> initializeAfterGroupsMap()
-
getBeforeGroupMethodsForGroup
public java.util.List<ITestNGMethod> getBeforeGroupMethodsForGroup(java.lang.String group)
-
getAfterGroupMethodsForGroup
public java.util.List<ITestNGMethod> getAfterGroupMethodsForGroup(java.lang.String group)
-
removeBeforeGroups
public void removeBeforeGroups(java.lang.String[] groups)
-
removeAfterGroups
public void removeAfterGroups(java.util.Collection<java.lang.String> groups)
-
retrieve
private static java.util.List<ITestNGMethod> retrieve(java.util.Set<java.lang.String> tracker, java.util.Map<java.lang.String,java.util.List<ITestNGMethod>> map, java.lang.String group)
-
-