1 package org.simantics.pythonlink.test;
3 import java.io.BufferedReader;
4 import java.io.InputStreamReader;
5 import java.nio.charset.Charset;
7 import org.simantics.scl.compiler.commands.CommandSession;
8 import org.simantics.scl.compiler.commands.TestScriptExecutor;
9 import org.simantics.scl.osgi.SCLOsgi;
11 public class ScriptTestBase {
13 private final String path;
15 public ScriptTestBase(String path) {
19 protected void test() throws Exception {
20 String testScriptName = Thread.currentThread().getStackTrace()[2].getMethodName();
21 String testPath = path + "/" + testScriptName + ".sts";
23 CommandSession session = new CommandSession(SCLOsgi.MODULE_REPOSITORY, null);
24 new TestScriptExecutor(session,
26 new InputStreamReader(getClass().getResourceAsStream(testPath), Charset.forName("UTF-8"))),