Detailed information about defect clone:

12-C0.H0.M1.L0_T_S_08.war

 

Nickname of the defect

wrong-functionality-of-checkbox

Brief desctiption

Graded students are not displayed in Evaluation Table.

How to activate the defect

 

Visibility of the defect

Expected Actual

Parts

StudentService TeacherService DateUtility GradeDAO UserDAO
BaseStudentService E08TeacherService BaseDateUtility GradeTypeDaoCriteria UserDaoCriteria

URL to the defect source code

https://gitlab.kiv.zcu.cz/herout/TbUIS-UIS/blob/master/src/main/java/cz/zcu/kiv/matyasj/dp/service/users/error/E08TeacherService.java

Source code with the injected defect

/** * DELIBERATE ERROR * * This error method returns exam terms with not evaluated participants instead of all participants. * * @param teacher For this teacher will be list of exam terms returned. * @param subjectId Database id of subject * @return true if operation will be successfully completed, false otherwise */ @Override @ErrorMethod(errorMessage = "This method returns exam terms with not evaluated participants instead of all participants.") public List<ExaminationDate> getAllExaminationTermsByTeacherAndSubject(Teacher teacher, Long subjectId) { List<ExaminationDate> examinationDates = getMyExaminationDatesWithoutGraduateParticipants(teacher); if (examinationDates == null) { log.error("Getting all examination terms by teacher and subject failed."); return null; } log.info("Getting all examination terms by teacher and subject for teacher with id " + teacher.getId() + " and subject with id " + subjectId + "."); log.error(propertyLoader.getProperty("log.E08TeacherService.getAllExaminationTermsByTeacherAndSubject")); examinationDates.removeIf(e -> e.getSubject().getId().longValue() != subjectId.longValue()); return examinationDates; }

URL to the correct source code

https://gitlab.kiv.zcu.cz/herout/TbUIS-UIS/blob/master/src/main/java/cz/zcu/kiv/matyasj/dp/service/users/correct/BaseTeacherService.java

Correct source code

/** * This method returns list of all Examination terms created by specific teacher and for * specific subject. * * @param teacher For this teacher will be list of exam terms returned. * @param subjectId Database id of subject * @return List of Examination terms which are created by particular teacher */ @Override public List<ExaminationDate> getAllExaminationTermsByTeacherAndSubject(Teacher teacher, Long subjectId) { List<ExaminationDate> examinationDates = getExaminationTermsByTeacher(teacher); if (examinationDates == null) { log.error("Getting all examination terms by teacher and subject failed."); return null; } log.info("Getting all examination terms by teacher and subject for teacher with id " + teacher.getId() + " and subject with id " + subjectId + "."); examinationDates.removeIf(e -> e.getSubject().getId().longValue() != subjectId.longValue()); return examinationDates; }

Logged information up to failure

2019-10-14 11:45:18.136 -- INFO LogHelper:31 - HHH000204: Processing PersistenceUnitInfo [name: cz.zcu.kiv.matyasj.dp] 2019-10-14 11:45:18.371 -- INFO Version:46 - HHH000412: Hibernate Core {5.4.1.Final} 2019-10-14 11:45:18.824 -- INFO Version:49 - HCANN000001: Hibernate Commons Annotations {5.1.0.Final} 2019-10-14 11:45:19.278 -- INFO C3P0ConnectionProvider:116 - HHH010002: C3P0 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/uis-web-db 2019-10-14 11:45:19.278 -- INFO C3P0ConnectionProvider:117 - HHH10001001: Connection properties: {password=****, useUnicode=true, handling_mode=DELAYED_ACQUISITION_AND_HOLD, characterEncoding=UTF-8, user=uis-web} 2019-10-14 11:45:19.278 -- INFO C3P0ConnectionProvider:120 - HHH10001003: Autocommit mode: false 2019-10-14 11:45:19.481 -- INFO C3P0ConnectionProvider:200 - HHH10001007: JDBC isolation level: <unknown> 2019-10-14 11:45:19.859 -- INFO Dialect:158 - HHH000400: Using dialect: org.hibernate.dialect.MySQL55Dialect 2019-10-14 11:45:21.578 -- INFO access:47 - HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess@6d88a3f4] for (non-JTA) DDL execution was not in auto-commit mode; the Connection 'local transaction' will be committed and the Connection will be set into auto-commit mode. 2019-10-14 11:45:24.234 -- INFO access:47 - HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess@5aa345a5] for (non-JTA) DDL execution was not in auto-commit mode; the Connection 'local transaction' will be committed and the Connection will be set into auto-commit mode. 2019-10-14 11:45:36.582 -- INFO JtaPlatformInitiator:52 - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 2019-10-14 11:45:36.816 -- INFO SecurityConfig:75 - SECURITY JDBC authentication process is running 2019-10-14 11:45:39.144 -- INFO SecurityConfig:93 - Authorization configuration process is running 2019-10-14 11:45:39.472 -- INFO BaseInitializer:97 - Initializing ... 2019-10-14 11:45:46.303 -- INFO BaseInitializer:463 - Initialized! 2019-10-14 11:45:46.412 -- INFO BaseInitializer:97 - Initializing ... 2019-10-14 11:49:13.888 -- INFO LoginController:30 - Request for login view 2019-10-14 11:49:20.693 -- INFO UserDaoCriteria:74 - User with username keen found. 2019-10-14 11:49:20.740 -- INFO SecurityConfig:121 - Success login - keen 2019-10-14 11:49:20.740 -- INFO SecurityConfig:125 - User login role: ROLE_TEACHER 2019-10-14 11:49:20.771 -- INFO UserDaoCriteria:74 - User with username keen found. 2019-10-14 11:49:20.787 -- INFO OverviewController:53 - Request for overview of teacher with id 28 for view. 2019-10-14 11:49:22.865 -- INFO EvaluationTableController:57 - Request for retrieving evaluation table view. 2019-10-14 11:49:22.865 -- INFO UserDaoCriteria:74 - User with username keen found. 2019-10-14 11:49:22.911 -- INFO BaseTeacherService:92 - Getting list of taught subjects for teacher with id 28. 2019-10-14 11:49:22.943 -- INFO BaseTeacherService:669 - Getting all grade types. 2019-10-14 11:49:22.943 -- INFO GradeTypeDaoCriteria:58 - Returning list of 6 grade types. 2019-10-14 11:49:22.943 -- INFO UserDaoCriteria:74 - User with username keen found. 2019-10-14 11:49:22.958 -- INFO BaseTeacherService:294 - Getting all examination terms without graduate participants for teacher with id 28. 2019-10-14 11:49:23.005 -- INFO ExaminationDateDaoCriteria:118 - Returning list of 4 examination dates for teacher with id 28. 2019-10-14 11:49:23.021 -- WARN GradeDaoCriteria:137 - Grade for student Mia Orange and for subject Fundamentals of Computer Networks and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:23.021 -- WARN GradeDaoCriteria:137 - Grade for student Charlotte Purple and for subject Fundamentals of Computer Networks and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:23.021 -- WARN GradeDaoCriteria:137 - Grade for student Ethan Cyan and for subject Introduction to Algorithms and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:23.036 -- WARN GradeDaoCriteria:137 - Grade for student Emma Pink and for subject Introduction to Algorithms and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:23.036 -- WARN GradeDaoCriteria:137 - Grade for student Mia Orange and for subject Introduction to Algorithms and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:23.036 -- WARN GradeDaoCriteria:137 - Grade for student Emma Pink and for subject Mobile Applications and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:23.036 -- WARN GradeDaoCriteria:137 - Grade for student Benjamin Green and for subject Web Programming and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:23.036 -- WARN GradeDaoCriteria:137 - Grade for student Michael Gray and for subject Web Programming and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:23.052 -- WARN GradeDaoCriteria:137 - Grade for student Ethan Cyan and for subject Web Programming and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:23.052 -- WARN GradeDaoCriteria:137 - Grade for student Mia Orange and for subject Web Programming and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:23.052 -- INFO BaseTeacherService:364 - Getting all examination terms without graded participants for subject with id -1 and teacher with id 28. 2019-10-14 11:49:23.052 -- INFO BaseTeacherService:705 - Getting all grades for subject with failed. 2019-10-14 11:49:28.148 -- INFO EvaluationTableController:57 - Request for retrieving evaluation table view. 2019-10-14 11:49:28.148 -- INFO UserDaoCriteria:74 - User with username keen found. 2019-10-14 11:49:28.180 -- INFO BaseTeacherService:92 - Getting list of taught subjects for teacher with id 28. 2019-10-14 11:49:28.195 -- INFO BaseTeacherService:669 - Getting all grade types. 2019-10-14 11:49:28.195 -- INFO GradeTypeDaoCriteria:58 - Returning list of 6 grade types. 2019-10-14 11:49:28.195 -- INFO UserDaoCriteria:74 - User with username keen found. 2019-10-14 11:49:28.211 -- INFO BaseTeacherService:294 - Getting all examination terms without graduate participants for teacher with id 28. 2019-10-14 11:49:28.242 -- INFO ExaminationDateDaoCriteria:118 - Returning list of 4 examination dates for teacher with id 28. 2019-10-14 11:49:28.242 -- WARN GradeDaoCriteria:137 - Grade for student Mia Orange and for subject Fundamentals of Computer Networks and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:28.258 -- WARN GradeDaoCriteria:137 - Grade for student Charlotte Purple and for subject Fundamentals of Computer Networks and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:28.258 -- WARN GradeDaoCriteria:137 - Grade for student Ethan Cyan and for subject Introduction to Algorithms and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:28.258 -- WARN GradeDaoCriteria:137 - Grade for student Emma Pink and for subject Introduction to Algorithms and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:28.258 -- WARN GradeDaoCriteria:137 - Grade for student Mia Orange and for subject Introduction to Algorithms and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:28.258 -- WARN GradeDaoCriteria:137 - Grade for student Emma Pink and for subject Mobile Applications and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:28.258 -- WARN GradeDaoCriteria:137 - Grade for student Benjamin Green and for subject Web Programming and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:28.258 -- WARN GradeDaoCriteria:137 - Grade for student Michael Gray and for subject Web Programming and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:28.258 -- WARN GradeDaoCriteria:137 - Grade for student Ethan Cyan and for subject Web Programming and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:28.273 -- WARN GradeDaoCriteria:137 - Grade for student Mia Orange and for subject Web Programming and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:49:28.273 -- INFO E08TeacherService:66 - Getting all examination terms by teacher and subject for teacher with id 28 and subject with id 5. 2019-10-14 11:49:28.273 -- ERROR E08TeacherService:68 - INJECTED_ERROR: E08TeacherService_getAllExaminationTermsByTeacherAndSubject_returns_exam_terms_with_not_evaluated_participants_instead_of_all 2019-10-14 11:49:28.289 -- INFO BaseTeacherService:702 - Getting all grades for subject with id 5. 2019-10-14 11:49:28.289 -- INFO GradeDaoCriteria:75 - Returning list of 0 grades for subject with id 5. 2019-10-14 11:50:13.747 -- INFO UserDaoCriteria:74 - User with username keen found. 2019-10-14 11:50:13.762 -- INFO EvaluationTableController:115 - User with id 28 requested creating of grade. 2019-10-14 11:50:13.762 -- INFO BaseTeacherService:556 - Creating new grade for teacher with id 28, student with id 20, grade type with id 46 and examination term with id 37. 2019-10-14 11:50:13.825 -- WARN GradeDaoCriteria:137 - Grade for student Ethan Cyan and for subject Introduction to Algorithms and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:50:13.825 -- INFO GradeTypeDaoCriteria:58 - Returning list of 6 grade types. 2019-10-14 11:50:14.012 -- INFO BaseTeacherService:785 - Removing subject with id 5 from list of subjects. 2019-10-14 11:50:14.278 -- INFO EvaluationTableController:119 - Request for creating of grade type: 46 for subject with id: 5 for student with id: 20 was successful. 2019-10-14 11:50:14.278 -- INFO EvaluationTableController:57 - Request for retrieving evaluation table view. 2019-10-14 11:50:14.278 -- INFO UserDaoCriteria:74 - User with username keen found. 2019-10-14 11:50:14.340 -- INFO BaseTeacherService:92 - Getting list of taught subjects for teacher with id 28. 2019-10-14 11:50:14.356 -- INFO BaseTeacherService:669 - Getting all grade types. 2019-10-14 11:50:14.356 -- INFO GradeTypeDaoCriteria:58 - Returning list of 6 grade types. 2019-10-14 11:50:14.356 -- INFO UserDaoCriteria:74 - User with username keen found. 2019-10-14 11:50:14.371 -- INFO BaseTeacherService:294 - Getting all examination terms without graduate participants for teacher with id 28. 2019-10-14 11:50:14.418 -- INFO ExaminationDateDaoCriteria:118 - Returning list of 4 examination dates for teacher with id 28. 2019-10-14 11:50:14.418 -- WARN GradeDaoCriteria:137 - Grade for student Mia Orange and for subject Fundamentals of Computer Networks and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:50:14.418 -- WARN GradeDaoCriteria:137 - Grade for student Charlotte Purple and for subject Fundamentals of Computer Networks and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:50:14.434 -- INFO GradeDaoCriteria:134 - Returning grade with id 52 for subject with id 5 and student with id 20 2019-10-14 11:50:14.434 -- WARN GradeDaoCriteria:137 - Grade for student Emma Pink and for subject Introduction to Algorithms and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:50:14.434 -- WARN GradeDaoCriteria:137 - Grade for student Mia Orange and for subject Introduction to Algorithms and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:50:14.434 -- WARN GradeDaoCriteria:137 - Grade for student Emma Pink and for subject Mobile Applications and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:50:14.450 -- WARN GradeDaoCriteria:137 - Grade for student Benjamin Green and for subject Web Programming and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:50:14.450 -- WARN GradeDaoCriteria:137 - Grade for student Michael Gray and for subject Web Programming and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:50:14.450 -- WARN GradeDaoCriteria:137 - Grade for student Ethan Cyan and for subject Web Programming and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:50:14.450 -- WARN GradeDaoCriteria:137 - Grade for student Mia Orange and for subject Web Programming and for date 2019-10-15 11:45:43.0 not found. 2019-10-14 11:50:14.450 -- INFO E08TeacherService:66 - Getting all examination terms by teacher and subject for teacher with id 28 and subject with id 5. 2019-10-14 11:50:14.450 -- ERROR E08TeacherService:68 - INJECTED_ERROR: E08TeacherService_getAllExaminationTermsByTeacherAndSubject_returns_exam_terms_with_not_evaluated_participants_instead_of_all 2019-10-14 11:50:14.465 -- INFO BaseTeacherService:702 - Getting all grades for subject with id 5. 2019-10-14 11:50:14.481 -- INFO GradeDaoCriteria:75 - Returning list of 1 grades for subject with id 5.

Overview of functional tests full log

Overview of acceptance tests full report