use of org.phoenicis.scripts.interpreter.ScriptInterpreter in project POL-POM-5 by PlayOnLinux.
the class PhoenicisTestsApp method testScript.
private void testScript(CategoryDTO categoryDTO, ApplicationDTO applicationDTO, ScriptDTO scriptDTO) {
final ScriptInterpreter scriptInterpreter = applicationContext.getBean("nashornInterprpeter", ScriptInterpreter.class);
System.out.print("| |-- " + scriptDTO.getScriptName());
try {
scriptInterpreter.runScript(scriptDTO.getScript(), e -> {
throw new TestException(e);
});
System.out.println(" [OK] ");
} catch (TestException e) {
e.printStackTrace();
System.out.println(" [KO] ");
}
}
use of org.phoenicis.scripts.interpreter.ScriptInterpreter in project POL-POM-5 by PlayOnLinux.
the class CLIController method runScript.
@Option
@LongSwitch("script")
@ShortSwitch("s")
@AllAvailableArguments
public void runScript(List<String> arguments) {
final String scriptPath = arguments.get(0);
final File scriptFile = new File(scriptPath);
final ScriptInterpreter scriptInterpreter = applicationContext.getBean("scriptInterpreter", ScriptInterpreter.class);
scriptInterpreter.runScript(scriptFile, e -> {
throw new IllegalStateException(e);
});
}
Aggregations