Program: 28866
Project: 28866
Buggy source:
@Test public void testTcpSource7() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  String inStreamDefinition="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  String query=("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(inStreamDefinition + query);
  executionPlanRuntime.addCallback("String_Node_Str",new StreamCallback(){
    @Override public void receive(    Event[] events){
      EventPrinter.print(events);
      eventArrived=true;
      for (      Event event : events) {
        count++;
switch (count) {
case 1:
          Assert.assertEquals("String_Node_Str",event.getData(0));
        break;
case 2:
      Assert.assertEquals("String_Node_Str",event.getData(0));
    break;
case 3:
  Assert.assertEquals("String_Node_Str",event.getData(0));
break;
case 4:
Assert.assertEquals("String_Node_Str",event.getData(0));
break;
case 5:
Assert.assertEquals("String_Node_Str",event.getData(0));
break;
case 6:
Assert.assertEquals("String_Node_Str",event.getData(0));
break;
default :
org.junit.Assert.fail();
}
}
}
}
);
executionPlanRuntime.start();
TCPNettyClient TCPNettyClient=new TCPNettyClient();
TCPNettyClient.connect("String_Node_Str",9892);
ArrayList<Event> arrayList=new ArrayList<Event>(3);
arrayList.add(new Event(System.currentTimeMillis(),new Object[]{"String_Node_Str",36,3.0f,380l,23.0,true}));
arrayList.add(new Event(System.currentTimeMillis(),new Object[]{"String_Node_Str",361,31.0f,3801l,231.0,false}));
arrayList.add(new Event(System.currentTimeMillis(),new Object[]{"String_Node_Str",362,32.0f,3802l,232.0,true}));
TCPNettyClient.send("String_Node_Str",arrayList.toArray(new Event[3]));
TCPNettyClient.disconnect();
TCPNettyClient.shutdown();
Thread.sleep(300);
Assert.assertEquals(6,count);
Assert.assertTrue(eventArrived);
executionPlanRuntime.shutdown();
}

Fixed version (ground truth):
@Test public void testTcpSource7() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  String inStreamDefinition="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  String query=("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(inStreamDefinition + query);
  executionPlanRuntime.addCallback("String_Node_Str",new StreamCallback(){
    @Override public void receive(    Event[] events){
      EventPrinter.print(events);
      eventArrived=true;
      for (      Event event : events) {
        count++;
switch (count) {
case 1:
          Assert.assertEquals("String_Node_Str",event.getData(0));
        break;
case 2:
      Assert.assertEquals("String_Node_Str",event.getData(0));
    break;
case 3:
  Assert.assertEquals("String_Node_Str",event.getData(0));
break;
case 4:
Assert.assertEquals("String_Node_Str",event.getData(0));
break;
case 5:
Assert.assertEquals("String_Node_Str",event.getData(0));
break;
case 6:
Assert.assertEquals("String_Node_Str",event.getData(0));
break;
default :
org.junit.Assert.fail();
}
}
}
}
);
executionPlanRuntime.start();
TCPNettyClient TCPNettyClient=new TCPNettyClient();
TCPNettyClient.connect("String_Node_Str",9892);
ArrayList<Event> arrayList=new ArrayList<Event>(3);
arrayList.add(new Event(System.currentTimeMillis(),new Object[]{"String_Node_Str",36,3.0f,380L,23.0,true}));
arrayList.add(new Event(System.currentTimeMillis(),new Object[]{"String_Node_Str",361,31.0f,3801L,231.0,false}));
arrayList.add(new Event(System.currentTimeMillis(),new Object[]{"String_Node_Str",362,32.0f,3802L,232.0,true}));
TCPNettyClient.send("String_Node_Str",arrayList.toArray(new Event[3]));
TCPNettyClient.send("String_Node_Str",arrayList.toArray(new Event[3]));
TCPNettyClient.disconnect();
TCPNettyClient.shutdown();
Thread.sleep(300);
Assert.assertEquals(6,count);
Assert.assertTrue(eventArrived);
executionPlanRuntime.shutdown();
}