1 package org.simantics.tests.modelled.junit;
3 import java.util.ArrayList;
4 import java.util.Collection;
7 import org.junit.runner.Description;
8 import org.simantics.scl.compiler.commands.CommandSession;
9 import org.simantics.scl.osgi.SCLOsgi;
11 public class RuntimeSTSSuiteRunner extends RuntimeSTSRunner<RuntimeSTSTestRunner> {
13 private final List<RuntimeSTSTestRunner> children = new ArrayList<>();
14 private final String suiteName;
16 protected RuntimeSTSSuiteRunner(Class<?> clazz, String suiteName) throws Exception {
18 this.suiteName = suiteName;
22 protected String getName() {
27 public Description getDescription() {
28 Description description = Description.createSuiteDescription(getName(), getRunnerAnnotations());
29 getChildren().forEach(child -> description.addChild(describeChild(child)));
33 public void addChildren(Collection<RuntimeSTSTestRunner> testChildren) {
34 CommandSession session = new CommandSession(SCLOsgi.MODULE_REPOSITORY, null);
35 testChildren.forEach(c -> c.setCommandSession(session));
36 children.addAll(testChildren);
40 public List<RuntimeSTSTestRunner> getChildren() {
45 public void initialize() throws Exception {
49 public void deinitialize() throws Exception {