Package org.testng.internal
Class TestNGMethodFinder
java.lang.Object
org.testng.internal.TestNGMethodFinder
- All Implemented Interfaces:
ITestMethodFinder
The default strategy for finding test methods: look up annotations @Test in front of methods.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IAnnotationFinderprivate final Comparator<ITestNGMethod> private static final Comparator<ITestNGMethod> private final ITestObjectFactoryprivate final RunInfo -
Constructor Summary
ConstructorsConstructorDescriptionTestNGMethodFinder(ITestObjectFactory objectFactory, RunInfo runInfo, IAnnotationFinder annotationFinder) TestNGMethodFinder(ITestObjectFactory objectFactory, RunInfo runInfo, IAnnotationFinder annotationFinder, Comparator<ITestNGMethod> comparator) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddConfigurationMethod(Class<?> clazz, List<ITestNGMethod> results, Method method, boolean isBeforeSuite, boolean isAfterSuite, boolean isBeforeTest, boolean isAfterTest, boolean isBeforeClass, boolean isAfterClass, boolean isBeforeTestMethod, boolean isAfterTestMethod, boolean isIgnoreFailure, String[] beforeGroups, String[] afterGroups) private ITestNGMethod[]findConfiguration(Class<?> clazz, TestNGMethodFinder.MethodType configurationType) getAfterClassMethods(Class<?> cls) getAfterGroupsConfigurationMethods(Class<?> clazz) getAfterSuiteMethods(Class<?> cls) getAfterTestConfigurationMethods(Class<?> clazz) getAfterTestMethods(Class<?> cls) getBeforeClassMethods(Class<?> cls) getBeforeGroupsConfigurationMethods(Class<?> clazz) getBeforeSuiteMethods(Class<?> cls) getBeforeTestConfigurationMethods(Class<?> clazz) getBeforeTestMethods(Class<?> cls) getTestMethods(Class<?> clazz, XmlTest xmlTest) private static booleanshouldCreateBeforeAfterGroup(String[] groups, IAnnotationFinder finder, Class<?> clazz, boolean isInheritGroups)
-
Field Details
-
NO_COMPARISON
-
objectFactory
-
runInfo
-
annotationFinder
-
comparator
-
-
Constructor Details
-
TestNGMethodFinder
public TestNGMethodFinder(ITestObjectFactory objectFactory, RunInfo runInfo, IAnnotationFinder annotationFinder) -
TestNGMethodFinder
public TestNGMethodFinder(ITestObjectFactory objectFactory, RunInfo runInfo, IAnnotationFinder annotationFinder, Comparator<ITestNGMethod> comparator)
-
-
Method Details
-
getTestMethods
- Specified by:
getTestMethodsin interfaceITestMethodFinder- Parameters:
clazz- The test classxmlTest- The test node of xml- Returns:
- All the applicable test methods.
-
getBeforeClassMethods
- Specified by:
getBeforeClassMethodsin interfaceITestMethodFinder- Parameters:
cls- The test class- Returns:
- All the methods that should be invoked after the test class has been created and before any of its test methods is invoked.
-
getAfterClassMethods
- Specified by:
getAfterClassMethodsin interfaceITestMethodFinder- Parameters:
cls- The test class- Returns:
- All the methods that should be invoked after the test class has been created and after all its test methods have completed.
-
getBeforeTestMethods
- Specified by:
getBeforeTestMethodsin interfaceITestMethodFinder- Parameters:
cls- The test class- Returns:
- All the methods that should be invoked before a test method is invoked.
-
getAfterTestMethods
- Specified by:
getAfterTestMethodsin interfaceITestMethodFinder- Parameters:
cls- The test class- Returns:
- All the methods that should be invoked after a test method completes.
-
getBeforeSuiteMethods
- Specified by:
getBeforeSuiteMethodsin interfaceITestMethodFinder- Parameters:
cls- The test class- Returns:
- All the methods that should be invoked before the suite starts running.
-
getAfterSuiteMethods
- Specified by:
getAfterSuiteMethodsin interfaceITestMethodFinder- Parameters:
cls- The test class- Returns:
- All the methods that should be invoked after the suite has run all its tests.
-
getBeforeTestConfigurationMethods
- Specified by:
getBeforeTestConfigurationMethodsin interfaceITestMethodFinder
-
getAfterTestConfigurationMethods
- Specified by:
getAfterTestConfigurationMethodsin interfaceITestMethodFinder
-
getBeforeGroupsConfigurationMethods
- Specified by:
getBeforeGroupsConfigurationMethodsin interfaceITestMethodFinder
-
getAfterGroupsConfigurationMethods
- Specified by:
getAfterGroupsConfigurationMethodsin interfaceITestMethodFinder
-
findConfiguration
private ITestNGMethod[] findConfiguration(Class<?> clazz, TestNGMethodFinder.MethodType configurationType) -
shouldCreateBeforeAfterGroup
private static boolean shouldCreateBeforeAfterGroup(String[] groups, IAnnotationFinder finder, Class<?> clazz, boolean isInheritGroups) -
addConfigurationMethod
private void addConfigurationMethod(Class<?> clazz, List<ITestNGMethod> results, Method method, boolean isBeforeSuite, boolean isAfterSuite, boolean isBeforeTest, boolean isAfterTest, boolean isBeforeClass, boolean isAfterClass, boolean isBeforeTestMethod, boolean isAfterTestMethod, boolean isIgnoreFailure, String[] beforeGroups, String[] afterGroups)
-