java.lang.Object | +--junit.runner.BaseTestRunner | +--junit.textui.TestRunner
static int | |
static int | |
static int |
Constructs a TestRunner. |
TestRunner(PrintStream writer) Constructs a TestRunner using the given stream for all the output |
TestRunner(ResultPrinter printer) Constructs a TestRunner using the given ResultPrinter all the output |
Creates the TestResult to be used for the test run. | |
Always use the StandardTestSuiteLoader. | |
static void | main(String[] args) |
void | pause(boolean wait) |
static void | run(Class testClass) Runs a suite extracted from a TestCase subclass. |
static TestResult | Runs a single test and collects its results. |
static void | runAndWait(Test suite) Runs a single test and waits until the user types RETURN. |
void | runFailed(String message) |
void | setPrinter(ResultPrinter printer) |
start(String[] args) Starts a test run. | |
void | testEnded(String testName) |
void | testFailed(int status, Test test, Throwable t) |
void | testStarted(String testName) |
public static final int EXCEPTION_EXIT
public static final int FAILURE_EXIT
public static final int SUCCESS_EXIT
public TestRunner()
public TestRunner(PrintStream writer)
public TestRunner(ResultPrinter printer)
protected TestResult createTestResult()
public TestResult doRun(Test test)
public TestResult doRun(Test suite, boolean wait)
public TestSuiteLoader getLoader()
public static void main(String[] args)
protected void pause(boolean wait)
public static void run(Class testClass)
public static TestResult run(Test test)
public static void main (String[] args) { test.textui.TestRunner.run(suite()); }
public static void runAndWait(Test suite)
protected void runFailed(String message)
public void setPrinter(ResultPrinter printer)
protected TestResult start(String[] args)
public void testEnded(String testName)
public void testFailed(int status, Test test, Throwable t)
public void testStarted(String testName)
suite
method it will be invoked and the returned test is run. Otherwise all the methods starting with "test" having no arguments are run. When the wait command line argument is given TestRunner waits until the users types RETURN. TestRunner prints a trace as the tests are executed followed by a summary at the end.