]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/junit/RuntimeSTSSuiteRunner.java
Merge changes Ib64cf026,I238948da
[simantics/platform.git] / bundles / org.simantics.tests.modelled / src / org / simantics / tests / modelled / junit / RuntimeSTSSuiteRunner.java
1 package org.simantics.tests.modelled.junit;
2
3 import java.util.ArrayList;
4 import java.util.Collection;
5 import java.util.List;
6
7 import org.junit.runner.Description;
8 import org.simantics.scl.compiler.commands.CommandSession;
9 import org.simantics.scl.osgi.SCLOsgi;
10
11 @Deprecated
12 public class RuntimeSTSSuiteRunner extends RuntimeSTSRunner<RuntimeSTSTestRunner> {
13
14     private final List<RuntimeSTSTestRunner> children = new ArrayList<>();
15     private final String suiteName;
16
17     protected RuntimeSTSSuiteRunner(Class<?> clazz, String suiteName) throws Exception {
18         super(clazz);
19         this.suiteName = suiteName;
20     }
21
22     @Override
23     protected String getName() {
24         return suiteName;
25     }
26
27     @Override
28     public Description getDescription() {
29         Description description = Description.createSuiteDescription(getName(), getRunnerAnnotations());
30         getChildren().forEach(child -> description.addChild(describeChild(child)));
31         return description;
32     }
33
34     public void addChildren(Collection<RuntimeSTSTestRunner> testChildren) {
35         CommandSession session = new CommandSession(SCLOsgi.MODULE_REPOSITORY, null);
36         testChildren.forEach(c -> c.setCommandSession(session));
37         children.addAll(testChildren);
38     }
39     
40     @Override
41     protected boolean isIgnored(RuntimeSTSTestRunner child) {
42         // TODO Auto-generated method stub
43         return super.isIgnored(child);
44     }
45
46     @Override
47     public List<RuntimeSTSTestRunner> getChildren() {
48         return children;
49     }
50
51     @Override
52     public void initialize() throws Exception {
53     }
54     
55     @Override
56     public void deinitialize() throws Exception {
57     }
58
59 }