qualify engine selection

This commit is contained in:
Jonathan Shook
2020-04-27 01:36:06 -05:00
parent ef49cc5320
commit 4362e389ce
8 changed files with 10 additions and 14 deletions

View File

@@ -64,18 +64,19 @@ public class Scenario implements Callable<ScenarioResult> {
Graalvm
}
public Scenario(String name, String progressInterval) {
public Scenario(String name, Engine engine, String progressInterval) {
this.name = name;
this.engine = engine;
this.progressInterval = progressInterval;
}
public Scenario(String name) {
public Scenario(String name, Engine engine) {
this.name = name;
this.engine = engine;
}
public Scenario addScriptText(String scriptText) {
scripts.add(scriptText);
this.engine = engine;
return this;
}

View File

@@ -25,7 +25,7 @@ public class ScenarioTest {
@Test
public void shouldLoadScriptText() {
ScriptEnvBuffer buffer = new ScriptEnvBuffer();
Scenario env = new Scenario("testing");
Scenario env = new Scenario("testing", Scenario.Engine.Graalvm);
env.addScriptText("print('loaded script environment...');\n");
env.run();
assertThat(env.getIOLog().get().get(0)).contains("loaded script environment...");

View File

@@ -27,7 +27,7 @@ public class ScenariosExecutorTest {
@Ignore
public void testAwaitOnTime() {
ScenariosExecutor e = new ScenariosExecutor(ScenariosExecutorTest.class.getSimpleName(), 1);
Scenario s = new Scenario("testing");
Scenario s = new Scenario("testing", Scenario.Engine.Graalvm);
s.addScriptText("load('classpath:scripts/asyncs.js');\nsetTimeout(\"print('waited')\",5000);\n");
e.execute(s);
ScenariosResults scenariosResults = e.awaitAllResults();