Package org.testng.junit
Class JUnit4TestRunner
- java.lang.Object
-
- org.testng.junit.JUnit4TestRunner
-
- All Implemented Interfaces:
IJUnitTestRunner
public class JUnit4TestRunner extends java.lang.Object implements IJUnitTestRunner
A JUnit TestRunner that records/triggers all information/events necessary to TestNG.
-
-
Constructor Summary
Constructors Constructor Description JUnit4TestRunner(ITestObjectFactory objectFactory, org.testng.internal.ITestResultNotifier tr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<ITestNGMethod>
getTestMethods()
Needed from TestRunner in order to figure out what JUnit test methods were run.void
run(java.lang.Class testClass, java.lang.String... methods)
Astart
implementation that ignores theTestResult
void
setInvokedMethodListeners(java.util.Collection<IInvokedMethodListener> listeners)
org.junit.runner.Result
start(java.lang.Class testCase, java.lang.String... methods)
Starts a test run.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.testng.junit.IJUnitTestRunner
setTestResultNotifier
-
-
-
-
Constructor Detail
-
JUnit4TestRunner
public JUnit4TestRunner(ITestObjectFactory objectFactory, org.testng.internal.ITestResultNotifier tr)
-
-
Method Detail
-
getTestMethods
public java.util.List<ITestNGMethod> getTestMethods()
Needed from TestRunner in order to figure out what JUnit test methods were run.- Specified by:
getTestMethods
in interfaceIJUnitTestRunner
- Returns:
- the list of all JUnit test methods run
-
setInvokedMethodListeners
public void setInvokedMethodListeners(java.util.Collection<IInvokedMethodListener> listeners)
- Specified by:
setInvokedMethodListeners
in interfaceIJUnitTestRunner
-
run
public void run(java.lang.Class testClass, java.lang.String... methods)
Astart
implementation that ignores theTestResult
- Specified by:
run
in interfaceIJUnitTestRunner
- Parameters:
testClass
- the JUnit test class
-
start
public org.junit.runner.Result start(java.lang.Class testCase, java.lang.String... methods)
Starts a test run. Analyzes the command line arguments and runs the given test suite.- Parameters:
testCase
- The test classmethods
- The test methods- Returns:
- The result
-
-