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.
-
-
Field Summary
Fields Modifier and Type Field Description private IAnnotationFinder
m_annotationFinder
private java.lang.String
m_testName
-
Constructor Summary
Constructors Constructor Description JUnitMethodFinder(java.lang.String testName, IAnnotationFinder finder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.reflect.Constructor
findConstructor(java.lang.Class cls, java.lang.Class[] parameters)
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)
private java.lang.Object
instantiate(java.lang.Class cls)
private static void
ppp(java.lang.String s)
private ITestNGMethod[]
privateFindTestMethods(INameFilter filter, java.lang.Class cls)
-
-
-
Field Detail
-
m_testName
private java.lang.String m_testName
-
m_annotationFinder
private IAnnotationFinder m_annotationFinder
-
-
Constructor Detail
-
JUnitMethodFinder
public JUnitMethodFinder(java.lang.String testName, IAnnotationFinder finder)
-
-
Method Detail
-
findConstructor
private java.lang.reflect.Constructor findConstructor(java.lang.Class cls, java.lang.Class[] parameters)
-
getTestMethods
public ITestNGMethod[] getTestMethods(java.lang.Class cls, XmlTest xmlTest)
- Specified by:
getTestMethods
in interfaceITestMethodFinder
- Returns:
- All the applicable test methods.
-
privateFindTestMethods
private ITestNGMethod[] privateFindTestMethods(INameFilter filter, java.lang.Class cls)
-
ppp
private static void ppp(java.lang.String s)
-
instantiate
private java.lang.Object instantiate(java.lang.Class cls)
-
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.
-
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.
-
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.
-
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 testClass)
- Specified by:
getBeforeTestConfigurationMethods
in interfaceITestMethodFinder
-
getAfterTestConfigurationMethods
public ITestNGMethod[] getAfterTestConfigurationMethods(java.lang.Class testClass)
- Specified by:
getAfterTestConfigurationMethods
in interfaceITestMethodFinder
-
getBeforeGroupsConfigurationMethods
public ITestNGMethod[] getBeforeGroupsConfigurationMethods(java.lang.Class testClass)
- Specified by:
getBeforeGroupsConfigurationMethods
in interfaceITestMethodFinder
-
getAfterGroupsConfigurationMethods
public ITestNGMethod[] getAfterGroupsConfigurationMethods(java.lang.Class testClass)
- Specified by:
getAfterGroupsConfigurationMethods
in interfaceITestMethodFinder
-
-