|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.junit.runner.JUnitCore
public class 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... classes)
. If you want to add special listeners,
create an instance of JUnitCore first and use it to run the tests.
Result,
RunListener,
Request| Constructor Summary | |
|---|---|
JUnitCore()
Create a new JUnitCore to run tests. |
|
| Method Summary | |
|---|---|
void |
addListener(RunListener listener)
Add a listener to be notified as the tests run. |
java.lang.String |
getVersion()
|
static void |
main(java.lang.String... args)
Run the tests contained in the classes named in the args. |
void |
removeListener(RunListener listener)
Remove a listener. |
Result |
run(java.lang.Class... classes)
Run all the tests in classes. |
Result |
run(Request request)
Run all the tests contained in request. |
Result |
run(Runner runner)
Do not use. |
Result |
run(junit.framework.Test test)
Run all the tests contained in JUnit 3.8.x test. |
static Result |
runClasses(java.lang.Class... classes)
Run the tests contained in classes. |
Result |
runMain(java.lang.String... args)
Do not use. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JUnitCore()
JUnitCore to run tests.
| Method Detail |
|---|
public static void main(java.lang.String... args)
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 runpublic static Result runClasses(java.lang.Class... classes)
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(), 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.public Result runMain(java.lang.String... args)
public java.lang.String getVersion()
public Result run(java.lang.Class... classes)
classes.
classes - the classes containing tests
Result describing the details of the test run and the failed tests.public Result run(Request request)
request.
request - the request describing tests
Result describing the details of the test run and the failed tests.public Result run(junit.framework.Test test)
test. Here for backward compatibility.
test - the old-style test
Result describing the details of the test run and the failed tests.public Result run(Runner runner)
public void addListener(RunListener listener)
listener - the listenerRunListenerpublic void removeListener(RunListener listener)
listener - the listener to remove
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||