All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class junit.textui.TestRunner

java.lang.Object
   |
   +----junit.textui.TestRunner

public class TestRunner
extends Object
A command line based tool to run tests.
 java test.testui.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.


Constructor Index

 o TestRunner()

Method Index

 o createTestResult()
Creates the TestResult to be used for the test run.
 o doRun(Test, boolean)
 o main(String[])
main entry point.
 o run(Test)
Runs a single test and collects its results.
 o runAndWait(Test)
Runs a single test and waits until the users types RETURN.
 o start(String[])
Starts a test run.

Constructors

 o TestRunner
 public TestRunner()

Methods

 o createTestResult
 protected TextTestResult createTestResult()
Creates the TestResult to be used for the test run.

 o doRun
 protected void doRun(Test suite,
                      boolean wait)
 o main
 public static void main(String args[])
main entry point.

 o run
 public static void run(Test suite)
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());
 }
 

 o runAndWait
 public static void runAndWait(Test suite)
Runs a single test and waits until the users types RETURN.

See Also:
run
 o start
 protected void start(String args[])
Starts a test run. Analyzes the command line arguments and runs the given test suite.


All Packages  Class Hierarchy  This Package  Previous  Next  Index