]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/junit/v2/ModelledSTSTestRunner.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.tests.modelled / src / org / simantics / tests / modelled / junit / v2 / ModelledSTSTestRunner.java
1 package org.simantics.tests.modelled.junit.v2;
2
3 import java.io.IOException;
4 import java.util.List;
5
6 import org.junit.runner.Description;
7 import org.junit.runner.Runner;
8 import org.junit.runner.notification.RunNotifier;
9 import org.simantics.tests.modelled.utils.ModelledSTSTest;
10 import org.simantics.tests.modelled.utils.ModelledSTSTest.CommandSessionVariable;
11
12 public class ModelledSTSTestRunner extends Runner {
13
14     private Description description;
15     private ModelledSTSTest test;
16
17     public ModelledSTSTestRunner(ModelledSTSTest test) {
18         this.test = test;
19     }
20
21     @Override
22     public Description getDescription() {
23         if (description == null)
24             description = Description.createTestDescription(test.getParentName(), test.getName(), new Integer(test.hashCode()));
25         return description;
26     }
27
28     public List<CommandSessionVariable> runWithVars(List<CommandSessionVariable> vars) throws IOException {
29         return test.run(vars);
30     }
31     
32     @Override
33     public void run(RunNotifier notifier) {
34         throw new UnsupportedOperationException();
35     }
36
37     public boolean isIgnored() {
38         return test.isIgnored();
39     }
40
41     public int getPriority() {
42         return test.getPriority();
43     }
44
45     public ModelledSTSTest getTest() {
46         return test;
47     }
48 }