Program: 62974
Project: 62974
Buggy source:
@Test public void testCoordEvalSubmissionViewAndEdit() throws Exception {
  EvaluationData eval=scn.evaluations.get("String_Node_Str");
  ______TS("String_Node_Str");
  String link=appUrl + Common.PAGE_COORD_EVAL_RESULTS;
  link=Common.addParamToUrl(link,Common.PARAM_COURSE_ID,eval.course);
  link=Common.addParamToUrl(link,Common.PARAM_EVALUATION_NAME,eval.name);
  link=Common.addParamToUrl(link,Common.PARAM_USER_ID,scn.coords.get("String_Node_Str").id);
  bi.goToUrl(link);
  int studentResultsRowID=bi.getStudentRowId(scn.students.get("String_Node_Str").name);
  bi.click(bi.getReviewerSummaryView(studentResultsRowID));
  String current=bi.getDriver().getWindowHandle();
  for (  String s : bi.getDriver().getWindowHandles()) {
    if (!current.equals(s)) {
      bi.getSelenium().selectWindow(s);
      break;
    }
  }
  bi.verifyCurrentPageHTML(Common.TEST_PAGES_FOLDER + "String_Node_Str");
  ______TS("String_Node_Str");
  link=appUrl + Common.PAGE_COORD_EVAL_SUBMISSION_VIEW;
  link=Common.addParamToUrl(link,Common.PARAM_COURSE_ID,eval.course);
  link=Common.addParamToUrl(link,Common.PARAM_EVALUATION_NAME,eval.name);
  link=Common.addParamToUrl(link,Common.PARAM_STUDENT_EMAIL,scn.students.get("String_Node_Str").email);
  link=Common.addParamToUrl(link,Common.PARAM_USER_ID,scn.coords.get("String_Node_Str").id);
  bi.goToUrl(link);
  bi.verifyCurrentPageHTML(Common.TEST_PAGES_FOLDER + "String_Node_Str");
  bi.click(By.id("String_Node_Str"));
  ______TS("String_Node_Str");
  bi.verifyCurrentPageHTML(Common.TEST_PAGES_FOLDER + "String_Node_Str");
  SubmissionData[] subs=new SubmissionData[3];
  subs[0]=scn.submissions.get("String_Node_Str");
  subs[1]=scn.submissions.get("String_Node_Str");
  subs[2]=scn.submissions.get("String_Node_Str");
  for (int i=0; i < 3; i++) {
    subs[i].points-=10;
    subs[i].justification=new Text(subs[i].justification.getValue() + "String_Node_Str");
    subs[i].p2pFeedback=new Text(subs[i].p2pFeedback.getValue() + "String_Node_Str");
  }
  int charlieEditRowID=bi.getStudentRowIdInEditSubmission(scn.students.get("String_Node_Str").name);
  bi.setSubmissionPoint(charlieEditRowID,subs[0].points + "String_Node_Str");
  bi.setSubmissionJustification(charlieEditRowID,subs[0].justification.getValue());
  bi.setSubmissionComments(charlieEditRowID,subs[0].p2pFeedback.getValue());
  int dannyEditRowID=bi.getStudentRowIdInEditSubmission(scn.students.get("String_Node_Str").name);
  bi.setSubmissionPoint(dannyEditRowID,subs[1].points + "String_Node_Str");
  bi.setSubmissionJustification(dannyEditRowID,subs[1].justification.getValue());
  bi.setSubmissionComments(dannyEditRowID,subs[1].p2pFeedback.getValue());
  int emilyEditRowID=bi.getStudentRowIdInEditSubmission(scn.students.get("String_Node_Str").name);
  bi.setSubmissionPoint(emilyEditRowID,subs[2].points + "String_Node_Str");
  bi.setSubmissionJustification(emilyEditRowID,subs[2].justification.getValue());
  bi.setSubmissionComments(emilyEditRowID,subs[2].p2pFeedback.getValue());
  bi.click(By.id("String_Node_Str"));
  String charlieEmail=scn.students.get("String_Node_Str").email;
  String dannyEmail=scn.students.get("String_Node_Str").email;
  String emilyEmail=scn.students.get("String_Node_Str").email;
  print("String_Node_Str");
  bi.checkCloseWindowAlertIfAny();
  bi.getSelenium().selectWindow("String_Node_Str");
  bi.waitForStatusMessage(String.format(Common.MESSAGE_COORD_EVALUATION_SUBMISSION_RECEIVED,scn.students.get("String_Node_Str").name,eval.name,eval.course).replace("String_Node_Str","String_Node_Str"));
  print("String_Node_Str");
  String json="String_Node_Str";
  json=BackDoor.getSubmissionAsJson(eval.course,eval.name,charlieEmail,charlieEmail);
  SubmissionData charlieModified=Common.getTeammatesGson().fromJson(json,SubmissionData.class);
  assertEquals(subs[0].points + "String_Node_Str",charlieModified.points + "String_Node_Str");
  assertEquals(subs[0].justification.getValue(),charlieModified.justification.getValue());
  assertEquals(subs[0].p2pFeedback.getValue(),charlieModified.p2pFeedback.getValue());
  json=BackDoor.getSubmissionAsJson(eval.course,eval.name,charlieEmail,dannyEmail);
  SubmissionData dannyModified=Common.getTeammatesGson().fromJson(json,SubmissionData.class);
  assertEquals(subs[1].points + "String_Node_Str",dannyModified.points + "String_Node_Str");
  assertEquals(subs[1].justification.getValue(),dannyModified.justification.getValue());
  assertEquals(subs[1].p2pFeedback.getValue(),dannyModified.p2pFeedback.getValue());
  json=BackDoor.getSubmissionAsJson(eval.course,eval.name,charlieEmail,emilyEmail);
  SubmissionData emilyModified=Common.getTeammatesGson().fromJson(json,SubmissionData.class);
  assertEquals(subs[2].points + "String_Node_Str",emilyModified.points + "String_Node_Str");
  assertEquals(subs[2].justification.getValue(),emilyModified.justification.getValue());
  assertEquals(subs[2].p2pFeedback.getValue(),emilyModified.p2pFeedback.getValue());
}

Fixed version (ground truth):
@Test public void testCoordEvalSubmissionViewAndEdit() throws Exception {
  EvaluationData eval=scn.evaluations.get("String_Node_Str");
  ______TS("String_Node_Str");
  String link=appUrl + Common.PAGE_COORD_EVAL_RESULTS;
  link=Common.addParamToUrl(link,Common.PARAM_COURSE_ID,eval.course);
  link=Common.addParamToUrl(link,Common.PARAM_EVALUATION_NAME,eval.name);
  link=Common.addParamToUrl(link,Common.PARAM_USER_ID,scn.coords.get("String_Node_Str").id);
  bi.goToUrl(link);
  int studentResultsRowID=bi.getStudentRowId(scn.students.get("String_Node_Str").name);
  bi.click(bi.getReviewerSummaryView(studentResultsRowID));
  String current=bi.getDriver().getWindowHandle();
  for (  String s : bi.getDriver().getWindowHandles()) {
    if (!current.equals(s)) {
      bi.getSelenium().selectWindow(s);
      break;
    }
  }
  bi.verifyCurrentPageHTML(Common.TEST_PAGES_FOLDER + "String_Node_Str");
  ______TS("String_Node_Str");
  link=appUrl + Common.PAGE_COORD_EVAL_SUBMISSION_VIEW;
  link=Common.addParamToUrl(link,Common.PARAM_COURSE_ID,eval.course);
  link=Common.addParamToUrl(link,Common.PARAM_EVALUATION_NAME,eval.name);
  link=Common.addParamToUrl(link,Common.PARAM_STUDENT_EMAIL,scn.students.get("String_Node_Str").email);
  link=Common.addParamToUrl(link,Common.PARAM_USER_ID,scn.coords.get("String_Node_Str").id);
  bi.goToUrl(link);
  bi.verifyCurrentPageHTML(Common.TEST_PAGES_FOLDER + "String_Node_Str");
  bi.click(By.id("String_Node_Str"));
  ______TS("String_Node_Str");
  bi.verifyCurrentPageHTML(Common.TEST_PAGES_FOLDER + "String_Node_Str");
  SubmissionData[] subs=new SubmissionData[3];
  subs[0]=scn.submissions.get("String_Node_Str");
  subs[1]=scn.submissions.get("String_Node_Str");
  subs[2]=scn.submissions.get("String_Node_Str");
  for (int i=0; i < 3; i++) {
    subs[i].points-=10;
    subs[i].justification=new Text(subs[i].justification.getValue() + "String_Node_Str");
    subs[i].p2pFeedback=new Text(subs[i].p2pFeedback.getValue() + "String_Node_Str");
  }
  int charlieEditRowID=bi.getStudentRowIdInEditSubmission(scn.students.get("String_Node_Str").name);
  bi.setSubmissionPoint(charlieEditRowID,subs[0].points + "String_Node_Str");
  bi.setSubmissionJustification(charlieEditRowID,subs[0].justification.getValue());
  bi.setSubmissionComments(charlieEditRowID,subs[0].p2pFeedback.getValue());
  int dannyEditRowID=bi.getStudentRowIdInEditSubmission(scn.students.get("String_Node_Str").name);
  bi.setSubmissionPoint(dannyEditRowID,subs[1].points + "String_Node_Str");
  bi.setSubmissionJustification(dannyEditRowID,subs[1].justification.getValue());
  bi.setSubmissionComments(dannyEditRowID,subs[1].p2pFeedback.getValue());
  int emilyEditRowID=bi.getStudentRowIdInEditSubmission(scn.students.get("String_Node_Str").name);
  bi.setSubmissionPoint(emilyEditRowID,subs[2].points + "String_Node_Str");
  bi.setSubmissionJustification(emilyEditRowID,subs[2].justification.getValue());
  bi.setSubmissionComments(emilyEditRowID,subs[2].p2pFeedback.getValue());
  bi.click(By.id("String_Node_Str"));
  String charlieEmail=scn.students.get("String_Node_Str").email;
  String dannyEmail=scn.students.get("String_Node_Str").email;
  String emilyEmail=scn.students.get("String_Node_Str").email;
  print("String_Node_Str");
  bi.dismissCloseWindowAlertIfAny();
  bi.getSelenium().selectWindow("String_Node_Str");
  bi.waitForStatusMessage(String.format(Common.MESSAGE_COORD_EVALUATION_SUBMISSION_RECEIVED,scn.students.get("String_Node_Str").name,eval.name,eval.course).replace("String_Node_Str","String_Node_Str"));
  print("String_Node_Str");
  String json="String_Node_Str";
  json=BackDoor.getSubmissionAsJson(eval.course,eval.name,charlieEmail,charlieEmail);
  SubmissionData charlieModified=Common.getTeammatesGson().fromJson(json,SubmissionData.class);
  assertEquals(subs[0].points + "String_Node_Str",charlieModified.points + "String_Node_Str");
  assertEquals(subs[0].justification.getValue(),charlieModified.justification.getValue());
  assertEquals(subs[0].p2pFeedback.getValue(),charlieModified.p2pFeedback.getValue());
  json=BackDoor.getSubmissionAsJson(eval.course,eval.name,charlieEmail,dannyEmail);
  SubmissionData dannyModified=Common.getTeammatesGson().fromJson(json,SubmissionData.class);
  assertEquals(subs[1].points + "String_Node_Str",dannyModified.points + "String_Node_Str");
  assertEquals(subs[1].justification.getValue(),dannyModified.justification.getValue());
  assertEquals(subs[1].p2pFeedback.getValue(),dannyModified.p2pFeedback.getValue());
  json=BackDoor.getSubmissionAsJson(eval.course,eval.name,charlieEmail,emilyEmail);
  SubmissionData emilyModified=Common.getTeammatesGson().fromJson(json,SubmissionData.class);
  assertEquals(subs[2].points + "String_Node_Str",emilyModified.points + "String_Node_Str");
  assertEquals(subs[2].justification.getValue(),emilyModified.justification.getValue());
  assertEquals(subs[2].p2pFeedback.getValue(),emilyModified.p2pFeedback.getValue());
}