1 package org.simantics.tests.modelled.junit;
3 import org.junit.runner.Description;
4 import org.junit.runner.Result;
5 import org.junit.runner.Runner;
6 import org.junit.runner.notification.Failure;
7 import org.junit.runner.notification.RunListener;
8 import org.junit.runner.notification.RunNotifier;
9 import org.junit.runners.ParentRunner;
12 public abstract class RuntimeSTSRunner<T extends Runner> extends ParentRunner<T> {
14 public RuntimeSTSRunner(Class<?> testClass) throws Exception {
18 public abstract void initialize() throws Exception;
20 public abstract void deinitialize() throws Exception;
23 protected Description describeChild(Runner child) {
24 return child.getDescription();
28 public void run(RunNotifier notifier) {
29 notifier.addListener(new RunListener() {
32 public void testRunFinished(Result result) throws Exception {
40 protected void runChild(Runner child, RunNotifier notifier) {
41 Description desc = describeChild(child);
42 notifier.fireTestStarted(desc);
45 notifier.fireTestFinished(desc);
46 } catch (Throwable e) {
47 notifier.fireTestFailure(new Failure(desc, e));