Program: 29057
Project: 29057
Buggy source:
@Test public void testQuery2() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  StreamDefinition streamDefinition=StreamDefinition.id("String_Node_Str").attribute("String_Node_Str",Attribute.Type.STRING).attribute("String_Node_Str",Attribute.Type.INT);
  TableDefinition tableDefinition=TableDefinition.id("String_Node_Str").annotation(Annotation.annotation("String_Node_Str").element("String_Node_Str","String_Node_Str")).attribute("String_Node_Str",Attribute.Type.STRING).attribute("String_Node_Str",Attribute.Type.INT);
  Query query=Query.query();
  query.from(InputStream.stream("String_Node_Str"));
  query.insertInto("String_Node_Str");
  ExecutionPlan executionPlan=new ExecutionPlan("String_Node_Str");
  executionPlan.addQuery(query);
  executionPlan.defineStream(streamDefinition);
  executionPlan.defineTable(tableDefinition);
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(executionPlan);
  InputHandler stockStream=executionPlanRuntime.getInputHandler("String_Node_Str");
  executionPlanRuntime.start();
  stockStream.send(new Object[]{"String_Node_Str",55.6f});
  stockStream.send(new Object[]{"String_Node_Str",75.6f});
  Thread.sleep(500);
  Map<String,HazelcastInstance> instanceMap=new HashMap<String,HazelcastInstance>();
  for (  HazelcastInstance hci : Hazelcast.getAllHazelcastInstances()) {
    instanceMap.put(hci.getName(),hci);
  }
  Assert.assertTrue(instanceMap.containsKey(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName()));
  HazelcastInstance instance=instanceMap.get(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName());
  List<StreamEvent> streamEvents=instance.getList(HazelcastEventTableConstants.HAZELCAST_LIST_INSTANCE_PREFIX + executionPlanRuntime.getName() + '_'+ tableDefinition.getId());
  Assert.assertEquals(2,streamEvents.size());
  executionPlanRuntime.shutdown();
}

Fixed version (ground truth):
@Test public void testQuery2() throws InterruptedException {
  log.info("String_Node_Str");
  SiddhiManager siddhiManager=new SiddhiManager();
  StreamDefinition streamDefinition=StreamDefinition.id("String_Node_Str").attribute("String_Node_Str",Attribute.Type.STRING).attribute("String_Node_Str",Attribute.Type.INT);
  TableDefinition tableDefinition=TableDefinition.id("String_Node_Str").annotation(Annotation.annotation("String_Node_Str").element("String_Node_Str","String_Node_Str")).attribute("String_Node_Str",Attribute.Type.STRING).attribute("String_Node_Str",Attribute.Type.INT);
  Query query=Query.query();
  query.from(InputStream.stream("String_Node_Str"));
  query.insertInto("String_Node_Str");
  ExecutionPlan executionPlan=new ExecutionPlan("String_Node_Str");
  executionPlan.addQuery(query);
  executionPlan.defineStream(streamDefinition);
  executionPlan.defineTable(tableDefinition);
  ExecutionPlanRuntime executionPlanRuntime=siddhiManager.createExecutionPlanRuntime(executionPlan);
  try {
    InputHandler stockStream=executionPlanRuntime.getInputHandler("String_Node_Str");
    executionPlanRuntime.start();
    stockStream.send(new Object[]{"String_Node_Str",55.6f});
    stockStream.send(new Object[]{"String_Node_Str",75.6f});
    Map<String,HazelcastInstance> instanceMap=new HashMap<String,HazelcastInstance>();
    for (    HazelcastInstance hci : Hazelcast.getAllHazelcastInstances()) {
      instanceMap.put(hci.getName(),hci);
    }
    Assert.assertTrue(instanceMap.containsKey(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName()));
    HazelcastInstance instance=instanceMap.get(HazelcastEventTableConstants.HAZELCAST_INSTANCE_PREFIX + executionPlanRuntime.getName());
    List<StreamEvent> streamEvents=instance.getList(HazelcastEventTableConstants.HAZELCAST_LIST_INSTANCE_PREFIX + executionPlanRuntime.getName() + '_'+ tableDefinition.getId());
    SiddhiTestHelper.waitForEvents(100,2,streamEvents,60000);
    List<Object[]> expected=Arrays.asList(new Object[]{"String_Node_Str",55.6f},new Object[]{"String_Node_Str",75.6f});
    List<Object[]> actual=new ArrayList<Object[]>();
    for (    StreamEvent event : streamEvents) {
      actual.add(event.getOutputData());
    }
    Assert.assertEquals(2,streamEvents.size());
    Assert.assertEquals("String_Node_Str",true,SiddhiTestHelper.isEventsMatch(actual,expected));
  }
  finally {
    executionPlanRuntime.shutdown();
  }
}