|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.runner.BaseTestRunner junit.textui.TestRunner
public class TestRunner
A command line based tool to run tests.
java junit.textui.TestRunner [-wait] TestCaseClass
TestRunner expects the name of a TestCase class as argument.
If this class defines a static 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.
Field Summary | |
---|---|
static int |
EXCEPTION_EXIT
|
static int |
FAILURE_EXIT
|
static int |
SUCCESS_EXIT
|
Fields inherited from class junit.runner.BaseTestRunner |
---|
SUITE_METHODNAME |
Constructor Summary | |
---|---|
TestRunner()
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 |
Method Summary | |
---|---|
TestResult |
doRun(Test test)
|
TestResult |
doRun(Test suite,
boolean wait)
|
static void |
main(String[] args)
|
static void |
run(Class<? extends TestCase> testClass)
Runs a suite extracted from a TestCase subclass. |
static TestResult |
run(Test test)
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 |
setPrinter(ResultPrinter printer)
|
TestResult |
start(String[] args)
Starts a test run. |
void |
testEnded(String testName)
|
void |
testFailed(int status,
Test test,
Throwable t)
|
void |
testStarted(String testName)
|
Methods inherited from class junit.runner.BaseTestRunner |
---|
addError, addFailure, elapsedTimeAsString, endTest, extractClassName, getFilteredTrace, getFilteredTrace, getPreference, getPreference, getTest, savePreferences, setLoading, setPreference, startTest, truncate |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SUCCESS_EXIT
public static final int FAILURE_EXIT
public static final int EXCEPTION_EXIT
Constructor Detail |
---|
public TestRunner()
public TestRunner(PrintStream writer)
public TestRunner(ResultPrinter printer)
Method Detail |
---|
public static void run(Class<? extends TestCase> testClass)
public static TestResult run(Test test)
public static void main (String[] args) { test.textui.TestRunner.run(suite()); }
public static void runAndWait(Test suite)
public void testFailed(int status, Test test, Throwable t)
testFailed
in class BaseTestRunner
public void testStarted(String testName)
testStarted
in class BaseTestRunner
public void testEnded(String testName)
testEnded
in class BaseTestRunner
public TestResult doRun(Test test)
public TestResult doRun(Test suite, boolean wait)
public static void main(String[] args)
public TestResult start(String[] args) throws Exception
Exception
public void setPrinter(ResultPrinter printer)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |