Program: 17423
Project: 17423
Buggy source:
@Test public void testObjectMapper() throws Exception {
  logger.debug("String_Node_Str");
  ConnectionManager cm=getConnectionManager();
  String json=TestHelpers.readFileToString(this.getClass(),"String_Node_Str");
  CKeyspaceDefinition definition=CKeyspaceDefinition.fromJsonString(json);
  assertNotNull(definition);
  cm.buildKeyspace(definition,true);
  cm.setDefaultKeyspace(definition);
  ObjectMapper om=cm.getObjectMapper();
  Map<String,Object> testObject=JsonUtil.rhombusMapFromJsonMap(TestHelpers.getTestObject(0),definition.getDefinitions().get("String_Node_Str"));
  UUID key=om.insert("String_Node_Str",testObject);
  Map<String,Object> dbObject=om.getByKey("String_Node_Str",key);
  for (  String dbKey : dbObject.keySet()) {
    if (!dbKey.equals("String_Node_Str")) {
      assertEquals(testObject.get(dbKey),dbObject.get(dbKey));
    }
  }
  UUID key2=om.insert("String_Node_Str",JsonUtil.rhombusMapFromJsonMap(TestHelpers.getTestObject(1),definition.getDefinitions().get("String_Node_Str")));
  Criteria criteria=TestHelpers.getTestCriteria(0);
  criteria.getIndexKeys().put("String_Node_Str",((Integer)criteria.getIndexKeys().get("String_Node_Str")).longValue());
  List<Map<String,Object>> dbObjects=om.list("String_Node_Str",criteria);
  assertEquals(2,dbObjects.size());
  om.delete("String_Node_Str",key);
  dbObjects=om.list("String_Node_Str",criteria);
  assertEquals(1,dbObjects.size());
  Map<String,Object> testObject2=JsonUtil.rhombusMapFromJsonMap(TestHelpers.getTestObject(2),definition.getDefinitions().get("String_Node_Str"));
  UUID key3=om.update("String_Node_Str",key2,testObject2,null,null);
  Map<String,Object> dbObject2=om.getByKey("String_Node_Str",key3);
  testObject2.put("String_Node_Str",key2);
  for (  String dbKey : dbObject2.keySet()) {
    assertEquals(testObject2.get(dbKey),dbObject2.get(dbKey));
  }
  dbObjects=om.list("String_Node_Str",criteria);
  assertEquals(0,dbObjects.size());
  Criteria criteria2=TestHelpers.getTestCriteria(1);
  criteria2.getIndexKeys().put("String_Node_Str",((Integer)criteria2.getIndexKeys().get("String_Node_Str")).longValue());
  dbObjects=om.list("String_Node_Str",criteria2);
  assertEquals(1,dbObjects.size());
  assertEquals(null,om.getNextUpdateIndexRow(null));
  Map<String,Object> testObject3=Maps.newHashMap();
  testObject3.put("String_Node_Str",Integer.valueOf(7));
  UUID key4=om.update("String_Node_Str",key2,testObject3,null,null);
  Thread.sleep(3000);
  IndexUpdateRow row=om.getNextUpdateIndexRow(null);
  assertEquals("String_Node_Str",row.getObjectName());
  assertEquals("String_Node_Str",row.getIndex().getKey());
  assertEquals(2,row.getIndexValues().size());
  assertEquals(7,row.getIndexValues().get(0).get("String_Node_Str"));
  assertEquals(5,row.getIndexValues().get(1).get("String_Node_Str"));
  assertEquals(778L,row.getIndexValues().get(0).get("String_Node_Str"));
  assertEquals(778L,row.getIndexValues().get(1).get("String_Node_Str"));
  assertEquals(333333L,row.getIndexValues().get(0).get("String_Node_Str"));
  assertEquals(333333L,row.getIndexValues().get(1).get("String_Node_Str"));
  assertEquals(null,om.getNextUpdateIndexRow(row.getRowKey()));
  cm.teardown();
}

Fixed version (ground truth):
@Test public void testObjectMapper() throws Exception {
  logger.debug("String_Node_Str");
  ConnectionManager cm=getConnectionManager();
  String json=TestHelpers.readFileToString(this.getClass(),"String_Node_Str");
  CKeyspaceDefinition definition=CKeyspaceDefinition.fromJsonString(json);
  assertNotNull(definition);
  cm.buildKeyspace(definition,true);
  cm.setDefaultKeyspace(definition);
  ObjectMapper om=cm.getObjectMapper();
  Map<String,Object> testObject=JsonUtil.rhombusMapFromJsonMap(TestHelpers.getTestObject(0),definition.getDefinitions().get("String_Node_Str"));
  UUID key=om.insert("String_Node_Str",testObject);
  Map<String,Object> dbObject=om.getByKey("String_Node_Str",key);
  for (  String dbKey : dbObject.keySet()) {
    if (!dbKey.equals("String_Node_Str")) {
      assertEquals(testObject.get(dbKey),dbObject.get(dbKey));
    }
  }
  UUID key2=om.insert("String_Node_Str",JsonUtil.rhombusMapFromJsonMap(TestHelpers.getTestObject(1),definition.getDefinitions().get("String_Node_Str")));
  Criteria criteria=TestHelpers.getTestCriteria(0);
  criteria.getIndexKeys().put("String_Node_Str",((Integer)criteria.getIndexKeys().get("String_Node_Str")).longValue());
  List<Map<String,Object>> dbObjects=om.list("String_Node_Str",criteria);
  assertEquals(2,dbObjects.size());
  om.delete("String_Node_Str",key);
  dbObjects=om.list("String_Node_Str",criteria);
  assertEquals(1,dbObjects.size());
  Map<String,Object> testObject2=JsonUtil.rhombusMapFromJsonMap(TestHelpers.getTestObject(2),definition.getDefinitions().get("String_Node_Str"));
  UUID key3=om.update("String_Node_Str",key2,testObject2,null,null);
  Map<String,Object> dbObject2=om.getByKey("String_Node_Str",key3);
  testObject2.put("String_Node_Str",key2);
  for (  String dbKey : dbObject2.keySet()) {
    assertEquals(testObject2.get(dbKey),dbObject2.get(dbKey));
  }
  dbObjects=om.list("String_Node_Str",criteria);
  assertEquals(0,dbObjects.size());
  Criteria criteria2=TestHelpers.getTestCriteria(1);
  criteria2.getIndexKeys().put("String_Node_Str",((Integer)criteria2.getIndexKeys().get("String_Node_Str")).longValue());
  dbObjects=om.list("String_Node_Str",criteria2);
  assertEquals(1,dbObjects.size());
  assertEquals(null,om.getNextUpdateIndexRow(null));
  Map<String,Object> testObject3=Maps.newHashMap();
  testObject3.put("String_Node_Str",Integer.valueOf(7));
  UUID key4=om.update("String_Node_Str",key2,testObject3,null,null);
  Thread.sleep(3000);
  IndexUpdateRow row=om.getNextUpdateIndexRow(null);
  assertEquals("String_Node_Str",row.getObjectName());
  assertEquals(2,row.getIndexValues().size());
  assertEquals(7,row.getIndexValues().get(0).get("String_Node_Str"));
  assertEquals(5,row.getIndexValues().get(1).get("String_Node_Str"));
  assertEquals(778L,row.getIndexValues().get(0).get("String_Node_Str"));
  assertEquals(778L,row.getIndexValues().get(1).get("String_Node_Str"));
  assertEquals(333333L,row.getIndexValues().get(0).get("String_Node_Str"));
  assertEquals(333333L,row.getIndexValues().get(1).get("String_Node_Str"));
  assertEquals(null,om.getNextUpdateIndexRow(row.getRowKey()));
  cm.teardown();
}