public class JUnitTestRunner extends java.lang.Object implements junit.framework.TestListener, IJUnitTestRunner
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SUITE_METHODNAME |
JUNIT_4_TESTRUNNER, JUNIT_TESTRUNNER
Constructor and Description |
---|
JUnitTestRunner() |
JUnitTestRunner(ITestResultNotifier tr) |
Modifier and Type | Method and Description |
---|---|
void |
addError(junit.framework.Test test,
java.lang.Throwable t) |
void |
addFailure(junit.framework.Test test,
junit.framework.AssertionFailedError t) |
protected junit.framework.TestResult |
createTestResult()
Creates the TestResult to be used for the test run.
|
protected junit.framework.TestResult |
doRun(junit.framework.Test suite) |
void |
endTest(junit.framework.Test test) |
protected junit.framework.Test |
getTest(java.lang.Class testClass,
java.lang.String... methods)
Returns the Test corresponding to the given suite.
|
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)
A
start implementation that ignores the TestResult |
protected void |
runFailed(java.lang.Class clazz,
java.lang.String message) |
void |
setInvokedMethodListeners(java.util.Collection<IInvokedMethodListener> listeners) |
void |
setTestResultNotifier(ITestResultNotifier notifier) |
junit.framework.TestResult |
start(java.lang.Class testCase,
java.lang.String... methods)
Starts a test run.
|
void |
startTest(junit.framework.Test test) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createTestRunner
public static final java.lang.String SUITE_METHODNAME
public JUnitTestRunner()
public JUnitTestRunner(ITestResultNotifier tr)
public java.util.List<ITestNGMethod> getTestMethods()
getTestMethods
in interface IJUnitTestRunner
public void setTestResultNotifier(ITestResultNotifier notifier)
setTestResultNotifier
in interface IJUnitTestRunner
public void startTest(junit.framework.Test test)
startTest
in interface junit.framework.TestListener
TestListener.startTest(junit.framework.Test)
public void addError(junit.framework.Test test, java.lang.Throwable t)
addError
in interface junit.framework.TestListener
TestListener.addError(junit.framework.Test, java.lang.Throwable)
public void addFailure(junit.framework.Test test, junit.framework.AssertionFailedError t)
addFailure
in interface junit.framework.TestListener
TestListener.addFailure(junit.framework.Test,
junit.framework.AssertionFailedError)
public void endTest(junit.framework.Test test)
endTest
in interface junit.framework.TestListener
TestListener.endTest(junit.framework.Test)
public void setInvokedMethodListeners(java.util.Collection<IInvokedMethodListener> listeners)
setInvokedMethodListeners
in interface IJUnitTestRunner
protected junit.framework.Test getTest(java.lang.Class testClass, java.lang.String... methods)
public void run(java.lang.Class testClass, java.lang.String... methods)
start
implementation that ignores the TestResult
run
in interface IJUnitTestRunner
testClass
- the JUnit test classpublic junit.framework.TestResult start(java.lang.Class testCase, java.lang.String... methods)
protected void runFailed(java.lang.Class clazz, java.lang.String message)
protected junit.framework.TestResult createTestResult()
protected junit.framework.TestResult doRun(junit.framework.Test suite)