/** * Run the tests contained in <code>classes</code>. Write feedback while the tests * are running and write stack traces for all failed tests after all tests complete. This is * similar to {@link #main(String[])}, but intended to be used programmatically. * * @param classes Classes in which to find tests * @return a {@link Result} describing the details of the test run and the failed tests. */ public static Result runClasses(Class<?>... classes) { return runClasses(defaultComputer(), classes); }
public static void main(String[] args) { try { H2O.main(args); TestUtil.stall_till_cloudsize(3); List<Class> tests = JUnitRunner.all(); Result r = org.junit.runner.JUnitCore.runClasses(tests.toArray(new Class[0])); if( r.getFailureCount() == 0 ) { System.out.println("Successfully ran the following tests in " + (r.getRunTime() / 1000) + "s"); for( Class c : tests ) System.out.println(c.getName()); } else { for( Failure f : r.getFailures() ) { System.err.println(f.getDescription()); if( f.getException() != null ) f.getException().printStackTrace(); } } System.exit(r.getFailureCount()); } catch( Throwable t ) { t.printStackTrace(); System.exit(1); } } }
@Test public void testRuleIsIntroducedAndEvaluated() { SimpleTest.wasRun = false; JUnitCore.runClasses(SimpleTest.class); assertThat(SimpleTest.wasRun, is(true)); }
@Test public void testBadRegistry() { assertThat(JUnitCore.runClasses(TestBadRegistry.class).wasSuccessful(), is(true)); } }
@Test public void testMock() { assertThat(JUnitCore.runClasses(TestMocking.class).wasSuccessful(), is(true)); }
@Test public void testScopeName() { assertThat(JUnitCore.runClasses(TestScopeName.class).wasSuccessful(), is(true)); }
@Test public void testInjectAndGetInstance() { assertThat(JUnitCore.runClasses(TestInjectionAndGetInstance.class).wasSuccessful(), is(true)); }
protected org.junit.runner.Result runJUnitClass(Class<?> fixtureClass) { org.junit.runner.Result jUnitResult = JUnitCore.runClasses(fixtureClass); return jUnitResult; }
protected org.junit.runner.Result runJUnitClass(Class<?> fixtureClass) { org.junit.runner.Result jUnitResult = JUnitCore.runClasses(fixtureClass); return jUnitResult; }
public static void main(String[] args) { JUnitCore.runClasses(FedoraServerTestCase.class); } }
private Result runTest(String baseUrl, int timeoutInSeconds, Class<?> clazz) { return JUnitCore.runClasses(new SeleniumComputer(baseUrl, timeoutInSeconds), clazz); }
public static void main(String[] argv) { Class<?> [] classesArray = { ColorJdkTest.class }; JUnitCore.runClasses(classesArray); } }
public static void main(String[] args) { org.junit.runner.JUnitCore.runClasses(TDFReadWriteTest.class); } }
/** * Utility function: each DetoxTestCase subclass can have a main() method that calls this, to create a test suite consisting of * just this test. Useful when investigating a single failing test. */ protected static void justThisTest(Class<?> testClass) { JUnitCore.runClasses(testClass); }
/** * Run the tests contained in <code>classes</code>. Write feedback while the tests * are running and write stack traces for all failed tests after all tests complete. This is * similar to {@link #main(String[])}, but intended to be used programmatically. * * @param classes Classes in which to find tests * @return a {@link Result} describing the details of the test run and the failed tests. */ public static Result runClasses(Class<?>... classes) { return runClasses(defaultComputer(), classes); }
/** * Run the tests contained in <code>classes</code>. Write feedback while the tests * are running and write stack traces for all failed tests after all tests complete. This is * similar to {@link #main(String[])}, but intended to be used programmatically. * * @param classes Classes in which to find tests * @return a {@link Result} describing the details of the test run and the failed tests. */ public static Result runClasses(Class<?>... classes) { return runClasses(defaultComputer(), classes); }
public static void main(String[] argv) { Class<?> [] classesArray = { ColorLogbackTest.class }; JUnitCore.runClasses(classesArray); } }
@Test public void testMethodSignatures() throws Exception { ProxyCompiler.compile("tests/python/custom_proxymaker/junit_test.py", "build/classes"); JUnitCore.runClasses(Class.forName("custom_proxymaker.tests.JUnitTest")); } }
public static void main(String[] args) { Result result = JUnitCore.runClasses(TestSuite.class); for (Failure failure : result.getFailures()) { System.out.println(failure.toString()); } System.out.println(result.wasSuccessful()); } }
protected void runTest(Class testClass) { List<Failure> failures = JUnitCore.runClasses(testClass).getFailures(); StringBuffer message = new StringBuffer("The test should have NOT failed but it did!"); if (!failures.isEmpty()) { message.append("The stacktrace:\n" + failures.get(0).getTrace()); } Assert.assertTrue(message.toString(), failures.isEmpty()); } }