1 package org.simantics.tests.modelled.junit;
5 import org.junit.runner.Description;
6 import org.junit.runner.Result;
7 import org.junit.runner.Runner;
8 import org.junit.runner.notification.Failure;
9 import org.junit.runner.notification.RunListener;
10 import org.junit.runner.notification.RunNotifier;
11 import org.junit.runners.ParentRunner;
13 public abstract class RuntimeSTSRunner<T extends Runner> extends ParentRunner<T> {
15 public RuntimeSTSRunner(Class<?> testClass) throws Exception {
19 public abstract void initialize() throws Exception;
21 public abstract void deinitialize() throws Exception;
24 protected Description describeChild(Runner child) {
25 return child.getDescription();
29 public void run(RunNotifier notifier) {
30 notifier.addListener(new RunListener() {
33 public void testRunFinished(Result result) throws Exception {
41 protected void runChild(Runner child, RunNotifier notifier) {
42 Description desc = describeChild(child);
43 notifier.fireTestStarted(desc);
46 notifier.fireTestFinished(desc);
47 } catch (Throwable e) {
48 notifier.fireTestFailure(new Failure(desc, e));