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.junit.Before;
8 import org.simantics.scl.compiler.commands.CommandSession;
9 import org.simantics.scl.compiler.commands.TestScriptExecutor;
10 import org.simantics.scl.compiler.module.repository.ModuleRepository;
11 import org.simantics.scl.compiler.source.repository.CompositeModuleSourceRepository;
12 import org.simantics.scl.compiler.source.repository.SourceRepositories;
13 import org.simantics.scl.osgi.SCLOsgi;
14 import org.simantics.scl.osgi.internal.ServiceBasedModuleSourceRepository;
16 public class ScriptTestBase {
18 private final String path;
20 public ScriptTestBase(String path) {
24 protected void test() throws Exception {
25 String testScriptName = Thread.currentThread().getStackTrace()[2].getMethodName();
26 String testPath = path + "/" + testScriptName + ".sts";
28 CommandSession session = new CommandSession(SCLOsgi.MODULE_REPOSITORY, null);
29 new TestScriptExecutor(session,
31 new InputStreamReader(getClass().getResourceAsStream(testPath), Charset.forName("UTF-8"))),