Program: 172179
Project: 172179
Buggy source:
public void testErrorDuringCommit(){
  Exception error=new TransferException("String_Node_Str");
  TransferProgress status0=new TransferProgress();
  status0.setStatus(Status.COMMIT_REQUESTED);
  status0.setCurrentPosition(0);
  status0.setEndPosition(0);
  TransferProgress status1=new TransferProgress();
  status1.setStatus(Status.COMMITTING);
  status1.setCurrentPosition(0);
  status1.setEndPosition(4);
  TransferProgress status2=new TransferProgress();
  status2.setStatus(Status.COMMITTING);
  status2.setCurrentPosition(3);
  status2.setEndPosition(4);
  TransferProgress status3=new TransferProgress();
  status3.setStatus(Status.COMMITTING);
  status3.setCurrentPosition(5);
  status3.setEndPosition(8);
  TransferProgress status4=new TransferProgress();
  status4.setStatus(Status.ERROR);
  status4.setCurrentPosition(8);
  status4.setEndPosition(8);
  status4.setError(error);
  TransferProgress[] statuses=new TransferProgress[]{status0,status1,status2,status3,status4};
  configureBasicMockTransmitter(statuses);
  when(mockedTransferTransmitter.begin(target)).thenReturn(transfer);
  TransferDefinition transferDef=new TransferDefinition();
  transferDef.setNodes(folder1,file1,file2,file3);
  try {
    transferService.transfer(TRANSFER_TARGET_NAME,transferDef,mockedCallback);
    fail();
  }
 catch (  TransferFailureException ex) {
    List<TransferEvent> expectedEvents=new ArrayList<TransferEvent>();
    TransferEventImpl event;
    event=new TransferEventEnterState();
    event.setTransferState(TransferState.START);
    expectedEvents.add(event);
    event=new TransferEventBegin();
    event.setTransferState(TransferState.START);
    expectedEvents.add(event);
    event=new TransferEventEndState();
    event.setTransferState(TransferState.START);
    expectedEvents.add(event);
    event=new TransferEventEnterState();
    event.setTransferState(TransferState.SENDING_SNAPSHOT);
    expectedEvents.add(event);
    event=new TransferEventSendingSnapshot();
    event.setTransferState(TransferState.SENDING_SNAPSHOT);
    expectedEvents.add(event);
    event=new TransferEventEndState();
    event.setTransferState(TransferState.SENDING_SNAPSHOT);
    expectedEvents.add(event);
    event=new TransferEventEnterState();
    event.setTransferState(TransferState.SENDING_CONTENT);
    expectedEvents.add(event);
    event=new TransferEventSendingContent();
    event.setTransferState(TransferState.SENDING_CONTENT);
    expectedEvents.add(event);
    event=new TransferEventSendingContent();
    event.setTransferState(TransferState.SENDING_CONTENT);
    expectedEvents.add(event);
    event=new TransferEventSendingContent();
    event.setTransferState(TransferState.SENDING_CONTENT);
    expectedEvents.add(event);
    event=new TransferEventEndState();
    event.setTransferState(TransferState.SENDING_CONTENT);
    expectedEvents.add(event);
    event=new TransferEventEnterState();
    event.setTransferState(TransferState.PREPARING);
    expectedEvents.add(event);
    event=new TransferEventEndState();
    event.setTransferState(TransferState.PREPARING);
    expectedEvents.add(event);
    event=new TransferEventEnterState();
    event.setTransferState(TransferState.COMMITTING);
    expectedEvents.add(event);
    event=new TransferEventCommittingStatus();
    event.setTransferState(TransferState.COMMITTING);
    expectedEvents.add(event);
    event=new TransferEventCommittingStatus();
    event.setTransferState(TransferState.COMMITTING);
    expectedEvents.add(event);
    event=new TransferEventCommittingStatus();
    event.setTransferState(TransferState.COMMITTING);
    expectedEvents.add(event);
    event=new TransferEventCommittingStatus();
    event.setTransferState(TransferState.COMMITTING);
    expectedEvents.add(event);
    event=new TransferEventEndState();
    event.setTransferState(TransferState.COMMITTING);
    expectedEvents.add(event);
    event=new TransferEventEnterState();
    event.setTransferState(TransferState.ERROR);
    expectedEvents.add(event);
    event=new TransferEventReport();
    event.setTransferState(TransferState.ERROR);
    expectedEvents.add(event);
    event=new TransferEventReport();
    event.setTransferState(TransferState.ERROR);
    expectedEvents.add(event);
    event=new TransferEventError();
    event.setTransferState(TransferState.ERROR);
    ((TransferEventError)event).setException(error);
    expectedEvents.add(event);
    verifyCallback(expectedEvents);
  }
}

Fixed version (ground truth):
public void testErrorDuringCommit(){
  Exception error=new TransferException("String_Node_Str");
  TransferProgress status0=new TransferProgress();
  status0.setStatus(Status.COMMIT_REQUESTED);
  status0.setCurrentPosition(0);
  status0.setEndPosition(0);
  TransferProgress status1=new TransferProgress();
  status1.setStatus(Status.COMMITTING);
  status1.setCurrentPosition(0);
  status1.setEndPosition(4);
  TransferProgress status2=new TransferProgress();
  status2.setStatus(Status.COMMITTING);
  status2.setCurrentPosition(3);
  status2.setEndPosition(4);
  TransferProgress status3=new TransferProgress();
  status3.setStatus(Status.COMMITTING);
  status3.setCurrentPosition(5);
  status3.setEndPosition(8);
  TransferProgress status4=new TransferProgress();
  status4.setStatus(Status.ERROR);
  status4.setCurrentPosition(8);
  status4.setEndPosition(8);
  status4.setError(error);
  TransferProgress[] statuses=new TransferProgress[]{status0,status1,status2,status3,status4};
  configureBasicMockTransmitter(statuses);
  when(mockedTransferTransmitter.begin(target)).thenReturn(transfer);
  TransferDefinition transferDef=new TransferDefinition();
  transferDef.setNodes(folder1,file1,file2,file3);
  try {
    transferService.transfer(TRANSFER_TARGET_NAME,transferDef,mockedCallback);
    fail();
  }
 catch (  TransferFailureException ex) {
    List<TransferEvent> expectedEvents=new ArrayList<TransferEvent>();
    TransferEventImpl event;
    event=new TransferEventEnterState();
    event.setTransferState(TransferState.START);
    expectedEvents.add(event);
    event=new TransferEventBegin();
    event.setTransferState(TransferState.START);
    expectedEvents.add(event);
    event=new TransferEventEndState();
    event.setTransferState(TransferState.START);
    expectedEvents.add(event);
    event=new TransferEventEnterState();
    event.setTransferState(TransferState.SENDING_SNAPSHOT);
    expectedEvents.add(event);
    event=new TransferEventSendingSnapshot();
    event.setTransferState(TransferState.SENDING_SNAPSHOT);
    expectedEvents.add(event);
    event=new TransferEventEndState();
    event.setTransferState(TransferState.SENDING_SNAPSHOT);
    expectedEvents.add(event);
    event=new TransferEventEnterState();
    event.setTransferState(TransferState.SENDING_CONTENT);
    expectedEvents.add(event);
    event=new TransferEventSendingContent();
    event.setTransferState(TransferState.SENDING_CONTENT);
    expectedEvents.add(event);
    event=new TransferEventSendingContent();
    event.setTransferState(TransferState.SENDING_CONTENT);
    expectedEvents.add(event);
    event=new TransferEventSendingContent();
    event.setTransferState(TransferState.SENDING_CONTENT);
    expectedEvents.add(event);
    event=new TransferEventEndState();
    event.setTransferState(TransferState.SENDING_CONTENT);
    expectedEvents.add(event);
    event=new TransferEventEnterState();
    event.setTransferState(TransferState.PREPARING);
    expectedEvents.add(event);
    event=new TransferEventEndState();
    event.setTransferState(TransferState.PREPARING);
    expectedEvents.add(event);
    event=new TransferEventEnterState();
    event.setTransferState(TransferState.COMMITTING);
    expectedEvents.add(event);
    event=new TransferEventCommittingStatus();
    event.setTransferState(TransferState.COMMITTING);
    expectedEvents.add(event);
    event=new TransferEventCommittingStatus();
    event.setTransferState(TransferState.COMMITTING);
    expectedEvents.add(event);
    event=new TransferEventCommittingStatus();
    event.setTransferState(TransferState.COMMITTING);
    expectedEvents.add(event);
    event=new TransferEventEndState();
    event.setTransferState(TransferState.COMMITTING);
    expectedEvents.add(event);
    event=new TransferEventEnterState();
    event.setTransferState(TransferState.ERROR);
    expectedEvents.add(event);
    event=new TransferEventReport();
    event.setTransferState(TransferState.ERROR);
    expectedEvents.add(event);
    event=new TransferEventReport();
    event.setTransferState(TransferState.ERROR);
    expectedEvents.add(event);
    event=new TransferEventError();
    event.setTransferState(TransferState.ERROR);
    ((TransferEventError)event).setException(error);
    expectedEvents.add(event);
    verifyCallback(expectedEvents);
  }
}