Program: 124715
Project: 124715
Buggy source:
@Test public void testGetConfsJarDefaultName() throws IOException {
  HadoopClusterConnectionItem hcConnectionItem=createHadoopClusterItem();
  String expectedConfJarName=HadoopParameterUtil.getConfsJarDefaultName(hcConnectionItem.getProperty().getLabel());
  HadoopConfsUtils.removeFromDeployedCache(hcConnectionItem,expectedConfJarName);
  String confsJarName=HadoopConfsUtils.getConfsJarDefaultName(hcConnectionItem,false);
  assertEquals(expectedConfJarName,confsJarName);
  assertFalse(HadoopConfsUtils.containsInDeployedCache(hcConnectionItem,confsJarName));
  HadoopConfsUtils.getConfsJarDefaultName(hcConnectionItem);
  assertEquals(expectedConfJarName,confsJarName);
  assertFalse(HadoopConfsUtils.containsInDeployedCache(hcConnectionItem,confsJarName));
  HadoopClusterConnection hcConnection=(HadoopClusterConnection)hcConnectionItem.getConnection();
  File testConfJarFile=File.createTempFile("String_Node_Str","String_Node_Str");
  testConfJarFile.deleteOnExit();
  hcConnection.setConfFile(FileUtils.readFileToByteArray(testConfJarFile));
  HadoopConfsUtils.getConfsJarDefaultName(hcConnectionItem);
  assertEquals(expectedConfJarName,confsJarName);
  boolean isNeedToBeDeployed=false;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerService.class)) {
    ILibraryManagerService libService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
    if (libService != null && libService.isJarNeedToBeDeployed(testConfJarFile)) {
      isNeedToBeDeployed=true;
    }
  }
  if (isNeedToBeDeployed) {
    assertTrue(HadoopConfsUtils.containsInDeployedCache(hcConnectionItem,confsJarName));
  }
 else {
    assertFalse(HadoopConfsUtils.containsInDeployedCache(hcConnectionItem,confsJarName));
  }
}

Fixed version (ground truth):
@Test public void testGetConfsJarDefaultName() throws IOException {
  HadoopClusterConnectionItem hcConnectionItem=ClusterTestUtil.createDefaultHadoopClusterItem();
  String expectedConfJarName=HadoopParameterUtil.getConfsJarDefaultName(hcConnectionItem.getProperty().getLabel());
  HadoopConfsUtils.removeFromDeployedCache(hcConnectionItem,expectedConfJarName);
  String confsJarName=HadoopConfsUtils.getConfsJarDefaultName(hcConnectionItem,false);
  assertEquals(expectedConfJarName,confsJarName);
  assertFalse(HadoopConfsUtils.containsInDeployedCache(hcConnectionItem,confsJarName));
  HadoopConfsUtils.getConfsJarDefaultName(hcConnectionItem);
  assertEquals(expectedConfJarName,confsJarName);
  assertFalse(HadoopConfsUtils.containsInDeployedCache(hcConnectionItem,confsJarName));
  HadoopClusterConnection hcConnection=(HadoopClusterConnection)hcConnectionItem.getConnection();
  File testConfJarFile=File.createTempFile("String_Node_Str","String_Node_Str");
  testConfJarFile.deleteOnExit();
  hcConnection.setConfFile(FileUtils.readFileToByteArray(testConfJarFile));
  HadoopConfsUtils.getConfsJarDefaultName(hcConnectionItem);
  assertEquals(expectedConfJarName,confsJarName);
  boolean isNeedToBeDeployed=false;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerService.class)) {
    ILibraryManagerService libService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
    if (libService != null && libService.isJarNeedToBeDeployed(testConfJarFile)) {
      isNeedToBeDeployed=true;
    }
  }
  if (isNeedToBeDeployed) {
    assertTrue(HadoopConfsUtils.containsInDeployedCache(hcConnectionItem,confsJarName));
  }
 else {
    assertFalse(HadoopConfsUtils.containsInDeployedCache(hcConnectionItem,confsJarName));
  }
}