Package org.testng.junit
Class JUnitMethodFinder
- java.lang.Object
-
- org.testng.junit.JUnitMethodFinder
-
- All Implemented Interfaces:
ITestMethodFinder
public class JUnitMethodFinder extends java.lang.Object implements ITestMethodFinder
This class locates all test and configuration methods according to JUnit. It is used to change the strategy used by TestRunner to locate its test methods.- Since:
- May 3, 2004
-
-
Constructor Summary
Constructors Constructor Description JUnitMethodFinder(ITestObjectFactory objectFactory, org.testng.internal.annotations.IAnnotationFinder finder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ITestNGMethod[]getAfterClassMethods(java.lang.Class<?> cls)ITestNGMethod[]getAfterGroupsConfigurationMethods(java.lang.Class<?> testClass)ITestNGMethod[]getAfterSuiteMethods(java.lang.Class<?> cls)ITestNGMethod[]getAfterTestConfigurationMethods(java.lang.Class<?> testClass)ITestNGMethod[]getAfterTestMethods(java.lang.Class<?> cls)ITestNGMethod[]getBeforeClassMethods(java.lang.Class<?> cls)ITestNGMethod[]getBeforeGroupsConfigurationMethods(java.lang.Class<?> testClass)ITestNGMethod[]getBeforeSuiteMethods(java.lang.Class<?> cls)ITestNGMethod[]getBeforeTestConfigurationMethods(java.lang.Class<?> testClass)ITestNGMethod[]getBeforeTestMethods(java.lang.Class<?> cls)ITestNGMethod[]getTestMethods(java.lang.Class<?> cls, XmlTest xmlTest)
-
-
-
Constructor Detail
-
JUnitMethodFinder
public JUnitMethodFinder(ITestObjectFactory objectFactory, org.testng.internal.annotations.IAnnotationFinder finder)
-
-
Method Detail
-
getTestMethods
public ITestNGMethod[] getTestMethods(java.lang.Class<?> cls, XmlTest xmlTest)
- Specified by:
getTestMethodsin interfaceITestMethodFinder- Parameters:
cls- The test classxmlTest- The test node of xml- Returns:
- All the applicable test methods.
-
getBeforeTestMethods
public ITestNGMethod[] getBeforeTestMethods(java.lang.Class<?> cls)
- Specified by:
getBeforeTestMethodsin interfaceITestMethodFinder- Parameters:
cls- The test class- Returns:
- All the methods that should be invoked before a test method is invoked.
-
getAfterTestMethods
public ITestNGMethod[] getAfterTestMethods(java.lang.Class<?> cls)
- Specified by:
getAfterTestMethodsin interfaceITestMethodFinder- Parameters:
cls- The test class- Returns:
- All the methods that should be invoked after a test method completes.
-
getAfterClassMethods
public ITestNGMethod[] getAfterClassMethods(java.lang.Class<?> cls)
- 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.
-
getBeforeClassMethods
public ITestNGMethod[] getBeforeClassMethods(java.lang.Class<?> cls)
- 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.
-
getBeforeSuiteMethods
public ITestNGMethod[] getBeforeSuiteMethods(java.lang.Class<?> cls)
- Specified by:
getBeforeSuiteMethodsin interfaceITestMethodFinder- Parameters:
cls- The test class- Returns:
- All the methods that should be invoked before the suite starts running.
-
getAfterSuiteMethods
public ITestNGMethod[] getAfterSuiteMethods(java.lang.Class<?> cls)
- 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
public ITestNGMethod[] getBeforeTestConfigurationMethods(java.lang.Class<?> testClass)
- Specified by:
getBeforeTestConfigurationMethodsin interfaceITestMethodFinder
-
getAfterTestConfigurationMethods
public ITestNGMethod[] getAfterTestConfigurationMethods(java.lang.Class<?> testClass)
- Specified by:
getAfterTestConfigurationMethodsin interfaceITestMethodFinder
-
getBeforeGroupsConfigurationMethods
public ITestNGMethod[] getBeforeGroupsConfigurationMethods(java.lang.Class<?> testClass)
- Specified by:
getBeforeGroupsConfigurationMethodsin interfaceITestMethodFinder
-
getAfterGroupsConfigurationMethods
public ITestNGMethod[] getAfterGroupsConfigurationMethods(java.lang.Class<?> testClass)
- Specified by:
getAfterGroupsConfigurationMethodsin interfaceITestMethodFinder
-
-