Package org.testng.junit
Class JUnit4TestRunner
- java.lang.Object
-
- org.testng.junit.JUnit4TestRunner
-
- All Implemented Interfaces:
IJUnitTestRunner
public class JUnit4TestRunner extends Object implements IJUnitTestRunner
A JUnit TestRunner that records/triggers all information/events necessary to TestNG.- Author:
- Lukas Jungmann
-
-
Constructor Summary
Constructors Constructor Description JUnit4TestRunner()JUnit4TestRunner(ITestResultNotifier tr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<ITestNGMethod>getTestMethods()Needed from TestRunner in order to figure out what JUnit test methods were run.voidrun(Class testClass, String... methods)Astartimplementation that ignores theTestResultvoidsetInvokedMethodListeners(Collection<IInvokedMethodListener> listeners)voidsetTestResultNotifier(ITestResultNotifier notifier)org.junit.runner.Resultstart(Class testCase, String... methods)Starts a test run.
-
-
-
Constructor Detail
-
JUnit4TestRunner
public JUnit4TestRunner()
-
JUnit4TestRunner
public JUnit4TestRunner(ITestResultNotifier tr)
-
-
Method Detail
-
getTestMethods
public List<ITestNGMethod> getTestMethods()
Needed from TestRunner in order to figure out what JUnit test methods were run.- Specified by:
getTestMethodsin interfaceIJUnitTestRunner- Returns:
- the list of all JUnit test methods run
-
setTestResultNotifier
public void setTestResultNotifier(ITestResultNotifier notifier)
- Specified by:
setTestResultNotifierin interfaceIJUnitTestRunner
-
setInvokedMethodListeners
public void setInvokedMethodListeners(Collection<IInvokedMethodListener> listeners)
- Specified by:
setInvokedMethodListenersin interfaceIJUnitTestRunner
-
run
public void run(Class testClass, String... methods)
Astartimplementation that ignores theTestResult- Specified by:
runin interfaceIJUnitTestRunner- Parameters:
testClass- the JUnit test class
-
-