Program: 63006
Project: 63006
Buggy source:
@Test public void testGetCourseDetailsListForStudent() throws Exception {
  ______TS("String_Node_Str");
  restoreTypicalDataInDatastore();
  String methodName="String_Node_Str";
  Class<?>[] paramTypes=new Class<?>[]{String.class};
  Object[] params=new Object[]{"String_Node_Str"};
  verifyCannotAccess(USER_TYPE_NOT_LOGGED_IN,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_UNREGISTERED,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_STUDENT,methodName,"String_Node_Str",paramTypes,params);
  verifyCanAccess(USER_TYPE_STUDENT,methodName,"String_Node_Str",paramTypes,params);
  ______TS("String_Node_Str");
  restoreTypicalDataInDatastore();
  loginAsAdmin("String_Node_Str");
  CourseData expectedCourse1=dataBundle.courses.get("String_Node_Str");
  EvaluationData expectedEval1InCourse1=dataBundle.evaluations.get("String_Node_Str");
  EvaluationData expectedEval2InCourse1=dataBundle.evaluations.get("String_Node_Str");
  CourseData expectedCourse2=dataBundle.courses.get("String_Node_Str");
  EvaluationData expectedEval1InCourse2=dataBundle.evaluations.get("String_Node_Str");
  StudentData studentInTwoCourses=dataBundle.students.get("String_Node_Str");
  expectedEval1InCourse1.startTime=Common.getDateOffsetToCurrentTime(-2);
  expectedEval1InCourse1.endTime=Common.getDateOffsetToCurrentTime(-1);
  expectedEval1InCourse1.published=false;
  assertEquals(EvalStatus.CLOSED,expectedEval1InCourse1.getStatus());
  logic.editEvaluation(expectedEval1InCourse1);
  expectedEval2InCourse1.startTime=Common.getDateOffsetToCurrentTime(-1);
  expectedEval2InCourse1.endTime=Common.getDateOffsetToCurrentTime(1);
  assertEquals(EvalStatus.OPEN,expectedEval2InCourse1.getStatus());
  logic.editEvaluation(expectedEval2InCourse1);
  expectedEval1InCourse2.startTime=Common.getDateOffsetToCurrentTime(1);
  expectedEval1InCourse2.endTime=Common.getDateOffsetToCurrentTime(2);
  expectedEval1InCourse2.activated=false;
  assertEquals(EvalStatus.AWAITING,expectedEval1InCourse2.getStatus());
  logic.editEvaluation(expectedEval1InCourse2);
  List<CourseData> courseList=logic.getCourseDetailsListForStudent(studentInTwoCourses.id);
  assertEquals(2,courseList.size());
  CourseData actualCourse1=courseList.get(1);
  assertEquals(expectedCourse1.id,actualCourse1.id);
  assertEquals(expectedCourse1.name,actualCourse1.name);
  assertEquals(2,actualCourse1.evaluations.size());
  EvaluationData actualEval1InCourse1=actualCourse1.evaluations.get(1);
  verifySameEvaluationData(expectedEval1InCourse1,actualEval1InCourse1);
  EvaluationData actualEval2InCourse1=actualCourse1.evaluations.get(0);
  verifySameEvaluationData(expectedEval2InCourse1,actualEval2InCourse1);
  CourseData actualCourse2=courseList.get(0);
  assertEquals(expectedCourse2.id,actualCourse2.id);
  assertEquals(expectedCourse2.name,actualCourse2.name);
  assertEquals(0,actualCourse2.evaluations.size());
  ______TS("String_Node_Str");
  StudentData studentWithNoEvaluations=dataBundle.students.get("String_Node_Str");
  courseList=logic.getCourseDetailsListForStudent(studentWithNoEvaluations.id);
  assertEquals(1,courseList.size());
  assertEquals(0,courseList.get(0).evaluations.size());
  ______TS("String_Node_Str");
  try {
    logic.getCourseDetailsListForStudent("String_Node_Str");
    fail();
  }
 catch (  EntityDoesNotExistException e) {
    BaseTestCase.assertContains("String_Node_Str",e.getMessage());
  }
  ______TS("String_Node_Str");
  try {
    logic.getCourseDetailsListForStudent(null);
    fail();
  }
 catch (  NullPointerException e) {
  }
}

Fixed version (ground truth):
@Test public void testGetCourseDetailsListForStudent() throws Exception {
  ______TS("String_Node_Str");
  restoreTypicalDataInDatastore();
  String methodName="String_Node_Str";
  Class<?>[] paramTypes=new Class<?>[]{String.class};
  Object[] params=new Object[]{"String_Node_Str"};
  verifyCannotAccess(USER_TYPE_NOT_LOGGED_IN,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_UNREGISTERED,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_STUDENT,methodName,"String_Node_Str",paramTypes,params);
  verifyCanAccess(USER_TYPE_STUDENT,methodName,"String_Node_Str",paramTypes,params);
  ______TS("String_Node_Str");
  restoreTypicalDataInDatastore();
  loginAsAdmin("String_Node_Str");
  CourseData expectedCourse1=dataBundle.courses.get("String_Node_Str");
  EvaluationData expectedEval1InCourse1=dataBundle.evaluations.get("String_Node_Str");
  EvaluationData expectedEval2InCourse1=dataBundle.evaluations.get("String_Node_Str");
  CourseData expectedCourse2=dataBundle.courses.get("String_Node_Str");
  EvaluationData expectedEval1InCourse2=dataBundle.evaluations.get("String_Node_Str");
  StudentData studentInTwoCourses=dataBundle.students.get("String_Node_Str");
  expectedEval1InCourse1.startTime=Common.getDateOffsetToCurrentTime(-2);
  expectedEval1InCourse1.endTime=Common.getDateOffsetToCurrentTime(-1);
  expectedEval1InCourse1.published=false;
  assertEquals(EvalStatus.CLOSED,expectedEval1InCourse1.getStatus());
  BackDoorLogic backDoorLogic=new BackDoorLogic();
  backDoorLogic.editEvaluation(expectedEval1InCourse1);
  expectedEval2InCourse1.startTime=Common.getDateOffsetToCurrentTime(-1);
  expectedEval2InCourse1.endTime=Common.getDateOffsetToCurrentTime(1);
  assertEquals(EvalStatus.OPEN,expectedEval2InCourse1.getStatus());
  backDoorLogic.editEvaluation(expectedEval2InCourse1);
  expectedEval1InCourse2.startTime=Common.getDateOffsetToCurrentTime(1);
  expectedEval1InCourse2.endTime=Common.getDateOffsetToCurrentTime(2);
  expectedEval1InCourse2.activated=false;
  assertEquals(EvalStatus.AWAITING,expectedEval1InCourse2.getStatus());
  backDoorLogic.editEvaluation(expectedEval1InCourse2);
  List<CourseData> courseList=logic.getCourseDetailsListForStudent(studentInTwoCourses.id);
  assertEquals(2,courseList.size());
  CourseData actualCourse1=courseList.get(1);
  assertEquals(expectedCourse1.id,actualCourse1.id);
  assertEquals(expectedCourse1.name,actualCourse1.name);
  assertEquals(2,actualCourse1.evaluations.size());
  EvaluationData actualEval1InCourse1=actualCourse1.evaluations.get(1);
  verifySameEvaluationData(expectedEval1InCourse1,actualEval1InCourse1);
  EvaluationData actualEval2InCourse1=actualCourse1.evaluations.get(0);
  verifySameEvaluationData(expectedEval2InCourse1,actualEval2InCourse1);
  CourseData actualCourse2=courseList.get(0);
  assertEquals(expectedCourse2.id,actualCourse2.id);
  assertEquals(expectedCourse2.name,actualCourse2.name);
  assertEquals(0,actualCourse2.evaluations.size());
  ______TS("String_Node_Str");
  StudentData studentWithNoEvaluations=dataBundle.students.get("String_Node_Str");
  courseList=logic.getCourseDetailsListForStudent(studentWithNoEvaluations.id);
  assertEquals(1,courseList.size());
  assertEquals(0,courseList.get(0).evaluations.size());
  ______TS("String_Node_Str");
  try {
    logic.getCourseDetailsListForStudent("String_Node_Str");
    fail();
  }
 catch (  EntityDoesNotExistException e) {
    BaseTestCase.assertContains("String_Node_Str",e.getMessage());
  }
  ______TS("String_Node_Str");
  try {
    logic.getCourseDetailsListForStudent(null);
    fail();
  }
 catch (  NullPointerException e) {
  }
}