Package org.testng.internal
Class TestNGMethodFinder
- java.lang.Object
-
- org.testng.internal.TestNGMethodFinder
-
- All Implemented Interfaces:
ITestMethodFinder
public class TestNGMethodFinder extends java.lang.Object implements ITestMethodFinder
The default strategy for finding test methods: look up annotations @Test in front of methods.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
TestNGMethodFinder.MethodType
-
Field Summary
Fields Modifier and Type Field Description private IAnnotationFinder
annotationFinder
private java.util.Comparator<ITestNGMethod>
comparator
private static java.util.Comparator<ITestNGMethod>
NO_COMPARISON
private RunInfo
runInfo
-
Constructor Summary
Constructors Constructor Description TestNGMethodFinder(RunInfo runInfo, IAnnotationFinder annotationFinder)
TestNGMethodFinder(RunInfo runInfo, IAnnotationFinder annotationFinder, java.util.Comparator<ITestNGMethod> comparator)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addConfigurationMethod(java.lang.Class<?> clazz, java.util.List<ITestNGMethod> results, java.lang.reflect.Method method, boolean isBeforeSuite, boolean isAfterSuite, boolean isBeforeTest, boolean isAfterTest, boolean isBeforeClass, boolean isAfterClass, boolean isBeforeTestMethod, boolean isAfterTestMethod, java.lang.String[] beforeGroups, java.lang.String[] afterGroups, java.lang.Object instance)
private ITestNGMethod[]
findConfiguration(java.lang.Class clazz, TestNGMethodFinder.MethodType configurationType)
ITestNGMethod[]
getAfterClassMethods(java.lang.Class cls)
ITestNGMethod[]
getAfterGroupsConfigurationMethods(java.lang.Class clazz)
ITestNGMethod[]
getAfterSuiteMethods(java.lang.Class cls)
ITestNGMethod[]
getAfterTestConfigurationMethods(java.lang.Class clazz)
ITestNGMethod[]
getAfterTestMethods(java.lang.Class cls)
ITestNGMethod[]
getBeforeClassMethods(java.lang.Class cls)
ITestNGMethod[]
getBeforeGroupsConfigurationMethods(java.lang.Class clazz)
ITestNGMethod[]
getBeforeSuiteMethods(java.lang.Class cls)
ITestNGMethod[]
getBeforeTestConfigurationMethods(java.lang.Class clazz)
ITestNGMethod[]
getBeforeTestMethods(java.lang.Class cls)
ITestNGMethod[]
getTestMethods(java.lang.Class<?> clazz, XmlTest xmlTest)
private static boolean
shouldCreateBeforeAfterGroup(java.lang.String[] groups, IAnnotationFinder finder, java.lang.Class<?> clazz, boolean isInheritGroups)
-
-
-
Field Detail
-
NO_COMPARISON
private static final java.util.Comparator<ITestNGMethod> NO_COMPARISON
-
runInfo
private RunInfo runInfo
-
annotationFinder
private IAnnotationFinder annotationFinder
-
comparator
private final java.util.Comparator<ITestNGMethod> comparator
-
-
Constructor Detail
-
TestNGMethodFinder
public TestNGMethodFinder(RunInfo runInfo, IAnnotationFinder annotationFinder)
-
TestNGMethodFinder
public TestNGMethodFinder(RunInfo runInfo, IAnnotationFinder annotationFinder, java.util.Comparator<ITestNGMethod> comparator)
-
-
Method Detail
-
getTestMethods
public ITestNGMethod[] getTestMethods(java.lang.Class<?> clazz, XmlTest xmlTest)
- Specified by:
getTestMethods
in interfaceITestMethodFinder
- Returns:
- All the applicable test methods.
-
getBeforeClassMethods
public ITestNGMethod[] getBeforeClassMethods(java.lang.Class cls)
- Specified by:
getBeforeClassMethods
in interfaceITestMethodFinder
- 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
public ITestNGMethod[] getAfterClassMethods(java.lang.Class cls)
- Specified by:
getAfterClassMethods
in interfaceITestMethodFinder
- Returns:
- All the methods that should be invoked after the test class has been created and after all its test methods have completed.
-
getBeforeTestMethods
public ITestNGMethod[] getBeforeTestMethods(java.lang.Class cls)
- Specified by:
getBeforeTestMethods
in interfaceITestMethodFinder
- Returns:
- All the methods that should be invoked before a test method is invoked.
-
getAfterTestMethods
public ITestNGMethod[] getAfterTestMethods(java.lang.Class cls)
- Specified by:
getAfterTestMethods
in interfaceITestMethodFinder
- Returns:
- All the methods that should be invoked after a test method completes.
-
getBeforeSuiteMethods
public ITestNGMethod[] getBeforeSuiteMethods(java.lang.Class cls)
- Specified by:
getBeforeSuiteMethods
in interfaceITestMethodFinder
- Returns:
- All the methods that should be invoked before the suite starts running.
-
getAfterSuiteMethods
public ITestNGMethod[] getAfterSuiteMethods(java.lang.Class cls)
- Specified by:
getAfterSuiteMethods
in interfaceITestMethodFinder
- Returns:
- All the methods that should be invoked after the suite has run all its tests.
-
getBeforeTestConfigurationMethods
public ITestNGMethod[] getBeforeTestConfigurationMethods(java.lang.Class clazz)
- Specified by:
getBeforeTestConfigurationMethods
in interfaceITestMethodFinder
-
getAfterTestConfigurationMethods
public ITestNGMethod[] getAfterTestConfigurationMethods(java.lang.Class clazz)
- Specified by:
getAfterTestConfigurationMethods
in interfaceITestMethodFinder
-
getBeforeGroupsConfigurationMethods
public ITestNGMethod[] getBeforeGroupsConfigurationMethods(java.lang.Class clazz)
- Specified by:
getBeforeGroupsConfigurationMethods
in interfaceITestMethodFinder
-
getAfterGroupsConfigurationMethods
public ITestNGMethod[] getAfterGroupsConfigurationMethods(java.lang.Class clazz)
- Specified by:
getAfterGroupsConfigurationMethods
in interfaceITestMethodFinder
-
findConfiguration
private ITestNGMethod[] findConfiguration(java.lang.Class clazz, TestNGMethodFinder.MethodType configurationType)
-
shouldCreateBeforeAfterGroup
private static boolean shouldCreateBeforeAfterGroup(java.lang.String[] groups, IAnnotationFinder finder, java.lang.Class<?> clazz, boolean isInheritGroups)
-
addConfigurationMethod
private void addConfigurationMethod(java.lang.Class<?> clazz, java.util.List<ITestNGMethod> results, java.lang.reflect.Method method, boolean isBeforeSuite, boolean isAfterSuite, boolean isBeforeTest, boolean isAfterTest, boolean isBeforeClass, boolean isAfterClass, boolean isBeforeTestMethod, boolean isAfterTestMethod, java.lang.String[] beforeGroups, java.lang.String[] afterGroups, java.lang.Object instance)
-
-