Program: 62910
Project: 62910
Buggy source:
@Test public void testExecuteAndPostProcess() throws Exception {
  InstructorAttributes instructor1OfCourse1=dataBundle.instructors.get("String_Node_Str");
  StudentAttributes student1InCourse1=dataBundle.students.get("String_Node_Str");
  String instructorId=instructor1OfCourse1.googleId;
  String newStudentEmail="String_Node_Str";
  String newStudentTeam="String_Node_Str";
  String newStudentComments="String_Node_Str";
  String newStudentEmailToBeTrimmed="String_Node_Str";
  String newStudentTeamToBeTrimmed="String_Node_Str";
  String newStudentCommentsToBeTrimmed="String_Node_Str";
  gaeSimulation.loginAsInstructor(instructorId);
  ______TS("String_Node_Str");
  verifyAssumptionFailure();
  String[] invalidParams=new String[]{Const.ParamsNames.COURSE_ID,instructor1OfCourse1.courseId};
  verifyAssumptionFailure(invalidParams);
  invalidParams=new String[]{Const.ParamsNames.STUDENT_EMAIL,student1InCourse1.email};
  verifyAssumptionFailure(invalidParams);
  ______TS("String_Node_Str");
  String[] submissionParams=new String[]{Const.ParamsNames.COURSE_ID,instructor1OfCourse1.courseId,Const.ParamsNames.STUDENT_EMAIL,student1InCourse1.email,Const.ParamsNames.STUDENT_NAME,student1InCourse1.name,Const.ParamsNames.NEW_STUDENT_EMAIL,newStudentEmail,Const.ParamsNames.COMMENTS,newStudentComments,Const.ParamsNames.TEAM_NAME,newStudentTeam};
  InstructorCourseStudentDetailsEditSaveAction a=getAction(submissionParams);
  RedirectResult r=getRedirectResult(a);
  assertEquals(Const.ActionURIs.INSTRUCTOR_COURSE_DETAILS_PAGE + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",r.getDestinationWithParams());
  assertEquals(false,r.isError);
  assertEquals(Const.StatusMessages.STUDENT_EDITED,r.getStatusMessage());
  String expectedLogMessage="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + student1InCourse1.email + "String_Node_Str"+ "String_Node_Str"+ newStudentEmail+ "String_Node_Str"+ newStudentTeam+ "String_Node_Str"+ newStudentComments+ "String_Node_Str";
  assertEquals(expectedLogMessage,a.getLogMessage());
  ______TS("String_Node_Str");
  String invalidStudentEmail="String_Node_Str";
  submissionParams=new String[]{Const.ParamsNames.COURSE_ID,instructor1OfCourse1.courseId,Const.ParamsNames.STUDENT_EMAIL,newStudentEmail,Const.ParamsNames.STUDENT_NAME,student1InCourse1.name,Const.ParamsNames.NEW_STUDENT_EMAIL,invalidStudentEmail,Const.ParamsNames.COMMENTS,student1InCourse1.comments,Const.ParamsNames.TEAM_NAME,student1InCourse1.team};
  gaeSimulation.loginAsInstructor(instructorId);
  a=getAction(submissionParams);
  ShowPageResult result=getShowPageResult(a);
  assertEquals(Const.ViewURIs.INSTRUCTOR_COURSE_STUDENT_EDIT + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",result.getDestinationWithParams());
  assertEquals(true,result.isError);
  assertEquals(String.format(FieldValidator.EMAIL_ERROR_MESSAGE,invalidStudentEmail,FieldValidator.REASON_TOO_LONG),result.getStatusMessage());
  expectedLogMessage="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + String.format(FieldValidator.EMAIL_ERROR_MESSAGE,invalidStudentEmail,FieldValidator.REASON_TOO_LONG) + "String_Node_Str";
  assertEquals(expectedLogMessage,a.getLogMessage());
  ______TS("String_Node_Str");
  String takenStudentEmail=dataBundle.students.get("String_Node_Str").email;
  submissionParams=new String[]{Const.ParamsNames.COURSE_ID,instructor1OfCourse1.courseId,Const.ParamsNames.STUDENT_EMAIL,newStudentEmail,Const.ParamsNames.STUDENT_NAME,student1InCourse1.name,Const.ParamsNames.NEW_STUDENT_EMAIL,takenStudentEmail,Const.ParamsNames.COMMENTS,student1InCourse1.comments,Const.ParamsNames.TEAM_NAME,student1InCourse1.team};
  gaeSimulation.loginAsInstructor(instructorId);
  a=getAction(submissionParams);
  result=getShowPageResult(a);
  assertEquals(Const.ViewURIs.INSTRUCTOR_COURSE_STUDENT_EDIT + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",result.getDestinationWithParams());
  assertEquals(true,result.isError);
  assertEquals(String.format(FieldValidator.EMAIL_TAKEN_MESSAGE,dataBundle.students.get("String_Node_Str").name,takenStudentEmail),result.getStatusMessage());
  expectedLogMessage="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + String.format(FieldValidator.EMAIL_TAKEN_MESSAGE,dataBundle.students.get("String_Node_Str").name,takenStudentEmail) + "String_Node_Str";
  assertEquals(expectedLogMessage,a.getLogMessage());
}

Fixed version (ground truth):
@Test public void testExecuteAndPostProcess() throws Exception {
  InstructorAttributes instructor1OfCourse1=dataBundle.instructors.get("String_Node_Str");
  StudentAttributes student1InCourse1=dataBundle.students.get("String_Node_Str");
  String instructorId=instructor1OfCourse1.googleId;
  String newStudentEmail="String_Node_Str";
  String newStudentTeam="String_Node_Str";
  String newStudentComments="String_Node_Str";
  gaeSimulation.loginAsInstructor(instructorId);
  ______TS("String_Node_Str");
  verifyAssumptionFailure();
  String[] invalidParams=new String[]{Const.ParamsNames.COURSE_ID,instructor1OfCourse1.courseId};
  verifyAssumptionFailure(invalidParams);
  invalidParams=new String[]{Const.ParamsNames.STUDENT_EMAIL,student1InCourse1.email};
  verifyAssumptionFailure(invalidParams);
  ______TS("String_Node_Str");
  String[] submissionParams=new String[]{Const.ParamsNames.COURSE_ID,instructor1OfCourse1.courseId,Const.ParamsNames.STUDENT_EMAIL,student1InCourse1.email,Const.ParamsNames.STUDENT_NAME,student1InCourse1.name,Const.ParamsNames.NEW_STUDENT_EMAIL,newStudentEmail,Const.ParamsNames.COMMENTS,newStudentComments,Const.ParamsNames.TEAM_NAME,newStudentTeam};
  InstructorCourseStudentDetailsEditSaveAction a=getAction(submissionParams);
  RedirectResult r=getRedirectResult(a);
  assertEquals(Const.ActionURIs.INSTRUCTOR_COURSE_DETAILS_PAGE + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",r.getDestinationWithParams());
  assertEquals(false,r.isError);
  assertEquals(Const.StatusMessages.STUDENT_EDITED,r.getStatusMessage());
  String expectedLogMessage="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + student1InCourse1.email + "String_Node_Str"+ "String_Node_Str"+ newStudentEmail+ "String_Node_Str"+ newStudentTeam+ "String_Node_Str"+ newStudentComments+ "String_Node_Str";
  assertEquals(expectedLogMessage,a.getLogMessage());
  ______TS("String_Node_Str");
  String newStudentEmailToBeTrimmed="String_Node_Str";
  String newStudentTeamToBeTrimmed="String_Node_Str";
  String newStudentCommentsToBeTrimmed="String_Node_Str";
  String[] submissionParamsToBeTrimmed=new String[]{Const.ParamsNames.COURSE_ID,instructor1OfCourse1.courseId,Const.ParamsNames.STUDENT_EMAIL,newStudentEmail,Const.ParamsNames.STUDENT_NAME,student1InCourse1.name,Const.ParamsNames.NEW_STUDENT_EMAIL,newStudentEmailToBeTrimmed,Const.ParamsNames.COMMENTS,newStudentCommentsToBeTrimmed,Const.ParamsNames.TEAM_NAME,newStudentTeamToBeTrimmed};
  InstructorCourseStudentDetailsEditSaveAction aToBeTrimmed=getAction(submissionParamsToBeTrimmed);
  RedirectResult rToBeTrimmed=getRedirectResult(aToBeTrimmed);
  assertEquals(Const.ActionURIs.INSTRUCTOR_COURSE_DETAILS_PAGE + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",rToBeTrimmed.getDestinationWithParams());
  assertEquals(false,rToBeTrimmed.isError);
  assertEquals(Const.StatusMessages.STUDENT_EDITED,rToBeTrimmed.getStatusMessage());
  String expectedLogMessageToBeTrimmed="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + newStudentEmail + "String_Node_Str"+ "String_Node_Str"+ newStudentEmailToBeTrimmed.trim()+ "String_Node_Str"+ newStudentTeamToBeTrimmed.trim()+ "String_Node_Str"+ newStudentCommentsToBeTrimmed.trim()+ "String_Node_Str";
  assertEquals(expectedLogMessageToBeTrimmed,aToBeTrimmed.getLogMessage());
  ______TS("String_Node_Str");
  String invalidStudentEmail="String_Node_Str";
  submissionParams=new String[]{Const.ParamsNames.COURSE_ID,instructor1OfCourse1.courseId,Const.ParamsNames.STUDENT_EMAIL,newStudentEmail,Const.ParamsNames.STUDENT_NAME,student1InCourse1.name,Const.ParamsNames.NEW_STUDENT_EMAIL,invalidStudentEmail,Const.ParamsNames.COMMENTS,student1InCourse1.comments,Const.ParamsNames.TEAM_NAME,student1InCourse1.team};
  gaeSimulation.loginAsInstructor(instructorId);
  a=getAction(submissionParams);
  ShowPageResult result=getShowPageResult(a);
  assertEquals(Const.ViewURIs.INSTRUCTOR_COURSE_STUDENT_EDIT + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",result.getDestinationWithParams());
  assertEquals(true,result.isError);
  assertEquals(String.format(FieldValidator.EMAIL_ERROR_MESSAGE,invalidStudentEmail,FieldValidator.REASON_TOO_LONG),result.getStatusMessage());
  expectedLogMessage="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + String.format(FieldValidator.EMAIL_ERROR_MESSAGE,invalidStudentEmail,FieldValidator.REASON_TOO_LONG) + "String_Node_Str";
  assertEquals(expectedLogMessage,a.getLogMessage());
  ______TS("String_Node_Str");
  String takenStudentEmail=dataBundle.students.get("String_Node_Str").email;
  submissionParams=new String[]{Const.ParamsNames.COURSE_ID,instructor1OfCourse1.courseId,Const.ParamsNames.STUDENT_EMAIL,newStudentEmail,Const.ParamsNames.STUDENT_NAME,student1InCourse1.name,Const.ParamsNames.NEW_STUDENT_EMAIL,takenStudentEmail,Const.ParamsNames.COMMENTS,student1InCourse1.comments,Const.ParamsNames.TEAM_NAME,student1InCourse1.team};
  gaeSimulation.loginAsInstructor(instructorId);
  a=getAction(submissionParams);
  result=getShowPageResult(a);
  assertEquals(Const.ViewURIs.INSTRUCTOR_COURSE_STUDENT_EDIT + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",result.getDestinationWithParams());
  assertEquals(true,result.isError);
  assertEquals(String.format(FieldValidator.EMAIL_TAKEN_MESSAGE,dataBundle.students.get("String_Node_Str").name,takenStudentEmail),result.getStatusMessage());
  expectedLogMessage="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + String.format(FieldValidator.EMAIL_TAKEN_MESSAGE,dataBundle.students.get("String_Node_Str").name,takenStudentEmail) + "String_Node_Str";
  assertEquals(expectedLogMessage,a.getLogMessage());
}