Search in sources :

Example 1 with StreamEventFactory

use of org.ballerinalang.siddhi.core.event.stream.StreamEventFactory in project ballerina by ballerina-lang.

the class EventTestCase method testEventCreation.

@Test
public void testEventCreation() {
    SiddhiEventFactory siddhiEventFactory = new SiddhiEventFactory(2);
    AssertJUnit.assertEquals(2, siddhiEventFactory.newInstance().getData().length);
    StreamEventFactory streamEventFactory = new StreamEventFactory(2, 3, 4);
    StreamEvent streamEvent = streamEventFactory.newInstance();
    AssertJUnit.assertEquals(2, streamEvent.getBeforeWindowData().length);
    AssertJUnit.assertEquals(3, streamEvent.getOnAfterWindowData().length);
    AssertJUnit.assertEquals(4, streamEvent.getOutputData().length);
}
Also used : StreamEventFactory(org.ballerinalang.siddhi.core.event.stream.StreamEventFactory) StreamEvent(org.ballerinalang.siddhi.core.event.stream.StreamEvent) MetaStreamEvent(org.ballerinalang.siddhi.core.event.stream.MetaStreamEvent) SiddhiEventFactory(org.ballerinalang.siddhi.core.event.SiddhiEventFactory) Test(org.testng.annotations.Test)

Aggregations

SiddhiEventFactory (org.ballerinalang.siddhi.core.event.SiddhiEventFactory)1 MetaStreamEvent (org.ballerinalang.siddhi.core.event.stream.MetaStreamEvent)1 StreamEvent (org.ballerinalang.siddhi.core.event.stream.StreamEvent)1 StreamEventFactory (org.ballerinalang.siddhi.core.event.stream.StreamEventFactory)1 Test (org.testng.annotations.Test)1