java.lang.Object | ||
↳ | junit.runner.BaseTestRunner | |
↳ | junit.textui.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.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | EXCEPTION_EXIT | ||||||||||
int | FAILURE_EXIT | ||||||||||
int | SUCCESS_EXIT |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
junit.runner.BaseTestRunner
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a TestRunner.
| |||||||||||
Constructs a TestRunner using the given stream for all the output
| |||||||||||
Constructs a TestRunner using the given ResultPrinter all the output
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Runs a suite extracted from a TestCase subclass.
| |||||||||||
Runs a single test and collects its results.
| |||||||||||
Runs a single test and waits until the user
types RETURN.
| |||||||||||
Starts a test run.
| |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates the TestResult to be used for the test run.
| |||||||||||
Override to define how to handle a failed loading of
a test suite.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
junit.runner.BaseTestRunner
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
junit.framework.TestListener
|
Constructs a TestRunner.
Constructs a TestRunner using the given stream for all the output
Constructs a TestRunner using the given ResultPrinter all the output
Runs a suite extracted from a TestCase subclass.
Runs a single test and collects its results. This method can be used to start a test run from your program.
public static void main (String[] args) { test.textui.TestRunner.run(suite()); }
Runs a single test and waits until the user types RETURN.
Starts a test run. Analyzes the command line arguments and runs the given test suite.
Exception |
---|
Override to define how to handle a failed loading of a test suite.
Exception |
---|