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;
11 public abstract class RuntimeSTSRunner<T extends Runner> extends ParentRunner<T> {
13 public RuntimeSTSRunner(Class<?> testClass) throws Exception {
17 public abstract void initialize() throws Exception;
19 public abstract void deinitialize() throws Exception;
22 protected Description describeChild(Runner child) {
23 return child.getDescription();
27 public void run(RunNotifier notifier) {
28 notifier.addListener(new RunListener() {
31 public void testRunFinished(Result result) throws Exception {
39 protected void runChild(Runner child, RunNotifier notifier) {
40 Description desc = describeChild(child);
41 notifier.fireTestStarted(desc);
44 notifier.fireTestFinished(desc);
45 } catch (Throwable e) {
46 notifier.fireTestFailure(new Failure(desc, e));