Source:
<code>public void testExternalTimeBatchWindow1() throws InterruptedException { log.info("ExternalTimeBatchWindow test1"); SiddhiManager siddhiManager = new SiddhiManager(); String cseEventStream = "" + "define stream LoginEvents (timestamp long, ip string); " + "define window LoginWindow (timestamp long, ip string) externalTimeBatch(timestamp, 1 sec, 0, 6 sec) " + "output all events; "; String query = "" + "@info(name = 'query0') " + "from LoginEvents " + "insert into LoginWindow; " + "" + "@info(name = 'query1') " + "from LoginWindow " + "select timestamp, ip, count() as total " + "insert all events into uniqueIps ;"; ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(cseEventStream + query); executionPlanRuntime.addCallback("query1", new QueryCallback() { @Override public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) { EventPrinter.print(timeStamp, inEvents, removeEvents); if (inEvents != null) { inEventCount = inEventCount + inEvents.length; } if (removeEvents != null) { removeEventCount = removeEventCount + removeEvents.length; } eventArrived = true; } }); InputHandler inputHandler = executionPlanRuntime.getInputHandler("LoginEvents"); executionPlanRuntime.start(); inputHandler.send(new Object[]{1366335804341L, "192.10.1.3"}); inputHandler.send(new Object[]{1366335804342L, "192.10.1.4"}); inputHandler.send(new Object[]{1366335814341L, "192.10.1.5"}); inputHandler.send(new Object[]{1366335814345L, "192.10.1.6"}); inputHandler.send(new Object[]{1366335824341L, "192.10.1.7"}); Thread.sleep(1000); <START> junit.framework.Assert.assertEquals("Event arrived", true, eventArrived); <END> junit.framework.Assert.assertEquals("In Events ", 2, inEventCount); junit.framework.Assert.assertEquals("Remove Events ", 0, removeEventCount); executionPlanRuntime.shutdown(); }</code><technical_language>jnit.Assert instead of framework</technical_language>

Target:
public void testExternalTimeBatchWindow1() throws InterruptedException { log.info("ExternalTimeBatchWindow test1"); SiddhiManager siddhiManager = new SiddhiManager(); String cseEventStream = "" + "define stream LoginEvents (timestamp long, ip string); " + "define window LoginWindow (timestamp long, ip string) externalTimeBatch(timestamp, 1 sec, 0, 6 sec) " + "output all events; "; String query = "" + "@info(name = 'query0') " + "from LoginEvents " + "insert into LoginWindow; " + "" + "@info(name = 'query1') " + "from LoginWindow " + "select timestamp, ip, count() as total " + "insert all events into uniqueIps ;"; ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(cseEventStream + query); executionPlanRuntime.addCallback("query1", new QueryCallback() { @Override public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) { EventPrinter.print(timeStamp, inEvents, removeEvents); if (inEvents != null) { inEventCount = inEventCount + inEvents.length; } if (removeEvents != null) { removeEventCount = removeEventCount + removeEvents.length; } eventArrived = true; } }); InputHandler inputHandler = executionPlanRuntime.getInputHandler("LoginEvents"); executionPlanRuntime.start(); inputHandler.send(new Object[]{1366335804341L, "192.10.1.3"}); inputHandler.send(new Object[]{1366335804342L, "192.10.1.4"}); inputHandler.send(new Object[]{1366335814341L, "192.10.1.5"}); inputHandler.send(new Object[]{1366335814345L, "192.10.1.6"}); inputHandler.send(new Object[]{1366335824341L, "192.10.1.7"}); Thread.sleep(1000); assertEquals("Event arrived", true, eventArrived); assertEquals("In Events ", 2, inEventCount); assertEquals("Remove Events ", 0, removeEventCount); executionPlanRuntime.shutdown(); }