use of org.junit.runners.model.InitializationError in project junit4 by junit-team.
the class Request method classes.
/**
* Create a <code>Request</code> that, when processed, will run all the tests
* in a set of classes.
*
* @param computer Helps construct Runners from classes
* @param classes the classes containing the tests
* @return a <code>Request</code> that will cause all tests in the classes to be run
*/
public static Request classes(Computer computer, Class<?>... classes) {
try {
AllDefaultPossibilitiesBuilder builder = new AllDefaultPossibilitiesBuilder();
Runner suite = computer.getSuite(builder, classes);
return runner(suite);
} catch (InitializationError e) {
return runner(new ErrorReportingRunner(e, classes));
}
}
use of org.junit.runners.model.InitializationError in project sofa-ark by alipay.
the class ArkJUnit4RunnerTest method testJUnitRunner.
@Test
public void testJUnitRunner() {
try {
Assert.assertTrue("@Before".equals(state));
state = "@Test";
ArkJUnit4Runner runner = new ArkJUnit4Runner(ArkJUnit4RunnerTest.class);
ClassLoader loader = runner.getTestClass().getJavaClass().getClassLoader();
Assert.assertTrue(loader.getClass().getCanonicalName().equals(TestClassLoader.class.getCanonicalName()));
} catch (InitializationError error) {
Assert.fail(error.getMessage());
}
}
Aggregations