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 IAnnotationFinder
private final Comparator<ITestNGMethod>
private static final Comparator<ITestNGMethod>
private final RunInfo
-
Constructor Summary
ConstructorsConstructorDescriptionTestNGMethodFinder
(RunInfo runInfo, IAnnotationFinder annotationFinder) TestNGMethodFinder
(RunInfo runInfo, IAnnotationFinder annotationFinder, Comparator<ITestNGMethod> comparator) -
Method Summary
Modifier and TypeMethodDescriptionprivate 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, String[] beforeGroups, String[] afterGroups, Object instance) 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 boolean
shouldCreateBeforeAfterGroup
(String[] groups, IAnnotationFinder finder, Class<?> clazz, boolean isInheritGroups)
-
Field Details
-
NO_COMPARISON
-
runInfo
-
annotationFinder
-
comparator
-
-
Constructor Details
-
TestNGMethodFinder
-
TestNGMethodFinder
public TestNGMethodFinder(RunInfo runInfo, IAnnotationFinder annotationFinder, Comparator<ITestNGMethod> comparator)
-
-
Method Details
-
getTestMethods
- Specified by:
getTestMethods
in interfaceITestMethodFinder
- Parameters:
clazz
- The test classxmlTest
- The test node of xml- Returns:
- All the applicable test methods.
-
getBeforeClassMethods
- Specified by:
getBeforeClassMethods
in 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:
getAfterClassMethods
in 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:
getBeforeTestMethods
in interfaceITestMethodFinder
- Parameters:
cls
- The test class- Returns:
- All the methods that should be invoked before a test method is invoked.
-
getAfterTestMethods
- Specified by:
getAfterTestMethods
in interfaceITestMethodFinder
- Parameters:
cls
- The test class- Returns:
- All the methods that should be invoked after a test method completes.
-
getBeforeSuiteMethods
- Specified by:
getBeforeSuiteMethods
in interfaceITestMethodFinder
- Parameters:
cls
- The test class- Returns:
- All the methods that should be invoked before the suite starts running.
-
getAfterSuiteMethods
- Specified by:
getAfterSuiteMethods
in 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:
getBeforeTestConfigurationMethods
in interfaceITestMethodFinder
-
getAfterTestConfigurationMethods
- Specified by:
getAfterTestConfigurationMethods
in interfaceITestMethodFinder
-
getBeforeGroupsConfigurationMethods
- Specified by:
getBeforeGroupsConfigurationMethods
in interfaceITestMethodFinder
-
getAfterGroupsConfigurationMethods
- Specified by:
getAfterGroupsConfigurationMethods
in 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, String[] beforeGroups, String[] afterGroups, Object instance)
-