Program: 48326
Project: 48326
Buggy source:
@Test(groups={"String_Node_Str"}) public void testClusterConfigWithExternalMapReduce() throws Exception {
  String externalMR="String_Node_Str";
  String externalHDFS="String_Node_Str";
  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);
  spec.setExternalMapReduce(externalMR);
  spec.setExternalHDFS(externalHDFS);
  String clusterConfigJson="String_Node_Str" + externalMR + "String_Node_Str"+ externalHDFS+ "String_Node_Str";
  Map clusterConfig=(new Gson()).fromJson(clusterConfigJson,Map.class);
  spec.setConfiguration((Map<String,Object>)(clusterConfig.get("String_Node_Str")));
  NodeGroupCreate worker=new NodeGroupCreate();
  List<String> computeRoles=new ArrayList<String>();
  computeRoles.add("String_Node_Str");
  worker.setRoles(computeRoles);
  worker.setName("String_Node_Str");
  worker.setInstanceNum(2);
  worker.setInstanceType(InstanceType.MEDIUM);
  StorageRead storage=new StorageRead();
  storage.setType("String_Node_Str");
  storage.setSizeGB(10);
  worker.setStorage(storage);
  spec.setNodeGroups(new NodeGroupCreate[]{worker});
  spec=ClusterSpecFactory.getCustomizedSpec(spec,null);
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  Assert.assertEquals(cluster.getAdvancedProperties(),"String_Node_Str");
  ClusterRead clusterRead=clusterEntityMgr.toClusterRead("String_Node_Str");
  Assert.assertEquals(clusterRead.getExternalHDFS(),"String_Node_Str");
  Assert.assertEquals(clusterRead.getExternalMapReduce(),"String_Node_Str");
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"}) public void testClusterConfigWithExternalMapReduce() throws Exception {
  String externalMR="String_Node_Str";
  String externalHDFS="String_Node_Str";
  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);
  spec.setExternalMapReduce(externalMR);
  spec.setExternalHDFS(externalHDFS);
  String clusterConfigJson="String_Node_Str" + externalMR + "String_Node_Str"+ externalHDFS+ "String_Node_Str";
  Map clusterConfig=(new Gson()).fromJson(clusterConfigJson,Map.class);
  spec.setConfiguration((Map<String,Object>)(clusterConfig.get("String_Node_Str")));
  NodeGroupCreate worker=new NodeGroupCreate();
  List<String> computeRoles=new ArrayList<String>();
  computeRoles.add("String_Node_Str");
  worker.setRoles(computeRoles);
  worker.setName("String_Node_Str");
  worker.setInstanceNum(2);
  worker.setInstanceType(InstanceType.MEDIUM);
  StorageRead storage=new StorageRead();
  storage.setType("String_Node_Str");
  storage.setSizeGB(10);
  worker.setStorage(storage);
  spec.setNodeGroups(new NodeGroupCreate[]{worker});
  spec=ClusterSpecFactory.getCustomizedSpec(spec,null);
  clusterConfigMgr.createClusterConfig(spec);
  ClusterEntity cluster=clusterEntityMgr.findByName("String_Node_Str");
  Assert.assertTrue(cluster != null);
  Assert.assertEquals(cluster.getAdvancedProperties(),"String_Node_Str");
  ClusterRead clusterRead=clusterEntityMgr.toClusterRead("String_Node_Str",true);
  Assert.assertEquals(clusterRead.getExternalHDFS(),"String_Node_Str");
  Assert.assertEquals(clusterRead.getExternalMapReduce(),"String_Node_Str");
}