Program: 175991
Project: 175991
Buggy source:
/** 
 * Test method for  {@link com.impetus.client.cassandra.query.CassQuery#onQueryOverCQL3(com.impetus.kundera.metadata.model.EntityMetadata,com.impetus.kundera.client.Client,com.impetus.kundera.metadata.model.MetamodelImpl,java.util.List)}.
 * @throws InvocationTargetException
 * @throws IllegalAccessException
 * @throws IllegalArgumentException
 */
@Test public void testOnQueryOverCQL3ForEmbeddedEntity() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
  CassandraCli.createKeySpace("String_Node_Str");
  String pu="String_Node_Str";
  EntityManagerFactory emf=Persistence.createEntityManagerFactory(pu);
  EntityManager em=emf.createEntityManager();
  String queryString="String_Node_Str";
  String cqlQuery=parseAndCreateCqlQuery(getQueryObject(queryString,emf),emf,em,pu,CassandraPrimeUser.class,100);
  Assert.assertNotNull(cqlQuery);
  Assert.assertEquals("String_Node_Str",cqlQuery);
  queryString="String_Node_Str";
  cqlQuery=parseAndCreateCqlQuery(getQueryObject(queryString,emf),emf,em,pu,CassandraPrimeUser.class,400);
  Assert.assertNotNull(cqlQuery);
  System.out.println(cqlQuery);
  Assert.assertEquals("String_Node_Str",cqlQuery);
  queryString="String_Node_Str";
  List<String> userIdList=new ArrayList<String>();
  userIdList.add("String_Node_Str");
  userIdList.add("String_Node_Str");
  userIdList.add("String_Node_Str");
  KunderaQuery kunderaQuery=getQueryObject(queryString,emf);
  kunderaQuery.setParameter("String_Node_Str",userIdList);
  cqlQuery=parseAndCreateCqlQuery(kunderaQuery,emf,em,pu,CassandraPrimeUser.class,Integer.MAX_VALUE);
  Assert.assertNotNull(cqlQuery);
  Assert.assertEquals("String_Node_Str",cqlQuery);
  queryString="String_Node_Str";
  kunderaQuery=getQueryObject(queryString,emf);
  kunderaQuery.setParameter("String_Node_Str",userIdList);
  cqlQuery=parseAndCreateCqlQuery(kunderaQuery,emf,em,pu,CassandraPrimeUser.class,100);
  Assert.assertNotNull(cqlQuery);
  Assert.assertEquals("String_Node_Str",cqlQuery);
  queryString="String_Node_Str";
  List<CassandraCompoundKey> keyList=new ArrayList<CassandraCompoundKey>();
  UUID timeLineId1=UUID.randomUUID();
  keyList.add(new CassandraCompoundKey("String_Node_Str",1,timeLineId1));
  keyList.add(new CassandraCompoundKey("String_Node_Str",2,timeLineId1));
  keyList.add(new CassandraCompoundKey("String_Node_Str",3,timeLineId1));
  kunderaQuery=getQueryObject(queryString,emf);
  kunderaQuery.setParameter("String_Node_Str",keyList);
  cqlQuery=parseAndCreateCqlQuery(kunderaQuery,emf,em,pu,CassandraPrimeUser.class,100);
  Assert.assertNotNull(cqlQuery);
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str" + timeLineId1 + "String_Node_Str"+ timeLineId1+ "String_Node_Str"+ timeLineId1+ "String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.indexOf("String_Node_Str") > 0);
  queryString="String_Node_Str";
  kunderaQuery=getQueryObject(queryString,emf);
  kunderaQuery.setParameter("String_Node_Str",keyList);
  cqlQuery=parseAndCreateCqlQuery(kunderaQuery,emf,em,pu,CassandraPrimeUser.class,100);
  Assert.assertNotNull(cqlQuery);
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str" + timeLineId1 + "String_Node_Str"+ timeLineId1+ "String_Node_Str"+ timeLineId1+ "String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.indexOf("String_Node_Str") > 0);
  em.close();
  emf.close();
  CassandraCli.dropKeySpace("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Test method for  {@link com.impetus.client.cassandra.query.CassQuery#onQueryOverCQL3(com.impetus.kundera.metadata.model.EntityMetadata,com.impetus.kundera.client.Client,com.impetus.kundera.metadata.model.MetamodelImpl,java.util.List)}.
 * @throws InvocationTargetException
 * @throws IllegalAccessException
 * @throws IllegalArgumentException
 */
@Test public void testOnQueryOverCQL3ForEmbeddedEntity() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
  CassandraCli.createKeySpace("String_Node_Str");
  String pu="String_Node_Str";
  EntityManagerFactory emf=Persistence.createEntityManagerFactory(pu);
  EntityManager em=emf.createEntityManager();
  String queryString="String_Node_Str";
  String cqlQuery=parseAndCreateCqlQuery(getQueryObject(queryString,emf),emf,em,pu,CassandraPrimeUser.class,100);
  Assert.assertNotNull(cqlQuery);
  Assert.assertEquals("String_Node_Str",cqlQuery);
  queryString="String_Node_Str";
  cqlQuery=parseAndCreateCqlQuery(getQueryObject(queryString,emf),emf,em,pu,CassandraPrimeUser.class,400);
  Assert.assertNotNull(cqlQuery);
  Assert.assertEquals("String_Node_Str",cqlQuery);
  queryString="String_Node_Str";
  List<String> userIdList=new ArrayList<String>();
  userIdList.add("String_Node_Str");
  userIdList.add("String_Node_Str");
  userIdList.add("String_Node_Str");
  KunderaQuery kunderaQuery=getQueryObject(queryString,emf);
  kunderaQuery.setParameter("String_Node_Str",userIdList);
  cqlQuery=parseAndCreateCqlQuery(kunderaQuery,emf,em,pu,CassandraPrimeUser.class,Integer.MAX_VALUE);
  Assert.assertNotNull(cqlQuery);
  Assert.assertEquals("String_Node_Str",cqlQuery);
  queryString="String_Node_Str";
  kunderaQuery=getQueryObject(queryString,emf);
  kunderaQuery.setParameter("String_Node_Str",userIdList);
  cqlQuery=parseAndCreateCqlQuery(kunderaQuery,emf,em,pu,CassandraPrimeUser.class,100);
  Assert.assertNotNull(cqlQuery);
  Assert.assertEquals("String_Node_Str",cqlQuery);
  queryString="String_Node_Str";
  List<CassandraCompoundKey> keyList=new ArrayList<CassandraCompoundKey>();
  UUID timeLineId1=UUID.randomUUID();
  keyList.add(new CassandraCompoundKey("String_Node_Str",1,timeLineId1));
  keyList.add(new CassandraCompoundKey("String_Node_Str",2,timeLineId1));
  keyList.add(new CassandraCompoundKey("String_Node_Str",3,timeLineId1));
  kunderaQuery=getQueryObject(queryString,emf);
  kunderaQuery.setParameter("String_Node_Str",keyList);
  cqlQuery=parseAndCreateCqlQuery(kunderaQuery,emf,em,pu,CassandraPrimeUser.class,100);
  Assert.assertNotNull(cqlQuery);
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str" + timeLineId1 + "String_Node_Str"+ timeLineId1+ "String_Node_Str"+ timeLineId1+ "String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.indexOf("String_Node_Str") > 0);
  queryString="String_Node_Str";
  kunderaQuery=getQueryObject(queryString,emf);
  kunderaQuery.setParameter("String_Node_Str",keyList);
  cqlQuery=parseAndCreateCqlQuery(kunderaQuery,emf,em,pu,CassandraPrimeUser.class,100);
  Assert.assertNotNull(cqlQuery);
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str" + timeLineId1 + "String_Node_Str"+ timeLineId1+ "String_Node_Str"+ timeLineId1+ "String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.contains("String_Node_Str"));
  Assert.assertTrue(cqlQuery.indexOf("String_Node_Str") > 0);
  em.close();
  emf.close();
  CassandraCli.dropKeySpace("String_Node_Str");
}