use of org.junit.runner.Runner in project ceylon-compiler by ceylon.
the class CeylonModuleRunner method makeModuleRunnerInNewJvm.
private void makeModuleRunnerInNewJvm(final ModuleSpecifier module) {
final Description description = Description.createTestDescription(getClass(), "Run " + module.module() + " in new JVM");
Runner runner = new Runner() {
@Override
public Description getDescription() {
return description;
}
@Override
public void run(RunNotifier notifier) {
notifier.fireTestStarted(description);
try {
String moduleName = module.module();
String version = Module.DEFAULT_MODULE_NAME.equals(moduleName) ? null : module.version();
String runClass = module.runClass();
if (runClass.isEmpty())
runClass = moduleName + ".run_";
runModuleInNewJvm(moduleName, version, runClass);
} catch (Exception x) {
x.printStackTrace();
notifier.fireTestFailure(new Failure(description, x));
}
notifier.fireTestFinished(description);
}
};
children.put(runner, description);
}
Aggregations