Program: 7761
Project: 7761
Buggy source:
@Test public void testWordCount() throws Exception {
  final ApplicationWithPrograms app=TestHelper.deployApplicationWithManager(AppWithMapReduce.class);
  OperationExecutor opex=injector.getInstance(OperationExecutor.class);
  LocationFactory locationFactory=injector.getInstance(LocationFactory.class);
  DataSetAccessor dataSetAccessor=injector.getInstance(DataSetAccessor.class);
  TransactionSystemClient txSystemClient=injector.getInstance(TransactionSystemClient.class);
  OperationContext opCtx=new OperationContext(DefaultId.ACCOUNT.getId(),app.getAppSpecLoc().getSpecification().getName());
  String inputPath=createInput();
  File outputDir=new File(tmpFolder.newFolder(),"String_Node_Str");
  TransactionProxy proxy=new TransactionProxy();
  DataSetInstantiator dataSetInstantiator=new DataSetInstantiator(new DataFabricImpl(opex,locationFactory,dataSetAccessor,opCtx),proxy,getClass().getClassLoader());
  dataSetInstantiator.setDataSets(ImmutableList.copyOf(new AppWithMapReduce().configure().getDataSets().values()));
  TransactionAgent txAgent=new SynchronousTransactionAgent(opex,opCtx,dataSetInstantiator.getTransactionAware(),txSystemClient);
  proxy.setTransactionAgent(txAgent);
  KeyValueTable jobConfigTable=(KeyValueTable)dataSetInstantiator.getDataSet("String_Node_Str");
  txAgent.start();
  jobConfigTable.write(tb("String_Node_Str"),tb(inputPath));
  jobConfigTable.write(tb("String_Node_Str"),tb(outputDir.getPath()));
  txAgent.finish();
  runProgram(app,AppWithMapReduce.ClassicWordCount.class);
  File outputFile=outputDir.listFiles()[0];
  int lines=0;
  BufferedReader reader=new BufferedReader(new FileReader(outputFile));
  try {
    while (true) {
      String line=reader.readLine();
      if (line == null) {
        break;
      }
      lines++;
    }
  }
  finally {
    reader.close();
  }
  Assert.assertTrue(lines > 0);
}

Fixed version (ground truth):
@Test public void testWordCount() throws Exception {
  final ApplicationWithPrograms app=TestHelper.deployApplicationWithManager(AppWithMapReduce.class);
  injector.getInstance(InMemoryTransactionManager.class).init();
  OperationExecutor opex=injector.getInstance(OperationExecutor.class);
  LocationFactory locationFactory=injector.getInstance(LocationFactory.class);
  DataSetAccessor dataSetAccessor=injector.getInstance(DataSetAccessor.class);
  TransactionSystemClient txSystemClient=injector.getInstance(TransactionSystemClient.class);
  OperationContext opCtx=new OperationContext(DefaultId.ACCOUNT.getId(),app.getAppSpecLoc().getSpecification().getName());
  String inputPath=createInput();
  File outputDir=new File(tmpFolder.newFolder(),"String_Node_Str");
  TransactionProxy proxy=new TransactionProxy();
  DataSetInstantiator dataSetInstantiator=new DataSetInstantiator(new DataFabricImpl(opex,locationFactory,dataSetAccessor,opCtx),proxy,getClass().getClassLoader());
  dataSetInstantiator.setDataSets(ImmutableList.copyOf(new AppWithMapReduce().configure().getDataSets().values()));
  TransactionAgent txAgent=new SynchronousTransactionAgent(opex,opCtx,dataSetInstantiator.getTransactionAware(),txSystemClient);
  proxy.setTransactionAgent(txAgent);
  KeyValueTable jobConfigTable=(KeyValueTable)dataSetInstantiator.getDataSet("String_Node_Str");
  txAgent.start();
  jobConfigTable.write(tb("String_Node_Str"),tb(inputPath));
  jobConfigTable.write(tb("String_Node_Str"),tb(outputDir.getPath()));
  txAgent.finish();
  runProgram(app,AppWithMapReduce.ClassicWordCount.class);
  File outputFile=outputDir.listFiles()[0];
  int lines=0;
  BufferedReader reader=new BufferedReader(new FileReader(outputFile));
  try {
    while (true) {
      String line=reader.readLine();
      if (line == null) {
        break;
      }
      lines++;
    }
  }
  finally {
    reader.close();
  }
  Assert.assertTrue(lines > 0);
}