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