Program: 48868
Project: 48868
Buggy source:
@Test(groups={"String_Node_Str"}) public void testClusterConfigWithTempfs() throws Exception {
  ClusterCreate spec=new ClusterCreate();
  spec.setName("String_Node_Str");
  List<String> rps=new ArrayList<String>();
  rps.add("String_Node_Str");
  spec.setRpNames(rps);
  spec.setNetworkConfig(createNetConfigs());
  spec.setDistro("String_Node_Str");
  spec.setDistroVendor(Constants.DEFAULT_VENDOR);
  NodeGroupCreate[] ngs=new NodeGroupCreate[3];
  NodeGroupCreate ng0=new NodeGroupCreate();
  ngs[0]=ng0;
  List<String> masterRoles=new ArrayList<String>();
  masterRoles.add("String_Node_Str");
  masterRoles.add("String_Node_Str");
  ngs[0].setRoles(masterRoles);
  ngs[0].setName("String_Node_Str");
  ngs[0].setInstanceNum(1);
  ngs[0].setInstanceType(InstanceType.LARGE);
  NodeGroupCreate ng1=new NodeGroupCreate();
  ngs[1]=ng1;
  List<String> dataNodeRoles=new ArrayList<String>();
  dataNodeRoles.add("String_Node_Str");
  ngs[1].setRoles(dataNodeRoles);
  ngs[1].setName("String_Node_Str");
  ngs[1].setInstanceNum(4);
  ngs[1].setInstanceType(InstanceType.MEDIUM);
  StorageRead storage=new StorageRead();
  storage.setType("String_Node_Str");
  storage.setSizeGB(50);
  ngs[1].setStorage(storage);
  NodeGroupCreate ng2=new NodeGroupCreate();
  ngs[2]=ng2;
  List<String> computeNodeRoles=new ArrayList<String>();
  computeNodeRoles.add("String_Node_Str");
  ngs[2].setRoles(computeNodeRoles);
  ngs[2].setName("String_Node_Str");
  ngs[2].setInstanceNum(8);
  ngs[2].setInstanceType(InstanceType.MEDIUM);
  StorageRead storageCompute=new StorageRead();
  storageCompute.setType("String_Node_Str");
  storageCompute.setSizeGB(50);
  ngs[2].setStorage(storageCompute);
  PlacementPolicy policy=new PlacementPolicy();
  policy.setInstancePerHost(2);
  List<GroupAssociation> associates=new ArrayList<GroupAssociation>();
  GroupAssociation associate=new GroupAssociation();
  associate.setReference("String_Node_Str");
  associate.setType(GroupAssociationType.STRICT);
  associates.add(associate);
  policy.setGroupAssociations(associates);
  ngs[2].setPlacementPolicies(policy);
  spec.setNodeGroups(ngs);
  spec=ClusterSpecFactory.getCustomizedSpec(spec);
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findClusterById(1l);
  List<ClusterEntity> cs=clusterEntityMgr.findAllClusters();
  for (  ClusterEntity c : cs) {
    System.out.println(c.getId());
  }
  cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  ClusterCreate attrs=clusterConfigMgr.getClusterConfig("String_Node_Str");
  String manifest=gson.toJson(attrs);
  System.out.println(manifest);
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"}) public void testClusterConfigWithTempfs() throws Exception {
  ClusterCreate spec=new ClusterCreate();
  spec.setName("String_Node_Str");
  List<String> rps=new ArrayList<String>();
  rps.add("String_Node_Str");
  spec.setRpNames(rps);
  spec.setNetworkConfig(createNetConfigs());
  spec.setDistro("String_Node_Str");
  spec.setDistroVendor(Constants.DEFAULT_VENDOR);
  NodeGroupCreate[] ngs=new NodeGroupCreate[3];
  NodeGroupCreate ng0=new NodeGroupCreate();
  ngs[0]=ng0;
  List<String> masterRoles=new ArrayList<String>();
  masterRoles.add("String_Node_Str");
  masterRoles.add("String_Node_Str");
  ngs[0].setRoles(masterRoles);
  ngs[0].setName("String_Node_Str");
  ngs[0].setInstanceNum(1);
  ngs[0].setCpuNum(2);
  ngs[0].setMemCapacityMB(7500);
  ngs[0].setInstanceType(InstanceType.LARGE);
  NodeGroupCreate ng1=new NodeGroupCreate();
  ngs[1]=ng1;
  List<String> dataNodeRoles=new ArrayList<String>();
  dataNodeRoles.add("String_Node_Str");
  ngs[1].setRoles(dataNodeRoles);
  ngs[1].setName("String_Node_Str");
  ngs[1].setInstanceNum(4);
  ngs[1].setCpuNum(2);
  ngs[1].setMemCapacityMB(7500);
  ngs[1].setInstanceType(InstanceType.MEDIUM);
  StorageRead storage=new StorageRead();
  storage.setType("String_Node_Str");
  storage.setSizeGB(50);
  ngs[1].setStorage(storage);
  NodeGroupCreate ng2=new NodeGroupCreate();
  ngs[2]=ng2;
  List<String> computeNodeRoles=new ArrayList<String>();
  computeNodeRoles.add("String_Node_Str");
  ngs[2].setRoles(computeNodeRoles);
  ngs[2].setName("String_Node_Str");
  ngs[2].setInstanceNum(8);
  ngs[2].setCpuNum(2);
  ngs[2].setMemCapacityMB(7500);
  ngs[2].setInstanceType(InstanceType.MEDIUM);
  StorageRead storageCompute=new StorageRead();
  storageCompute.setType("String_Node_Str");
  storageCompute.setSizeGB(50);
  ngs[2].setStorage(storageCompute);
  PlacementPolicy policy=new PlacementPolicy();
  policy.setInstancePerHost(2);
  List<GroupAssociation> associates=new ArrayList<GroupAssociation>();
  GroupAssociation associate=new GroupAssociation();
  associate.setReference("String_Node_Str");
  associate.setType(GroupAssociationType.STRICT);
  associates.add(associate);
  policy.setGroupAssociations(associates);
  ngs[2].setPlacementPolicies(policy);
  spec.setNodeGroups(ngs);
  spec=ClusterSpecFactory.getCustomizedSpec(spec);
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findClusterById(1l);
  List<ClusterEntity> cs=clusterEntityMgr.findAllClusters();
  for (  ClusterEntity c : cs) {
    System.out.println(c.getId());
  }
  cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  ClusterCreate attrs=clusterConfigMgr.getClusterConfig("String_Node_Str");
  String manifest=gson.toJson(attrs);
  System.out.println(manifest);
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
  Assert.assertTrue(manifest.indexOf("String_Node_Str") != -1,"String_Node_Str");
}