/** * Run the tests contained in the classes named in the <code>args</code>. * 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. * * @param args names of classes in which to find tests to run */ public static void main(String... args) { runMainAndExit(new RealSystem(), args); }
/** * Run the tests contained in the classes named in the <code>args</code>. * 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. * * @param args names of classes in which to find tests to run */ public static void main(String... args) { Result result = new JUnitCore().runMain(new RealSystem(), args); System.exit(result.wasSuccessful() ? 0 : 1); }
/** * Run the tests contained in the classes named in the <code>args</code>. * 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. * * @param args names of classes in which to find tests to run */ public static void main(String... args) { runMainAndExit(new RealSystem(), args); }
Result r = JUnitCore.runMain(new RealSystem(), TestReader.class.getName())
JUnitCore.runMainAndExit(new RealSystem(), DefaultTest.class.getName(), PublicTest.class.getName());
/** * Run the tests contained in the classes named in the <code>args</code>. * 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. * * @param args names of classes in which to find tests to run */ public static void main(String... args) { runMainAndExit(new RealSystem(), args); }
/** * Run the tests contained in the classes named in the <code>args</code>. * 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. * * @param args names of classes in which to find tests to run */ public static void main(String... args) { runMainAndExit(new RealSystem(), args); }
public static void main(String... args) { Result result = new JUnitCore().runMain(new RealSystem(), args); System.exit(result.wasSuccessful() ? 0 : 1); }
public class MyRunner { public static void main(String... args) throws IOException { String path = System.getProperty("resultPath"); if (path == null) { throw new NullPointerException("must specify resultPath property"); } // Possibly install a security manager to prevent calls to System.exit() Result result = new JUnitCore().runMain(new RealSystem(), args); try (ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(path)) { out.writeObject(result); } System.exit(result.wasSuccessful() ? 0 : 1); } }
runMainAndExit(new RealSystem(), args);
/** * Run the tests contained in the classes named in the <code>args</code>. * 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. * * @param args names of classes in which to find tests to run */ public static void main(String... args) { Result result = new JUnitCore().runMain(new RealSystem(), args); System.exit(result.wasSuccessful() ? 0 : 1); }
/** * Run the tests contained in the classes named in the <code>args</code>. * 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. * * @param args names of classes in which to find tests to run */ public static void main(String... args) { Result result = new JUnitCore().runMain(new RealSystem(), args); System.exit(result.wasSuccessful() ? 0 : 1); }
public static void run(final Class... suites) { boolean underTC = System.getenv(TEAMCITY_DETECT_VAR_NAME) != null; // prepare junit JUnitSystem system = new RealSystem(); JUnitCore core = new JUnitCore(); RunListener listener = underTC ? new TeamCityListener() : new TextListener(system); core.addListener(listener); int success = 0, failures = 0, ignores = 0; // run tests for (Class suite : suites) { sayNothing(); String suiteName = suite.getSimpleName(); if (suiteName.endsWith("Tests")) suiteName = suiteName.substring(0, suiteName.length()-"Tests".length()); if (suiteName.endsWith("Integration")) suiteName = suiteName.substring(0, suiteName.length()-"Integration".length()); if (suiteParameter != null) suiteName = suiteName + '[' + suiteParameter + ']'; if (underTC) say("##teamcity[testSuiteStarted name='%s']", suiteName); Result result = core.run(suite); success += result.getRunCount() - (result.getFailureCount() + result.getIgnoreCount()); failures += result.getFailureCount(); ignores += result.getIgnoreCount(); if (underTC) say("##teamcity[testSuiteFinished name='%s']", suiteName); sayNothing(); } }
private void run(String[] args) { JUnitSystem system = new RealSystem(); JUnitCore junitCore = new JUnitCore(); system.out().println("SVMJUnitCore");
JUnitSystem system = new RealSystem(); JUnitCore junitCore = new JUnitCore(); system.out().println("TruffleJUnitCore");