package org.simantics.tests.modelled.junit; import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.junit.runner.Description; import org.simantics.scl.compiler.commands.CommandSession; import org.simantics.scl.osgi.SCLOsgi; public class RuntimeSTSSuiteRunner extends RuntimeSTSRunner { private final List children = new ArrayList<>(); private final String suiteName; protected RuntimeSTSSuiteRunner(Class clazz, String suiteName) throws Exception { super(clazz); this.suiteName = suiteName; } @Override protected String getName() { return suiteName; } @Override public Description getDescription() { Description description = Description.createSuiteDescription(getName(), getRunnerAnnotations()); getChildren().forEach(child -> description.addChild(describeChild(child))); return description; } public void addChildren(Collection testChildren) { CommandSession session = new CommandSession(SCLOsgi.MODULE_REPOSITORY, null); testChildren.forEach(c -> c.setCommandSession(session)); children.addAll(testChildren); } @Override public List getChildren() { return children; } @Override public void initialize() throws Exception { } @Override public void deinitialize() throws Exception { } }