Search in sources :

Example 6 with TriggerDefinition

use of io.siddhi.query.api.definition.TriggerDefinition in project siddhi by wso2.

the class DefineTriggerTestCase method testTriggerEventNull.

@Test(expectedExceptions = SiddhiAppValidationException.class)
public void testTriggerEventNull() {
    TriggerDefinition trigger = null;
    SiddhiApp.siddhiApp("test").defineTrigger(trigger);
}
Also used : TriggerDefinition(io.siddhi.query.api.definition.TriggerDefinition) Test(org.testng.annotations.Test)

Example 7 with TriggerDefinition

use of io.siddhi.query.api.definition.TriggerDefinition 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();
}
Also used : SiddhiApp(io.siddhi.query.api.SiddhiApp) TriggerDefinition(io.siddhi.query.api.definition.TriggerDefinition) SiddhiAppRuntime(io.siddhi.core.SiddhiAppRuntime) SiddhiManager(io.siddhi.core.SiddhiManager) Test(org.testng.annotations.Test)

Aggregations

TriggerDefinition (io.siddhi.query.api.definition.TriggerDefinition)7 Test (org.testng.annotations.Test)5 SiddhiAppRuntime (io.siddhi.core.SiddhiAppRuntime)2 SiddhiManager (io.siddhi.core.SiddhiManager)2 SiddhiApp (io.siddhi.query.api.SiddhiApp)2