use of org.openksavi.sponge.engine.SpongeEngine in project sponge by softelnet.
the class CoreVariablesJythonBugTest method testGlobalVariablesRubyNoBug.
@Test
public void testGlobalVariablesRubyNoBug() {
SpongeEngine engine = DefaultSpongeEngine.builder().knowledgeBase(TestUtils.DEFAULT_KB, "examples/core/stability/global_variable_access.rb").build();
engine.startup();
try {
await().atMost(30, TimeUnit.MINUTES).until(() -> engine.getOperations().getVariable(AtomicBoolean.class, "stopped").get() || engine.isError());
assertFalse(engine.isError());
} finally {
engine.shutdown();
}
}
use of org.openksavi.sponge.engine.SpongeEngine in project sponge by softelnet.
the class MpdSetPlaylistMain method run.
public void run() {
SpongeEngine engine = DefaultSpongeEngine.builder().config("examples/mpd/mpd_set_playlist.xml").build();
try {
engine.startup();
SpongeUtils.registerShutdownHook(engine);
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
use of org.openksavi.sponge.engine.SpongeEngine in project sponge by softelnet.
the class Py4JTest method testPy4JJavaServerTls.
@Test
public void testPy4JJavaServerTls() throws Exception {
String rootDir = "examples/py4j/java_server_tls";
SpongeEngine engine = DefaultSpongeEngine.builder().config(rootDir + "/py4j_java_server_tls_sponge_hello_world.xml").build();
engine.startup();
try {
Pair<Process, String> scriptResult = startCPython(engine, rootDir + "/py4j_java_server_tls_python_hello_world.py", true);
Process process = scriptResult.getLeft();
String outputText = scriptResult.getRight();
process.waitFor(60, TimeUnit.SECONDS);
await().atMost(60, TimeUnit.SECONDS).until(() -> engine.getOperations().getVariable(Number.class, "eventCounter").intValue() > 0);
assertEquals(String.format("Connected to %s\nTriggers count: %d, first: %s", engine.getDescription(), engine.getTriggers().size(), engine.getTriggers().get(0).getName()), outputText);
assertEquals(1, engine.getOperations().getVariable(Number.class, "eventCounter").intValue());
assertFalse(engine.isError());
} finally {
engine.shutdown();
}
}
use of org.openksavi.sponge.engine.SpongeEngine in project sponge by softelnet.
the class Pi4JBlinkLedMain method run.
public void run() {
LoggingUtils.initLoggingBridge();
SpongeEngine engine = DefaultSpongeEngine.builder().config("examples/rpi-pi4j/pi4j_led_blink.xml").build();
engine.startup();
SpongeUtils.registerShutdownHook(engine);
}
use of org.openksavi.sponge.engine.SpongeEngine in project sponge by softelnet.
the class MidiInputMain method run.
public void run() {
SpongeEngine engine = DefaultSpongeEngine.builder().config("examples/midi/midi_input.xml").build();
engine.startup();
SpongeUtils.registerShutdownHook(engine);
}
Aggregations