Save This Page
Home » JUnit-4.7 » org.junit.runner » [javadoc | source]
org.junit.runner
public class: JUnitCore [javadoc | source]
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 org.junit.runner.JUnitCore first and use it to run the tests.
Constructor:
 public JUnitCore() 
Method from org.junit.runner.JUnitCore Summary:
addListener,   defaultComputer,   getVersion,   main,   removeListener,   run,   run,   run,   run,   run,   runClasses,   runClasses,   runMain,   runMainAndExit
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.junit.runner.JUnitCore Detail:
 public  void addListener(RunListener listener) 
    Add a listener to be notified as the tests run.
 static Computer defaultComputer() 
 public String getVersion() 
 public static  void main(String args) 
    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.
 public  void removeListener(RunListener listener) 
    Remove a listener.
 public Result run(Class<?> classes) 
    Run all the tests in classes.
 public Result run(Request request) 
    Run all the tests contained in request.
 public Result run(Test test) 
    Run all the tests contained in JUnit 3.8.x test. Here for backward compatibility.
 public Result run(Runner runner) 
    Do not use. Testing purposes only.
 public Result run(Computer computer,
    Class<?> classes) 
    Run all the tests in classes.
 public static Result runClasses(Class<?> classes) 
    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.
 public static Result runClasses(Computer computer,
    Class<?> classes) 
    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.
 public Result runMain(JUnitSystem system,
    String args) 
    Do not use. Testing purposes only.
 public static  void runMainAndExit(JUnitSystem system,
    String args) 
    Do not use. Testing purposes only.