Program: 62891
Project: 62891
Buggy source:
@Test public void testEnrollLinesChecking() throws Exception {
  String info;
  String enrollLines;
  String courseId="String_Node_Str";
  coursesLogic.createCourse(courseId,"String_Node_Str");
  List<String> invalidInfo;
  List<String> expectedInvalidInfo=new ArrayList<String>();
  ______TS("String_Node_Str");
  String invalidTeamName=StringHelper.generateStringOfLength(FieldValidator.TEAM_NAME_MAX_LENGTH + 1);
  String invalidStudentName=StringHelper.generateStringOfLength(FieldValidator.PERSON_NAME_MAX_LENGTH + 1);
  String lineWithInvalidTeamName=invalidTeamName + "String_Node_Str";
  String lineWithInvalidStudentName="String_Node_Str" + invalidStudentName + "String_Node_Str";
  String lineWithInvalidEmail="String_Node_Str" + "String_Node_Str";
  String lineWithInvalidStudentNameAndEmail="String_Node_Str" + invalidStudentName + "String_Node_Str"+ "String_Node_Str";
  String lineWithInvalidTeamNameAndEmail=invalidTeamName + "String_Node_Str" + "String_Node_Str";
  String lineWithInvalidTeamNameAndStudentNameAndEmail=invalidTeamName + "String_Node_Str" + invalidStudentName+ "String_Node_Str"+ "String_Node_Str";
  enrollLines=lineWithInvalidTeamName + Const.EOL + lineWithInvalidStudentName+ Const.EOL+ lineWithInvalidEmail+ Const.EOL+ lineWithInvalidStudentNameAndEmail+ Const.EOL+ lineWithInvalidTeamNameAndEmail+ Const.EOL+ lineWithInvalidTeamNameAndStudentNameAndEmail;
  invalidInfo=invokeGetInvalidityInfoInEnrollLines(enrollLines,courseId);
  StudentAttributesFactory saf=new StudentAttributesFactory();
  expectedInvalidInfo.clear();
  info=StringHelper.toString(saf.makeStudent(lineWithInvalidTeamName,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithInvalidTeamName,info));
  info=StringHelper.toString(saf.makeStudent(lineWithInvalidStudentName,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithInvalidStudentName,info));
  info=StringHelper.toString(saf.makeStudent(lineWithInvalidEmail,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithInvalidEmail,info));
  info=StringHelper.toString(saf.makeStudent(lineWithInvalidStudentNameAndEmail,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithInvalidStudentNameAndEmail,info));
  info=StringHelper.toString(saf.makeStudent(lineWithInvalidTeamNameAndEmail,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithInvalidTeamNameAndEmail,info));
  info=StringHelper.toString(saf.makeStudent(lineWithInvalidTeamNameAndStudentNameAndEmail,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithInvalidTeamNameAndStudentNameAndEmail,info));
  for (int i=0; i < invalidInfo.size(); i++) {
    assertEquals(expectedInvalidInfo.get(i),invalidInfo.get(i));
  }
  ______TS("String_Node_Str");
  String lineWithNoEmailInput="String_Node_Str";
  String lineWithExtraParameters="String_Node_Str" + "String_Node_Str";
  enrollLines=lineWithNoEmailInput + Const.EOL + lineWithExtraParameters;
  invalidInfo=invokeGetInvalidityInfoInEnrollLines(enrollLines,courseId);
  expectedInvalidInfo.clear();
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithNoEmailInput,StudentAttributesFactory.ERROR_ENROLL_LINE_TOOFEWPARTS));
  for (int i=0; i < invalidInfo.size(); i++) {
    assertEquals(expectedInvalidInfo.get(i),invalidInfo.get(i));
  }
  ______TS("String_Node_Str");
  String lineWithTeamNameEmpty="String_Node_Str";
  String lineWithStudentNameEmpty="String_Node_Str";
  String lineWithEmailEmpty="String_Node_Str";
  enrollLines=lineWithTeamNameEmpty + Const.EOL + lineWithStudentNameEmpty+ Const.EOL+ lineWithEmailEmpty;
  invalidInfo=invokeGetInvalidityInfoInEnrollLines(enrollLines,courseId);
  expectedInvalidInfo.clear();
  info=StringHelper.toString(saf.makeStudent(lineWithTeamNameEmpty,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithTeamNameEmpty,info));
  info=StringHelper.toString(saf.makeStudent(lineWithStudentNameEmpty,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithStudentNameEmpty,info));
  info=StringHelper.toString(saf.makeStudent(lineWithEmailEmpty,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithEmailEmpty,info));
  for (int i=0; i < invalidInfo.size(); i++) {
    assertEquals(expectedInvalidInfo.get(i),invalidInfo.get(i));
  }
  ______TS("String_Node_Str");
  String lineWithCorrectInput="String_Node_Str";
  String lineWithCorrectInputWithComment="String_Node_Str";
  enrollLines=lineWithCorrectInput + Const.EOL + lineWithCorrectInputWithComment;
  invalidInfo=invokeGetInvalidityInfoInEnrollLines(enrollLines,courseId);
  assertEquals(0,invalidInfo.size());
  ______TS("String_Node_Str");
  ______TS("String_Node_Str");
  enrollLines=lineWithInvalidTeamName + Const.EOL + lineWithInvalidTeamNameAndStudentNameAndEmail+ Const.EOL+ lineWithExtraParameters+ Const.EOL+ lineWithTeamNameEmpty+ Const.EOL+ lineWithCorrectInput+ Const.EOL+ "String_Node_Str";
  invalidInfo=invokeGetInvalidityInfoInEnrollLines(enrollLines,courseId);
  expectedInvalidInfo.clear();
  info=StringHelper.toString(saf.makeStudent(lineWithInvalidTeamName,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithInvalidTeamName,info));
  info=StringHelper.toString(saf.makeStudent(lineWithInvalidTeamNameAndStudentNameAndEmail,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithInvalidTeamNameAndStudentNameAndEmail,info));
  info=StringHelper.toString(saf.makeStudent(lineWithTeamNameEmpty,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithTeamNameEmpty,info));
  info=StringHelper.toString(saf.makeStudent(lineWithCorrectInput,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithCorrectInput,info));
  for (int i=0; i < invalidInfo.size(); i++) {
    assertEquals(expectedInvalidInfo.get(i),invalidInfo.get(i));
  }
}

Fixed version (ground truth):
@Test public void testEnrollLinesChecking() throws Exception {
  String info;
  String enrollLines;
  String courseId="String_Node_Str";
  coursesLogic.createCourse(courseId,"String_Node_Str");
  List<String> invalidInfo;
  List<String> expectedInvalidInfo=new ArrayList<String>();
  ______TS("String_Node_Str");
  String invalidTeamName=StringHelper.generateStringOfLength(FieldValidator.TEAM_NAME_MAX_LENGTH + 1);
  String invalidStudentName=StringHelper.generateStringOfLength(FieldValidator.PERSON_NAME_MAX_LENGTH + 1);
  String lineWithInvalidTeamName=invalidTeamName + "String_Node_Str";
  String lineWithInvalidStudentName="String_Node_Str" + invalidStudentName + "String_Node_Str";
  String lineWithInvalidEmail="String_Node_Str" + "String_Node_Str";
  String lineWithInvalidStudentNameAndEmail="String_Node_Str" + invalidStudentName + "String_Node_Str"+ "String_Node_Str";
  String lineWithInvalidTeamNameAndEmail=invalidTeamName + "String_Node_Str" + "String_Node_Str";
  String lineWithInvalidTeamNameAndStudentNameAndEmail=invalidTeamName + "String_Node_Str" + invalidStudentName+ "String_Node_Str"+ "String_Node_Str";
  enrollLines=lineWithInvalidTeamName + Const.EOL + lineWithInvalidStudentName+ Const.EOL+ lineWithInvalidEmail+ Const.EOL+ lineWithInvalidStudentNameAndEmail+ Const.EOL+ lineWithInvalidTeamNameAndEmail+ Const.EOL+ lineWithInvalidTeamNameAndStudentNameAndEmail;
  invalidInfo=invokeGetInvalidityInfoInEnrollLines(enrollLines,courseId);
  StudentAttributesFactory saf=new StudentAttributesFactory();
  expectedInvalidInfo.clear();
  info=StringHelper.toString(saf.makeStudent(lineWithInvalidTeamName,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithInvalidTeamName,info));
  info=StringHelper.toString(saf.makeStudent(lineWithInvalidStudentName,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithInvalidStudentName,info));
  info=StringHelper.toString(saf.makeStudent(lineWithInvalidEmail,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithInvalidEmail,info));
  info=StringHelper.toString(saf.makeStudent(lineWithInvalidStudentNameAndEmail,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithInvalidStudentNameAndEmail,info));
  info=StringHelper.toString(saf.makeStudent(lineWithInvalidTeamNameAndEmail,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithInvalidTeamNameAndEmail,info));
  info=StringHelper.toString(saf.makeStudent(lineWithInvalidTeamNameAndStudentNameAndEmail,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithInvalidTeamNameAndStudentNameAndEmail,info));
  for (int i=0; i < invalidInfo.size(); i++) {
    assertEquals(expectedInvalidInfo.get(i),invalidInfo.get(i));
  }
  ______TS("String_Node_Str");
  String lineWithNoEmailInput="String_Node_Str";
  String lineWithExtraParameters="String_Node_Str" + "String_Node_Str";
  enrollLines=lineWithNoEmailInput + Const.EOL + lineWithExtraParameters;
  invalidInfo=invokeGetInvalidityInfoInEnrollLines(enrollLines,courseId);
  expectedInvalidInfo.clear();
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithNoEmailInput,StudentAttributesFactory.ERROR_ENROLL_LINE_TOOFEWPARTS));
  for (int i=0; i < invalidInfo.size(); i++) {
    assertEquals(expectedInvalidInfo.get(i),invalidInfo.get(i));
  }
  ______TS("String_Node_Str");
  String lineWithTeamNameEmpty="String_Node_Str";
  String lineWithStudentNameEmpty="String_Node_Str";
  String lineWithEmailEmpty="String_Node_Str";
  enrollLines=lineWithTeamNameEmpty + Const.EOL + lineWithStudentNameEmpty+ Const.EOL+ lineWithEmailEmpty;
  invalidInfo=invokeGetInvalidityInfoInEnrollLines(enrollLines,courseId);
  expectedInvalidInfo.clear();
  info=StringHelper.toString(saf.makeStudent(lineWithTeamNameEmpty,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithTeamNameEmpty,info));
  info=StringHelper.toString(saf.makeStudent(lineWithStudentNameEmpty,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithStudentNameEmpty,info));
  info=StringHelper.toString(saf.makeStudent(lineWithEmailEmpty,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithEmailEmpty,info));
  for (int i=0; i < invalidInfo.size(); i++) {
    assertEquals(expectedInvalidInfo.get(i),invalidInfo.get(i));
  }
  ______TS("String_Node_Str");
  String lineWithCorrectInput="String_Node_Str";
  String lineWithCorrectInputWithComment="String_Node_Str";
  enrollLines=lineWithCorrectInput + Const.EOL + lineWithCorrectInputWithComment;
  invalidInfo=invokeGetInvalidityInfoInEnrollLines(enrollLines,courseId);
  assertEquals(0,invalidInfo.size());
  ______TS("String_Node_Str");
  ______TS("String_Node_Str");
  enrollLines=lineWithCorrectInput + Const.EOL + lineWithCorrectInput;
  invalidInfo=invokeGetInvalidityInfoInEnrollLines(enrollLines,courseId);
  assertEquals(1,invalidInfo.size());
  ______TS("String_Node_Str");
  enrollLines=lineWithInvalidTeamName + Const.EOL + lineWithInvalidTeamNameAndStudentNameAndEmail+ Const.EOL+ lineWithExtraParameters+ Const.EOL+ lineWithTeamNameEmpty+ Const.EOL+ lineWithCorrectInput+ Const.EOL+ "String_Node_Str";
  invalidInfo=invokeGetInvalidityInfoInEnrollLines(enrollLines,courseId);
  expectedInvalidInfo.clear();
  info=StringHelper.toString(saf.makeStudent(lineWithInvalidTeamName,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithInvalidTeamName,info));
  info=StringHelper.toString(saf.makeStudent(lineWithInvalidTeamNameAndStudentNameAndEmail,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithInvalidTeamNameAndStudentNameAndEmail,info));
  info=StringHelper.toString(saf.makeStudent(lineWithTeamNameEmpty,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithTeamNameEmpty,info));
  info=StringHelper.toString(saf.makeStudent(lineWithCorrectInput,courseId).getInvalidityInfo(),"String_Node_Str" + Const.StatusMessages.ENROLL_LINES_PROBLEM_DETAIL_PREFIX + "String_Node_Str");
  expectedInvalidInfo.add(String.format(Const.StatusMessages.ENROLL_LINES_PROBLEM,lineWithCorrectInput,info));
  for (int i=0; i < invalidInfo.size(); i++) {
    assertEquals(expectedInvalidInfo.get(i),invalidInfo.get(i));
  }
}