Program: 117880
Project: 117880
Buggy source:
@Test public void testBdEeDemoComplete() throws Exception {
  Assert.assertTrue(eeResManager instanceof FileResourcesUnityManager);
  Iterator path=eeResManager.getPaths().iterator();
  String firstFilePath=((Path)path.next()).toPortableString();
  String eeDemoName=demoName.substring(0,demoName.indexOf("String_Node_Str"));
  String tempFolderPath=firstFilePath.substring(0,firstFilePath.indexOf(TEMP_FOLDER_SUFFIEX) + TEMP_FOLDER_SUFFIEX.length());
  Assert.assertTrue(new File(tempFolderPath).exists());
  String rootPath=tempFolderPath + File.separator + eeDemoName;
  Assert.assertTrue(new File(rootPath).exists());
  File tempJobsFolder=new File(rootPath + File.separator + processItemPath);
  List<File> demoJobItemFiles=DemoImportTestUtil.collectProjectFilesFromDirectory(tempJobsFolder,FileConstants.ITEM_EXTENSION,true);
  Assert.assertTrue(demoJobItemFiles.size() > 0);
  int currentJobItemsSize=ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.PROCESS).size();
  Assert.assertTrue(currentJobItemsSize > 0);
  Assert.assertEquals(demoJobItemFiles.size(),currentJobItemsSize);
  int currentMrItemsSize=ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.PROCESS_MR).size();
  File tempMrItemsFolder=new File(rootPath + File.separator + processMrPath);
  List<File> demoMrItemsFiles=DemoImportTestUtil.collectProjectFilesFromDirectory(tempMrItemsFolder,FileConstants.ITEM_EXTENSION,true);
  Assert.assertTrue(demoMrItemsFiles.size() > 0);
  Assert.assertTrue(currentMrItemsSize > 0);
  Assert.assertEquals(demoMrItemsFiles.size(),currentMrItemsSize);
  int currentContextItemsSize=ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.CONTEXT).size();
  File tempContextItemsFolder=new File(rootPath + File.separator + contextItemPath);
  List<File> demoContextItemsFiles=DemoImportTestUtil.collectProjectFilesFromDirectory(tempContextItemsFolder,FileConstants.ITEM_EXTENSION,true);
  Assert.assertTrue(demoContextItemsFiles.size() > 0);
  Assert.assertTrue(currentContextItemsSize > 0);
  Assert.assertEquals(demoContextItemsFiles.size(),currentContextItemsSize);
  doRoutinesItemsTest(rootPath);
  int currentConnectionItemsSize=ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.METADATA).size();
  int currentHadoopConnItemsSize=ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.valueOf(ERepositoryObjectType.class,"String_Node_Str")).size();
  File tempConnItemsFolder=new File(rootPath + File.separator + connectionItemPath);
  List<File> demoConItemsFiles=DemoImportTestUtil.collectProjectFilesFromDirectory(tempConnItemsFolder,FileConstants.ITEM_EXTENSION,true);
  Assert.assertTrue(demoConItemsFiles.size() > 0);
  Assert.assertTrue(currentConnectionItemsSize > 0);
  Assert.assertEquals(demoConItemsFiles.size(),currentConnectionItemsSize);
  int currentDocItemsSize=ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.DOCUMENTATION).size();
  File tempDocItemsFolder=new File(rootPath + File.separator + documentionPath);
  List<File> demoDocItemsFiles=DemoImportTestUtil.collectProjectFilesFromDirectory(tempDocItemsFolder,FileConstants.ITEM_EXTENSION,true);
  Assert.assertTrue(demoDocItemsFiles.size() > 0);
  Assert.assertTrue(currentDocItemsSize > 0);
  Assert.assertEquals(demoDocItemsFiles.size(),currentDocItemsSize);
}

Fixed version (ground truth):
@Test public void testBdEeDemoComplete() throws Exception {
  Assert.assertTrue(eeResManager instanceof FileResourcesUnityManager);
  List<File> demoJobItemFiles=getDemoItemFileList(rootPath + File.separator + processItemPath);
  Assert.assertTrue(demoJobItemFiles.size() > 0);
  int currentJobItemsSize=ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.PROCESS).size();
  Assert.assertTrue(currentJobItemsSize > 0);
  Assert.assertEquals(demoJobItemFiles.size(),currentJobItemsSize);
  int currentMrItemsSize=ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.PROCESS_MR).size();
  List<File> demoMrItemsFiles=getDemoItemFileList(rootPath + File.separator + processMrPath);
  Assert.assertTrue(demoMrItemsFiles.size() > 0);
  Assert.assertTrue(currentMrItemsSize > 0);
  Assert.assertEquals(demoMrItemsFiles.size(),currentMrItemsSize);
  int currentContextItemsSize=ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.CONTEXT).size();
  List<File> demoContextItemsFiles=getDemoItemFileList(rootPath + File.separator + contextItemPath);
  Assert.assertTrue(demoContextItemsFiles.size() > 0);
  Assert.assertTrue(currentContextItemsSize > 0);
  Assert.assertEquals(demoContextItemsFiles.size(),currentContextItemsSize);
  doRoutinesItemsTest(rootPath);
  int currentConnectionItemsSize=ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.METADATA).size();
  List<File> demoConItemsFiles=getDemoItemFileList(rootPath + File.separator + connectionItemPath);
  Assert.assertTrue(demoConItemsFiles.size() > 0);
  Assert.assertTrue(currentConnectionItemsSize > 0);
  Assert.assertEquals(demoConItemsFiles.size(),currentConnectionItemsSize);
  int currentDocItemsSize=ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.DOCUMENTATION).size();
  List<File> demoDocItemsFiles=getDemoItemFileList(rootPath + File.separator + documentionPath);
  Assert.assertTrue(demoDocItemsFiles.size() > 0);
  Assert.assertTrue(currentDocItemsSize > 0);
  Assert.assertEquals(demoDocItemsFiles.size(),currentDocItemsSize);
}