Source:
<code>public void dateFormatFunctionExtension7() throws InterruptedException { log.info("DateFormatFunctionExtensionTestCaseFirstArgumentNul"); SiddhiManager siddhiManager = new SiddhiManager(); String inStreamDefinition = "define stream inputStream (symbol string," + "dateValue string,sourceFormat string,timestampInMilliseconds long,targetFormat string);"; String query = ("@info(name = 'query1') from inputStream select symbol , " + "time:dateFormat(dateValue,targetFormat,sourceFormat) as formattedDate," + "time:dateFormat(timestampInMilliseconds," + "targetFormat) as formattedUnixDate insert into outputStream;"); ExecutionPlanRuntime executionPlanRuntime = siddhiManager .createExecutionPlanRuntime(inStreamDefinition + query); executionPlanRuntime.addCallback("query1", new QueryCallback() { @Override public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) { EventPrinter.print(timeStamp, inEvents, removeEvents); eventArrived = true; for(int cnt=0;cnt<inEvents.length;cnt++){ count++; log.info("Event : " + count + ",formattedDate : " + inEvents[cnt].getData(1) + "," + <START> "formattedMillsDate : " + inEvents[cnt].getData(2)); <END> } } }); InputHandler inputHandler = executionPlanRuntime.getInputHandler("inputStream"); executionPlanRuntime.start(); inputHandler.send(new Object[] { "IBM",null, "yyyy-MM-dd HH:mm:ss", 1415692424000L, "ss" }); Thread.sleep(100); Assert.assertEquals(1, count); Assert.assertTrue(eventArrived); executionPlanRuntime.shutdown(); }</code><technical_language>Assert formatted date check asserting event arrival count (what done in dateAddFunctionExtension7)</technical_language>

Target:
public void dateFormatFunctionExtension7() throws InterruptedException { log.info("DateFormatFunctionExtensionTestCaseFirstArgumentNul"); SiddhiManager siddhiManager = new SiddhiManager(); String inStreamDefinition = "define stream inputStream (symbol string," + "dateValue string,sourceFormat string,timestampInMilliseconds long,targetFormat string);"; String query = ("@info(name = 'query1') from inputStream select symbol , " + "time:dateFormat(dateValue,targetFormat,sourceFormat) as formattedDate," + "time:dateFormat(timestampInMilliseconds," + "targetFormat) as formattedUnixDate insert into outputStream;"); ExecutionPlanRuntime executionPlanRuntime = siddhiManager .createExecutionPlanRuntime(inStreamDefinition + query); executionPlanRuntime.addCallback("query1", new QueryCallback() { @Override public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) { EventPrinter.print(timeStamp, inEvents, removeEvents); eventArrived = true; for (Event event : inEvents) { count++; if (count == 1) { Assert.assertEquals(null, event.getData(1)); Assert.assertEquals("2014-11-11", event.getData(2)); } if (count == 2) { Assert.assertEquals(null, event.getData(1)); Assert.assertEquals("44", event.getData(2)); } } } }); InputHandler inputHandler = executionPlanRuntime.getInputHandler("inputStream"); executionPlanRuntime.start(); inputHandler.send(new Object[]{"IBM", null, "yyyy-MM-dd HH:mm:ss", 1415692424000L, "yyyy-MM-dd"}); inputHandler.send(new Object[]{"IBM", null, "yyyy-MM-dd HH:mm:ss", 1415692424000L, "ss"}); Thread.sleep(100); Assert.assertEquals(2, count); Assert.assertTrue(eventArrived); executionPlanRuntime.shutdown(); }