Program: 176585
Project: 176585
Buggy source:
/** 
 * Test create insert column family query.
 */
@Test public void testCreateInsertColumnFamilyQueryVersion3(){
  String useNativeSql="String_Node_Str" + schema;
  EntityManagerFactoryImpl emf=getEntityManagerFactory();
  EntityManager em=emf.createEntityManager();
  Map<String,Client> clientMap=(Map<String,Client>)em.getDelegate();
  PelopsClient pc=(PelopsClient)clientMap.get("String_Node_Str");
  pc.setCqlVersion(CassandraConstants.CQL_VERSION_3_0);
  Query q=em.createNativeQuery(useNativeSql,CassandraEntity.class);
  q.executeUpdate();
  String colFamilySql="String_Node_Str";
  q=em.createNativeQuery(colFamilySql,CassandraEntity.class);
  q.executeUpdate();
  Assert.assertTrue(CassandraCli.columnFamilyExist("String_Node_Str","String_Node_Str"));
  String idxSql="String_Node_Str";
  q=em.createNativeQuery(idxSql,CassandraEntity.class);
  q.executeUpdate();
  idxSql="String_Node_Str";
  q=em.createNativeQuery(idxSql,CassandraEntity.class);
  q.executeUpdate();
  String insertSql="String_Node_Str";
  q=em.createNativeQuery(insertSql,CassandraEntity.class);
  q.executeUpdate();
  String selectSql="String_Node_Str";
  q=em.createNativeQuery(selectSql,CassandraEntity.class);
  List<CassandraEntity> results=q.getResultList();
  Assert.assertNotNull(results);
  Assert.assertEquals(1,results.size());
  Assert.assertEquals("String_Node_Str",results.get(0).getKey());
  Assert.assertEquals("String_Node_Str",results.get(0).getState());
  Assert.assertNull(results.get(0).getFull_name());
  insertSql="String_Node_Str";
  q=em.createNativeQuery(insertSql,CassandraEntity.class);
  q.getResultList();
  insertSql="String_Node_Str";
  q=em.createNativeQuery(insertSql,CassandraEntity.class);
  q.getResultList();
  String selectAll="String_Node_Str";
  q=em.createNativeQuery(selectAll,CassandraEntity.class);
  results=q.getResultList();
  Assert.assertNotNull(results);
  Assert.assertEquals(1,results.size());
  Assert.assertEquals("String_Node_Str",results.get(0).getKey());
  Assert.assertEquals("String_Node_Str",results.get(0).getState());
  Assert.assertEquals("String_Node_Str",results.get(0).getFull_name());
  Assert.assertEquals(new Integer(1975),results.get(0).getBirth_date());
}

Fixed version (ground truth):
/** 
 * Test create insert column family query.
 */
@Test public void testCreateInsertColumnFamilyQueryVersion3(){
  String useNativeSql="String_Node_Str" + schema;
  EntityManagerFactoryImpl emf=getEntityManagerFactory();
  EntityManager em=emf.createEntityManager();
  Map<String,Client> clientMap=(Map<String,Client>)em.getDelegate();
  PelopsClient pc=(PelopsClient)clientMap.get("String_Node_Str");
  pc.setCqlVersion(CassandraConstants.CQL_VERSION_3_0);
  Query q=em.createNativeQuery(useNativeSql,CassandraEntity.class);
  q.executeUpdate();
  String colFamilySql="String_Node_Str";
  q=em.createNativeQuery(colFamilySql,CassandraEntity.class);
  q.executeUpdate();
  Assert.assertTrue(CassandraCli.columnFamilyExist("String_Node_Str","String_Node_Str"));
  String idxSql="String_Node_Str";
  q=em.createNativeQuery(idxSql,CassandraEntity.class);
  q.executeUpdate();
  idxSql="String_Node_Str";
  q=em.createNativeQuery(idxSql,CassandraEntity.class);
  q.executeUpdate();
  String insertSql="String_Node_Str";
  q=em.createNativeQuery(insertSql,CassandraEntity.class);
  q.executeUpdate();
  String selectSql="String_Node_Str";
  q=em.createNativeQuery(selectSql,CassandraEntity.class);
  List<CassandraEntity> results=q.getResultList();
  Assert.assertNotNull(results);
  Assert.assertEquals(1,results.size());
  Assert.assertEquals("String_Node_Str",results.get(0).getKey());
  Assert.assertEquals("String_Node_Str",results.get(0).getState());
  Assert.assertNull(results.get(0).getFull_name());
  insertSql="String_Node_Str";
  q=em.createNativeQuery(insertSql,CassandraEntity.class);
  q.getResultList();
  insertSql="String_Node_Str";
  q=em.createNativeQuery(insertSql,CassandraEntity.class);
  q.getResultList();
  String selectAll="String_Node_Str";
  q=em.createNativeQuery(selectAll,CassandraEntity.class);
  results=q.getResultList();
  Assert.assertNotNull(results);
  Assert.assertEquals(1,results.size());
  Assert.assertEquals("String_Node_Str",results.get(0).getKey());
  Assert.assertEquals("String_Node_Str",results.get(0).getState());
  Assert.assertEquals("String_Node_Str",results.get(0).getFull_name());
  Assert.assertEquals(new Integer(1975),results.get(0).getBirth_date());
  emf.close();
}