-package org.simantics.tests.modelled.junit;\r
-\r
-import java.util.List;\r
-\r
-import org.junit.runner.Description;\r
-import org.junit.runner.Result;\r
-import org.junit.runner.Runner;\r
-import org.junit.runner.notification.Failure;\r
-import org.junit.runner.notification.RunListener;\r
-import org.junit.runner.notification.RunNotifier;\r
-import org.junit.runners.ParentRunner;\r
-\r
-public abstract class RuntimeSTSRunner extends ParentRunner<Runner> {\r
-\r
- public RuntimeSTSRunner(Class<?> testClass) throws Exception {\r
- super(testClass);\r
- }\r
-\r
- public abstract void initialize() throws Exception;\r
-\r
- public abstract void deinitialize() throws Exception;\r
-\r
- @Override\r
- protected List<Runner> getChildren() {\r
- System.out.println("getting children");\r
- return RuntimeTestCollector.collectTests();\r
- }\r
-\r
- @Override\r
- protected Description describeChild(Runner child) {\r
- return child.getDescription();\r
- }\r
-\r
- @Override\r
- public void run(RunNotifier notifier) {\r
- notifier.addListener(new RunListener() {\r
-\r
- @Override\r
- public void testRunFinished(Result result) throws Exception {\r
- deinitialize();\r
- }\r
- });\r
- super.run(notifier);\r
- }\r
-\r
- @Override\r
- protected void runChild(Runner child, RunNotifier notifier) {\r
- Description desc = describeChild(child);\r
- notifier.fireTestStarted(desc);\r
- try {\r
- child.run(notifier);\r
- notifier.fireTestFinished(desc);\r
- } catch (Throwable e) {\r
- notifier.fireTestFailure(new Failure(desc, e));\r
- }\r
- }\r
-}\r
+package org.simantics.tests.modelled.junit;
+
+import org.junit.runner.Description;
+import org.junit.runner.Result;
+import org.junit.runner.Runner;
+import org.junit.runner.notification.Failure;
+import org.junit.runner.notification.RunListener;
+import org.junit.runner.notification.RunNotifier;
+import org.junit.runners.ParentRunner;
+
+@Deprecated
+public abstract class RuntimeSTSRunner<T extends Runner> extends ParentRunner<T> {
+
+ public RuntimeSTSRunner(Class<?> testClass) throws Exception {
+ super(testClass);
+ }
+
+ public abstract void initialize() throws Exception;
+
+ public abstract void deinitialize() throws Exception;
+
+ @Override
+ protected Description describeChild(Runner child) {
+ return child.getDescription();
+ }
+
+ @Override
+ public void run(RunNotifier notifier) {
+ notifier.addListener(new RunListener() {
+
+ @Override
+ public void testRunFinished(Result result) throws Exception {
+ deinitialize();
+ }
+ });
+ super.run(notifier);
+ }
+
+ @Override
+ protected void runChild(Runner child, RunNotifier notifier) {
+ Description desc = describeChild(child);
+ notifier.fireTestStarted(desc);
+ try {
+ child.run(notifier);
+ notifier.fireTestFinished(desc);
+ } catch (Throwable e) {
+ notifier.fireTestFailure(new Failure(desc, e));
+ }
+ }
+}