Program: 62892
Project: 62892
Buggy source:
@Test public void testEnrollStudents() throws Exception {
  String instructorId="String_Node_Str";
  String courseIdForEnrollTest="String_Node_Str";
  String instructorEmail="String_Node_Str";
  AccountAttributes accountToAdd=new AccountAttributes(instructorId,"String_Node_Str",true,instructorEmail,"String_Node_Str");
  accountsLogic.createAccount(accountToAdd);
  coursesLogic.createCourseAndInstructor(instructorId,courseIdForEnrollTest,"String_Node_Str");
  FeedbackSessionsLogic fsLogic=FeedbackSessionsLogic.inst();
  FeedbackSessionAttributes fsAttr=new FeedbackSessionAttributes("String_Node_Str",courseIdForEnrollTest,instructorEmail,new Text("String_Node_Str"),TimeHelper.getHoursOffsetToCurrentTime(0),TimeHelper.getHoursOffsetToCurrentTime(2),TimeHelper.getHoursOffsetToCurrentTime(5),TimeHelper.getHoursOffsetToCurrentTime(1),TimeHelper.getHoursOffsetToCurrentTime(6),8.0,0,FeedbackSessionType.PRIVATE,false,false,false,false,false);
  fsLogic.createFeedbackSession(fsAttr);
  String EOL=Const.EOL;
  String line0="String_Node_Str";
  String line1="String_Node_Str";
  String line2="String_Node_Str";
  String line3="String_Node_Str";
  String line4="String_Node_Str";
  String lines=line0 + EOL + line1+ EOL+ line2+ EOL+ "String_Node_Str"+ EOL+ line3+ EOL+ EOL+ line4+ EOL+ "String_Node_Str"+ EOL+ EOL;
  List<StudentAttributes> enrollResults=studentsLogic.enrollStudents(lines,courseIdForEnrollTest);
  StudentAttributesFactory saf=new StudentAttributesFactory();
  assertEquals(5,enrollResults.size());
  assertEquals(5,studentsLogic.getStudentsForCourse(courseIdForEnrollTest).size());
  TestHelper.verifyEnrollmentResultForStudent(saf.makeStudent(line0,courseIdForEnrollTest),enrollResults.get(0),StudentAttributes.UpdateStatus.NEW);
  TestHelper.verifyEnrollmentResultForStudent(saf.makeStudent(line1,courseIdForEnrollTest),enrollResults.get(1),StudentAttributes.UpdateStatus.NEW);
  TestHelper.verifyEnrollmentResultForStudent(saf.makeStudent(line4,courseIdForEnrollTest),enrollResults.get(4),StudentAttributes.UpdateStatus.NEW);
  CourseDetailsBundle cd=coursesLogic.getCourseDetails(courseIdForEnrollTest);
  assertEquals(5,cd.stats.unregisteredTotal);
  ______TS("String_Node_Str");
  String enrollLines="String_Node_Str";
  String invalidCourseId="String_Node_Str";
  try {
    studentsLogic.enrollStudents(enrollLines,invalidCourseId);
    signalFailureToDetectException();
  }
 catch (  EntityDoesNotExistException e) {
    ignoreExpectedException();
  }
  ______TS("String_Node_Str");
  try {
    studentsLogic.enrollStudents(enrollLines,courseIdForEnrollTest);
    signalFailureToDetectException();
  }
 catch (  EnrollException e) {
    ignoreExpectedException();
  }
  ______TS("String_Node_Str");
  enrollLines="String_Node_Str";
  try {
    studentsLogic.enrollStudents(enrollLines,courseIdForEnrollTest);
    signalFailureToDetectException();
  }
 catch (  EnrollException e) {
    ignoreExpectedException();
  }
  ______TS("String_Node_Str");
  String line0_1="String_Node_Str";
  String line5="String_Node_Str";
  lines=line0 + EOL + line0_1+ EOL+ line1+ EOL+ line5;
  enrollResults=studentsLogic.enrollStudents(lines,courseIdForEnrollTest);
  assertEquals(6,enrollResults.size());
  assertEquals(6,studentsLogic.getStudentsForCourse(courseIdForEnrollTest).size());
  TestHelper.verifyEnrollmentResultForStudent(saf.makeStudent(line0,courseIdForEnrollTest),enrollResults.get(0),StudentAttributes.UpdateStatus.UNMODIFIED);
  TestHelper.verifyEnrollmentResultForStudent(saf.makeStudent(line0_1,courseIdForEnrollTest),enrollResults.get(1),StudentAttributes.UpdateStatus.MODIFIED);
  TestHelper.verifyEnrollmentResultForStudent(saf.makeStudent(line1,courseIdForEnrollTest),enrollResults.get(2),StudentAttributes.UpdateStatus.UNMODIFIED);
  TestHelper.verifyEnrollmentResultForStudent(saf.makeStudent(line5,courseIdForEnrollTest),enrollResults.get(3),StudentAttributes.UpdateStatus.NEW);
  assertEquals(StudentAttributes.UpdateStatus.NOT_IN_ENROLL_LIST,enrollResults.get(4).updateStatus);
  assertEquals(StudentAttributes.UpdateStatus.NOT_IN_ENROLL_LIST,enrollResults.get(5).updateStatus);
  ______TS("String_Node_Str");
  String incorrectLine="String_Node_Str";
  lines="String_Node_Str" + EOL + incorrectLine+ EOL+ line2+ EOL+ line3;
  try {
    enrollResults=studentsLogic.enrollStudents(lines,courseIdForEnrollTest);
    signalFailureToDetectException("String_Node_Str");
  }
 catch (  EnrollException e) {
    assertTrue(e.getMessage().contains(incorrectLine));
  }
  assertEquals(6,studentsLogic.getStudentsForCourse(courseIdForEnrollTest).size());
  ______TS("String_Node_Str");
  try {
    studentsLogic.enrollStudents("String_Node_Str",null);
    signalFailureToDetectException();
  }
 catch (  AssertionError a) {
    assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT,a.getMessage());
  }
  ______TS("String_Node_Str");
  accountToAdd=new AccountAttributes("String_Node_Str","String_Node_Str",true,"String_Node_Str","String_Node_Str");
  accountsLogic.createAccount(accountToAdd);
  coursesLogic.createCourseAndInstructor("String_Node_Str","String_Node_Str","String_Node_Str");
  String line="String_Node_Str";
  enrollResults=studentsLogic.enrollStudents(line,"String_Node_Str");
  assertEquals(1,enrollResults.size());
  assertEquals(StudentAttributes.UpdateStatus.NEW,enrollResults.get(0).updateStatus);
  line="String_Node_Str";
  enrollResults=studentsLogic.enrollStudents(line,"String_Node_Str");
  assertEquals(1,enrollResults.size());
  assertEquals(StudentAttributes.UpdateStatus.MODIFIED,enrollResults.get(0).updateStatus);
  line="String_Node_Str";
  enrollResults=studentsLogic.enrollStudents(line,"String_Node_Str");
  assertEquals(1,enrollResults.size());
  assertEquals(StudentAttributes.UpdateStatus.UNMODIFIED,enrollResults.get(0).updateStatus);
  ______TS("String_Node_Str");
  String line_t9="String_Node_Str";
  String line_t10="String_Node_Str";
  try {
    studentsLogic.enrollStudents(line_t9 + EOL + line_t10,"String_Node_Str");
  }
 catch (  EnrollException e) {
    assertTrue(e.getMessage().contains(line_t10));
    assertTrue(e.getMessage().contains("String_Node_Str" + line_t9 + "String_Node_Str"));
  }
}

Fixed version (ground truth):
@Test public void testEnrollStudents() throws Exception {
  String instructorId="String_Node_Str";
  String courseIdForEnrollTest="String_Node_Str";
  String instructorEmail="String_Node_Str";
  String EOL=Const.EOL;
  AccountAttributes accountToAdd=new AccountAttributes(instructorId,"String_Node_Str",true,instructorEmail,"String_Node_Str");
  accountsLogic.createAccount(accountToAdd);
  coursesLogic.createCourseAndInstructor(instructorId,courseIdForEnrollTest,"String_Node_Str");
  FeedbackSessionsLogic fsLogic=FeedbackSessionsLogic.inst();
  FeedbackSessionAttributes fsAttr=new FeedbackSessionAttributes("String_Node_Str",courseIdForEnrollTest,instructorEmail,new Text("String_Node_Str"),TimeHelper.getHoursOffsetToCurrentTime(0),TimeHelper.getHoursOffsetToCurrentTime(2),TimeHelper.getHoursOffsetToCurrentTime(5),TimeHelper.getHoursOffsetToCurrentTime(1),TimeHelper.getHoursOffsetToCurrentTime(6),8.0,0,FeedbackSessionType.PRIVATE,false,false,false,false,false);
  fsLogic.createFeedbackSession(fsAttr);
  ______TS("String_Node_Str");
  String line0="String_Node_Str";
  String line1="String_Node_Str";
  String line2="String_Node_Str";
  String line3="String_Node_Str";
  String line4="String_Node_Str";
  String lines=line0 + EOL + line1+ EOL+ line2+ EOL+ "String_Node_Str"+ EOL+ line3+ EOL+ EOL+ line4+ EOL+ "String_Node_Str"+ EOL+ EOL;
  List<StudentAttributes> enrollResults=studentsLogic.enrollStudents(lines,courseIdForEnrollTest);
  StudentAttributesFactory saf=new StudentAttributesFactory();
  assertEquals(5,enrollResults.size());
  assertEquals(5,studentsLogic.getStudentsForCourse(courseIdForEnrollTest).size());
  TestHelper.verifyEnrollmentResultForStudent(saf.makeStudent(line0,courseIdForEnrollTest),enrollResults.get(0),StudentAttributes.UpdateStatus.NEW);
  TestHelper.verifyEnrollmentResultForStudent(saf.makeStudent(line1,courseIdForEnrollTest),enrollResults.get(1),StudentAttributes.UpdateStatus.NEW);
  TestHelper.verifyEnrollmentResultForStudent(saf.makeStudent(line4,courseIdForEnrollTest),enrollResults.get(4),StudentAttributes.UpdateStatus.NEW);
  CourseDetailsBundle cd=coursesLogic.getCourseDetails(courseIdForEnrollTest);
  assertEquals(5,cd.stats.unregisteredTotal);
  ______TS("String_Node_Str");
  String line0_1="String_Node_Str";
  String line5="String_Node_Str";
  lines=line0 + EOL + line0_1+ EOL+ line1+ EOL+ line5;
  enrollResults=studentsLogic.enrollStudents(lines,courseIdForEnrollTest);
  assertEquals(6,enrollResults.size());
  assertEquals(6,studentsLogic.getStudentsForCourse(courseIdForEnrollTest).size());
  TestHelper.verifyEnrollmentResultForStudent(saf.makeStudent(line0,courseIdForEnrollTest),enrollResults.get(0),StudentAttributes.UpdateStatus.UNMODIFIED);
  TestHelper.verifyEnrollmentResultForStudent(saf.makeStudent(line0_1,courseIdForEnrollTest),enrollResults.get(1),StudentAttributes.UpdateStatus.MODIFIED);
  TestHelper.verifyEnrollmentResultForStudent(saf.makeStudent(line1,courseIdForEnrollTest),enrollResults.get(2),StudentAttributes.UpdateStatus.UNMODIFIED);
  TestHelper.verifyEnrollmentResultForStudent(saf.makeStudent(line5,courseIdForEnrollTest),enrollResults.get(3),StudentAttributes.UpdateStatus.NEW);
  assertEquals(StudentAttributes.UpdateStatus.NOT_IN_ENROLL_LIST,enrollResults.get(4).updateStatus);
  assertEquals(StudentAttributes.UpdateStatus.NOT_IN_ENROLL_LIST,enrollResults.get(5).updateStatus);
  ______TS("String_Node_Str");
  String incorrectLine="String_Node_Str";
  lines="String_Node_Str" + EOL + incorrectLine+ EOL+ line2+ EOL+ line3;
  try {
    enrollResults=studentsLogic.enrollStudents(lines,courseIdForEnrollTest);
    signalFailureToDetectException("String_Node_Str");
  }
 catch (  EnrollException e) {
    assertTrue(e.getMessage().contains(incorrectLine));
  }
  assertEquals(6,studentsLogic.getStudentsForCourse(courseIdForEnrollTest).size());
  ______TS("String_Node_Str");
  try {
    studentsLogic.enrollStudents("String_Node_Str",null);
    signalFailureToDetectException();
  }
 catch (  AssertionError a) {
    assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT,a.getMessage());
  }
  ______TS("String_Node_Str");
  accountToAdd=new AccountAttributes("String_Node_Str","String_Node_Str",true,"String_Node_Str","String_Node_Str");
  accountsLogic.createAccount(accountToAdd);
  coursesLogic.createCourseAndInstructor("String_Node_Str","String_Node_Str","String_Node_Str");
  String line="String_Node_Str";
  enrollResults=studentsLogic.enrollStudents(line,"String_Node_Str");
  assertEquals(1,enrollResults.size());
  assertEquals(StudentAttributes.UpdateStatus.NEW,enrollResults.get(0).updateStatus);
  line="String_Node_Str";
  enrollResults=studentsLogic.enrollStudents(line,"String_Node_Str");
  assertEquals(1,enrollResults.size());
  assertEquals(StudentAttributes.UpdateStatus.MODIFIED,enrollResults.get(0).updateStatus);
  line="String_Node_Str";
  enrollResults=studentsLogic.enrollStudents(line,"String_Node_Str");
  assertEquals(1,enrollResults.size());
  assertEquals(StudentAttributes.UpdateStatus.UNMODIFIED,enrollResults.get(0).updateStatus);
  ______TS("String_Node_Str");
  String line_t9="String_Node_Str";
  String line_t10="String_Node_Str";
  try {
    studentsLogic.enrollStudents(line_t9 + EOL + line_t10,"String_Node_Str");
  }
 catch (  EnrollException e) {
    assertTrue(e.getMessage().contains(line_t10));
    assertTrue(e.getMessage().contains("String_Node_Str" + line_t9 + "String_Node_Str"));
  }
  ______TS("String_Node_Str");
  String enrollLines="String_Node_Str";
  String invalidCourseId="String_Node_Str";
  try {
    studentsLogic.enrollStudents(enrollLines,invalidCourseId);
    signalFailureToDetectException();
  }
 catch (  EntityDoesNotExistException e) {
    ignoreExpectedException();
  }
  ______TS("String_Node_Str");
  try {
    studentsLogic.enrollStudents(enrollLines,courseIdForEnrollTest);
    signalFailureToDetectException();
  }
 catch (  EnrollException e) {
    ignoreExpectedException();
  }
  ______TS("String_Node_Str");
  enrollLines="String_Node_Str";
  try {
    studentsLogic.enrollStudents(enrollLines,courseIdForEnrollTest);
    signalFailureToDetectException();
  }
 catch (  EnrollException e) {
    ignoreExpectedException();
  }
}