java.lang.Object | |
↳ | org.junit.runner.JUnitCore |
JUnitCore
is a facade for running tests. It supports running JUnit 4 tests,
JUnit 3.8.x tests, and mixtures. To run tests from the command line, run
java org.junit.runner.JUnitCore TestClass1 TestClass2 ...
.
For one-shot test runs, use the static method runClasses(Class[])
.
If you want to add special listeners,
create an instance of JUnitCore
first and use it to run the tests.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new
JUnitCore to run tests. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add a listener to be notified as the tests run.
| |||||||||||
Run the tests contained in the classes named in the
args . | |||||||||||
Remove a listener.
| |||||||||||
Run all the tests contained in
request . | |||||||||||
Run all the tests in
classes . | |||||||||||
Run all the tests contained in JUnit 3.8.x
test . | |||||||||||
Do not use.
| |||||||||||
Run all the tests in
classes . | |||||||||||
Run the tests contained in
classes . | |||||||||||
Run the tests contained in
classes . | |||||||||||
Do not use.
| |||||||||||
Do not use.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Create a new JUnitCore
to run tests.
Add a listener to be notified as the tests run.
listener | the listener to add |
---|
Run the tests contained in the classes named in the args
.
If all tests run successfully, exit with a status of 0. Otherwise exit with a status of 1.
Write feedback while tests are running and write
stack traces for all failed tests after the tests all complete.
args | names of classes in which to find tests to run |
---|
Remove a listener.
listener | the listener to remove |
---|
Run all the tests contained in request
.
request | the request describing tests |
---|
Result
describing the details of the test run and the failed tests.
Run all the tests in classes
.
classes | the classes containing tests |
---|
Result
describing the details of the test run and the failed tests.
Run all the tests contained in JUnit 3.8.x test
. Here for backward compatibility.
test | the old-style test |
---|
Result
describing the details of the test run and the failed tests.
Run all the tests in classes
.
computer | Helps construct Runners from classes |
---|---|
classes | the classes containing tests |
Result
describing the details of the test run and the failed tests.
Run the tests contained in classes
. Write feedback while the tests
are running and write stack traces for all failed tests after all tests complete. This is
similar to main(String[])
, but intended to be used programmatically.
computer | Helps construct Runners from classes |
---|---|
classes | Classes in which to find tests |
Result
describing the details of the test run and the failed tests.
Run the tests contained in classes
. Write feedback while the tests
are running and write stack traces for all failed tests after all tests complete. This is
similar to main(String[])
, but intended to be used programmatically.
classes | Classes in which to find tests |
---|
Result
describing the details of the test run and the failed tests.
Do not use. Testing purposes only.