Program: 176905
Project: 176905
Buggy source:
/** 
 * Test create insert column family query.
 */
@Test public void testCreateInsertColumnFamilyQuery(){
  EntityManagerFactoryImpl emf=getEntityManagerFactory();
  EntityManager em=new EntityManagerImpl(emf,PersistenceUnitTransactionType.RESOURCE_LOCAL,PersistenceContextType.EXTENDED);
  String colFamilySql="String_Node_Str";
  Query q=em.createNativeQuery(colFamilySql,CassandraEntitySample.class);
  q.executeUpdate();
  Assert.assertTrue(CassandraCli.columnFamilyExist("String_Node_Str","String_Node_Str"));
  String idxSql="String_Node_Str";
  q=em.createNativeQuery(idxSql,CassandraEntitySample.class);
  q.executeUpdate();
  idxSql="String_Node_Str";
  q=em.createNativeQuery(idxSql,CassandraEntitySample.class);
  q.executeUpdate();
  String insertSql="String_Node_Str";
  q=em.createNativeQuery(insertSql,CassandraEntitySample.class);
  q.executeUpdate();
  String selectSql="String_Node_Str";
  q=em.createNativeQuery(selectSql,CassandraEntitySample.class);
  List<CassandraEntitySample> 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,CassandraEntitySample.class);
  q.getResultList();
  insertSql="String_Node_Str";
  q=em.createNativeQuery(insertSql,CassandraEntitySample.class);
  q.getResultList();
  String selectAll="String_Node_Str";
  q=em.createNativeQuery(selectAll,CassandraEntitySample.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 testCreateInsertColumnFamilyQuery(){
  String nativeSql="String_Node_Str" + schema + "String_Node_Str";
  String useNativeSql="String_Node_Str";
  EntityManagerFactoryImpl emf=getEntityManagerFactory();
  EntityManager em=new EntityManagerImpl(emf,PersistenceUnitTransactionType.RESOURCE_LOCAL,PersistenceContextType.EXTENDED);
  Query q=em.createNativeQuery(nativeSql,CassandraEntitySample.class);
  q.executeUpdate();
  q=em.createNativeQuery(useNativeSql,CassandraEntitySample.class);
  q.executeUpdate();
  String colFamilySql="String_Node_Str";
  q=em.createNativeQuery(colFamilySql,CassandraEntitySample.class);
  q.executeUpdate();
  Assert.assertTrue(CassandraCli.columnFamilyExist("String_Node_Str","String_Node_Str"));
  String idxSql="String_Node_Str";
  q=em.createNativeQuery(idxSql,CassandraEntitySample.class);
  q.executeUpdate();
  idxSql="String_Node_Str";
  q=em.createNativeQuery(idxSql,CassandraEntitySample.class);
  q.executeUpdate();
  String insertSql="String_Node_Str";
  q=em.createNativeQuery(insertSql,CassandraEntitySample.class);
  q.executeUpdate();
  String selectSql="String_Node_Str";
  q=em.createNativeQuery(selectSql,CassandraEntitySample.class);
  List<CassandraEntitySample> 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,CassandraEntitySample.class);
  q.getResultList();
  insertSql="String_Node_Str";
  q=em.createNativeQuery(insertSql,CassandraEntitySample.class);
  q.getResultList();
  String selectAll="String_Node_Str";
  q=em.createNativeQuery(selectAll,CassandraEntitySample.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());
}