use of org.openksavi.sponge.standalone.StandaloneEngineMain in project sponge by softelnet.
the class StandaloneCamelXmlTest method testCamelRouteXml.
@Test
public void testCamelRouteXml() {
StandaloneEngineMain engineMain = new StandaloneEngineMain(true);
try {
engineMain.startup("-c", "config/config.xml");
SpongeEngine engine = engineMain.getEngine();
await().atMost(60, TimeUnit.SECONDS).until(() -> engine.getOperations().getVariable("message") != null && engine.getOperations().getVariable(Boolean.class, "sent"));
assertTrue(engine.getOperations().getVariable(String.class, "message").contains("Send me to Camel"));
} finally {
engineMain.shutdown();
}
}
use of org.openksavi.sponge.standalone.StandaloneEngineMain in project sponge by softelnet.
the class StandaloneTest method testCamelRssNews.
@Test
public void testCamelRssNews() throws InterruptedException {
StandaloneEngineMain engineMain = null;
try {
engineMain = StandaloneTestUtils.startupStandaloneEngineMain("-c", "examples/standalone/camel_rss_news/config/config.xml");
SpongeEngine engine = engineMain.getEngine();
await().atMost(TIMEOUT, TimeUnit.SECONDS).until(() -> engine.getOperations().getVariable("stoppedSources", null) != null && engine.getOperations().getVariable(AtomicBoolean.class, "stoppedSources").get() && engine.getOperations().getVariable(AtomicBoolean.class, "alarmSounded").get());
TimeUnit.SECONDS.sleep(SLEEP);
assertFalse(engine.isError());
} finally {
StandaloneTestUtils.shutdownStandaloneEngineMain(engineMain);
}
}
use of org.openksavi.sponge.standalone.StandaloneEngineMain in project sponge by softelnet.
the class StandaloneTest method testCamelTemplate.
@Test
public void testCamelTemplate() throws InterruptedException {
StandaloneEngineMain engineMain = null;
try {
engineMain = StandaloneTestUtils.startupStandaloneEngineMain("-c", "examples/standalone/camel_template/config.xml");
SpongeEngine engine = engineMain.getEngine();
await().atMost(TIMEOUT, TimeUnit.SECONDS).until(() -> engine.getOperations().getVariable("alarmSounded", null) != null && engine.getOperations().getVariable(AtomicBoolean.class, "alarmSounded").get());
TimeUnit.SECONDS.sleep(SLEEP);
assertFalse(engine.isError());
} finally {
StandaloneTestUtils.shutdownStandaloneEngineMain(engineMain);
}
}
use of org.openksavi.sponge.standalone.StandaloneEngineMain in project sponge by softelnet.
the class StandaloneTest method testExecuteScript.
@Test
public void testExecuteScript() {
StandaloneEngineMain engineMain = StandaloneTestUtils.startupStandaloneEngineMain("-k", "examples/standalone/execute_script.py");
assertFalse(engineMain.getEngine().isError());
}
use of org.openksavi.sponge.standalone.StandaloneEngineMain in project sponge by softelnet.
the class StandaloneCamelGroovyTest method testCamelRouteXml.
@Test
public void testCamelRouteXml() {
StandaloneEngineMain engineMain = new StandaloneEngineMain(true);
try {
engineMain.startup("-c", "config/config.xml");
SpongeEngine engine = engineMain.getEngine();
await().atMost(60, TimeUnit.SECONDS).until(() -> engine.getOperations().getVariable("message") != null && engine.getOperations().getVariable(Boolean.class, "sent"));
assertTrue(engine.getOperations().getVariable(String.class, "message").contains("Send me to Camel"));
} finally {
engineMain.shutdown();
}
}
Aggregations