Package org.testng.internal
Class XmlMethodSelector
java.lang.Object
org.testng.internal.XmlMethodSelector
- All Implemented Interfaces:
IMethodSelector
This class is the default method selector used by TestNG to determine which methods need to be
included and excluded based on the specification given in testng.xml.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ListMultiMap<String, XmlInclude> private booleanprivate booleanprivate List<ITestNGMethod> private static final Stringprivate ScriptMethodSelector -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanassignable(Class<?> sourceClass, Class<?> targetClass) private static voidcheckMethod(Class<?> c, String methodName) createQualifiedMethodNames(XmlClass xmlClass, List<String> methods) booleanprivate booleanprivate booleanbooleanincludeMethod(IMethodSelectorContext context, ITestNGMethod tm, boolean isTestMethod) private booleanincludeMethodFromIncludeExclude(ITestNGMethod tm, boolean isTestMethod) private voidinit(IMethodSelectorContext context) private static booleanisExcluded(Collection<String> excludedGroups, String... groups) private static booleanisIncluded(Collection<String> includedGroups, boolean noGroupsSpecified, String... groups) private static booleanisMemberOf(Collection<String> list, String... groups) private static voidprivate voidlogInclusion(String including, String type, String name) private static StringmakeMethodName(String className, String methodName) private static StringmethodName(String methodName) voidsetExcludedGroups(Map<String, String> excludedGroups) voidsetIncludedGroups(Map<String, String> includedGroups) voidsetOverrideIncludedMethods(boolean overrideIncludedMethods) voidvoidsetTestMethods(List<ITestNGMethod> testMethods) Invoked when all the test methods are known so that the method selector can perform additional work, such as adding the transitive closure of all the groups being included and depended upon.voidsetXmlClasses(List<XmlClass> classes) toStringList(List<XmlInclude> methods)
-
Field Details
-
QUOTED_DOLLAR
-
m_includedMethods
-
m_logged
-
m_includedGroups
-
m_excludedGroups
-
m_classes
-
scriptSelector
-
m_isInitialized
private boolean m_isInitialized -
m_testMethods
-
m_overrideIncludedMethods
private boolean m_overrideIncludedMethods
-
-
Constructor Details
-
XmlMethodSelector
public XmlMethodSelector()
-
-
Method Details
-
includeMethod
public boolean includeMethod(IMethodSelectorContext context, ITestNGMethod tm, boolean isTestMethod) - Specified by:
includeMethodin interfaceIMethodSelector- Parameters:
context- The selector context. The implementation of this method can invoke setHalted(true) to indicate that no other Method Selector should be invoked by TestNG after this one. Additionally, this implementation can manipulate the Map object returned by getUserData().tm- The test methodisTestMethod- true if this is a @Test method, false if it's a configuration method- Returns:
- true if this method should be included in the test run, false otherwise
-
includeMethodFromIncludeExclude
-
assignable
-
logInclusion
-
hasIncludedMethods
private boolean hasIncludedMethods() -
hasExcludedMethods
private boolean hasExcludedMethods() -
toStringList
-
createQualifiedMethodNames
-
methodName
-
makeMethodName
-
checkMethod
-
setXmlClasses
-
getExcludedGroups
- Returns:
- Returns the excludedGroups.
-
getIncludedGroups
- Returns:
- Returns the includedGroups.
-
setExcludedGroups
- Parameters:
excludedGroups- The excludedGroups to set.
-
setIncludedGroups
- Parameters:
includedGroups- The includedGroups to set.
-
isIncluded
private static boolean isIncluded(Collection<String> includedGroups, boolean noGroupsSpecified, String... groups) -
isExcluded
-
isMemberOf
- Parameters:
list- Map of regexps of groups to be rungroups- Array of groups on the method
-
log
-
setScript
-
setTestMethods
Description copied from interface:IMethodSelectorInvoked when all the test methods are known so that the method selector can perform additional work, such as adding the transitive closure of all the groups being included and depended upon.- Specified by:
setTestMethodsin interfaceIMethodSelector- Parameters:
testMethods- The test methods
-
getOverrideIncludedMethods
public boolean getOverrideIncludedMethods() -
setOverrideIncludedMethods
public void setOverrideIncludedMethods(boolean overrideIncludedMethods) -
init
-