1 package org.simantics.tests.modelled.junit;
\r
3 import java.util.ArrayList;
\r
4 import java.util.Collection;
\r
5 import java.util.List;
\r
7 import org.junit.runner.Description;
\r
8 import org.junit.runner.Runner;
\r
9 import org.simantics.scl.compiler.commands.CommandSession;
\r
10 import org.simantics.scl.osgi.SCLOsgi;
\r
12 public class RuntimeSTSSuiteRunner extends RuntimeSTSRunner {
\r
14 private final List<RuntimeSTSTestRunner> children = new ArrayList<>();
\r
15 private final String suiteName;
\r
17 RuntimeSTSSuiteRunner(String suiteName) throws Exception {
\r
18 super(RuntimeSTSSuiteRunner.class);
\r
19 this.suiteName = suiteName;
\r
23 protected String getName() {
\r
28 public Description getDescription() {
\r
29 Description description = Description.createSuiteDescription(getName(), getRunnerAnnotations());
\r
30 getChildren().forEach(child -> description.addChild(describeChild(child)));
\r
34 public void addChildren(Collection<RuntimeSTSTestRunner> testChildren) {
\r
35 CommandSession session = new CommandSession(SCLOsgi.MODULE_REPOSITORY, null);
\r
36 testChildren.forEach(c -> c.setCommandSession(session));
\r
37 children.addAll(testChildren);
\r
40 @SuppressWarnings({ "unchecked", "rawtypes" })
\r
42 protected List<Runner> getChildren() {
\r
43 return (List) children;
\r
47 public void initialize() {
\r
51 public void deinitialize() {
\r