]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/utils/ModelledSTSTest.java
Use parent name in JUnit STS test identifiers
[simantics/platform.git] / bundles / org.simantics.tests.modelled / src / org / simantics / tests / modelled / utils / ModelledSTSTest.java
index 33e4c25e2fc6b2f121bd3e6264a1ede8b3f09068..94ff2b6b6a4082a78dc5f006b0038d0b22999637 100644 (file)
@@ -24,6 +24,7 @@ import org.simantics.scl.runtime.reporting.SCLReportingHandler;
 public class ModelledSTSTest {
 
     private final String name;
+    private final String parentName;
     private final String code;
     private final int priority;
     private final boolean ignored;
@@ -33,8 +34,9 @@ public class ModelledSTSTest {
     private CombinedCoverage coverage;
     private Map<String, String> variables;
 
-    ModelledSTSTest(String name, String code, int priority, boolean ignored, Set<String> dependencies, Map<String, String> variables) {
+    ModelledSTSTest(String name, String parentName, String code, int priority, boolean ignored, Set<String> dependencies, Map<String, String> variables) {
         this.name = name;
+        this.parentName = parentName;
         this.code = code;
         this.priority = priority;
         this.ignored = ignored;
@@ -47,6 +49,10 @@ public class ModelledSTSTest {
         return name;
     }
 
+    public String getParentName() {
+        return parentName;
+    }
+
     public String getCode() {
         return code;
     }
@@ -94,6 +100,7 @@ public class ModelledSTSTest {
     
     public List<CommandSessionVariable> run(List<CommandSessionVariable> vars) throws IOException {
         ModuleRepository repo = new ModuleRepository(SCLOsgi.SOURCE_REPOSITORY);
+        CommandSession session = null;
         try {
             repo.setAdvisor(new ModuleCompilationOptionsAdvisor() {
                 
@@ -113,7 +120,7 @@ public class ModelledSTSTest {
             });
             
             SCLReportingHandler handler = (SCLReportingHandler) SCLContext.getCurrent().get(SCLReportingHandler.REPORTING_HANDLER);
-            CommandSession session = new CommandSession(repo, handler);
+            session = new CommandSession(repo, handler);
             
             for (CommandSessionVariable var : vars)
                 session.setVariable(var.getName(), var.getType(), var.getValue());