use of io.siddhi.query.api.SiddhiApp in project siddhi by wso2.
the class DefineTableTestCase method testQuery1.
@Test
public void testQuery1() throws InterruptedException {
log.info("testTableDefinition1 - OUT 0");
SiddhiManager siddhiManager = new SiddhiManager();
TableDefinition tableDefinition = TableDefinition.id("cseEventStream").attribute("symbol", Attribute.Type.STRING).attribute("price", Attribute.Type.INT);
SiddhiApp siddhiApp = new SiddhiApp("ep1");
siddhiApp.defineTable(tableDefinition);
SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(siddhiApp);
siddhiAppRuntime.shutdown();
}
use of io.siddhi.query.api.SiddhiApp in project siddhi by wso2.
the class TriggerTestCase method testQuery2.
@Test(expectedExceptions = SiddhiAppValidationException.class, dependsOnMethods = "testQuery1")
public void testQuery2() throws InterruptedException {
log.info("testTrigger2 - OUT 0");
SiddhiManager siddhiManager = new SiddhiManager();
TriggerDefinition triggerDefinition = TriggerDefinition.id("cseEventStream").atEvery(Expression.Time.milliSec(500)).at("start");
SiddhiApp siddhiApp = new SiddhiApp("ep1");
siddhiApp.defineTrigger(triggerDefinition);
SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(siddhiApp);
siddhiAppRuntime.shutdown();
}
Aggregations