Detailed information about defect clone:
06-C0.H0.M0.L1_T_S_05.war
Nickname of the defect
swaped-columns-in-table
Brief desctiption
Swaped columns Subjects and Teacher(s) in My Subjects.
How to activate the defect
-
Click on Login in the header
-
Username
pedant
, password pass
, click on Login button
-
Click on My Subjects
Visibility of the defect
Expected |
Actual |
|
|
Parts
StudentService |
TeacherService |
DateUtility |
GradeDAO |
UserDAO |
BaseStudentService
|
E05TeacherService
|
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/E05TeacherService.java
Source code with the injected defect
/**
* DELIBERATE ERROR
*
* This error method swaps name column with teacher column
*
* @return Indication for swap of columns
*/
@Override
@ErrorMethod(errorMessage = "This method swaps name column with teacher column.")
public boolean swapNameAndTeacher() {
log.error(propertyLoader.getProperty("log.E05TeacherService.swapNameAndTeacher"));
return true;
}
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 indicates whether to
* swap name column with teacher column
*
* @return Indication for swap of columns
*/
@Override
public boolean swapNameAndTeacher() {
return false;
}
Logged information up to failure
2019-10-12 13:42:12.375 -- INFO LogHelper:31 - HHH000204: Processing PersistenceUnitInfo [name: cz.zcu.kiv.matyasj.dp]
2019-10-12 13:42:12.609 -- INFO Version:46 - HHH000412: Hibernate Core {5.4.1.Final}
2019-10-12 13:42:13.031 -- INFO Version:49 - HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2019-10-12 13:42:13.453 -- INFO C3P0ConnectionProvider:116 - HHH010002: C3P0 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/uis-web-db
2019-10-12 13:42:13.453 -- INFO C3P0ConnectionProvider:117 - HHH10001001: Connection properties: {password=****, useUnicode=true, handling_mode=DELAYED_ACQUISITION_AND_HOLD, characterEncoding=UTF-8, user=uis-web}
2019-10-12 13:42:13.453 -- INFO C3P0ConnectionProvider:120 - HHH10001003: Autocommit mode: false
2019-10-12 13:42:13.672 -- INFO C3P0ConnectionProvider:200 - HHH10001007: JDBC isolation level:
2019-10-12 13:42:14.062 -- INFO Dialect:158 - HHH000400: Using dialect: org.hibernate.dialect.MySQL55Dialect
2019-10-12 13:42:15.829 -- INFO access:47 - HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess@209c0be5] 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-12 13:42:18.188 -- INFO access:47 - HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess@6e5e36ab] 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-12 13:42:29.535 -- INFO JtaPlatformInitiator:52 - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2019-10-12 13:42:29.769 -- INFO SecurityConfig:75 - SECURITY JDBC authentication process is running
2019-10-12 13:42:32.081 -- INFO SecurityConfig:93 - Authorization configuration process is running
2019-10-12 13:42:32.409 -- INFO BaseInitializer:97 - Initializing ...
2019-10-12 13:42:39.863 -- INFO BaseInitializer:463 - Initialized!
2019-10-12 13:42:40.004 -- INFO BaseInitializer:97 - Initializing ...
2019-10-12 13:45:12.076 -- INFO LoginController:30 - Request for login view
2019-10-12 13:45:20.516 -- INFO UserDaoCriteria:74 - User with username pedant found.
2019-10-12 13:45:20.563 -- INFO SecurityConfig:121 - Success login - pedant
2019-10-12 13:45:20.563 -- INFO SecurityConfig:125 - User login role: ROLE_TEACHER
2019-10-12 13:45:20.578 -- INFO UserDaoCriteria:74 - User with username pedant found.
2019-10-12 13:45:20.610 -- INFO OverviewController:53 - Request for overview of teacher with id 30 for view.
2019-10-12 13:45:23.188 -- INFO ListOfTaughtSubjectController:45 - Request for retrieving list of taught subjects for view.
2019-10-12 13:45:23.188 -- INFO UserDaoCriteria:74 - User with username pedant found.
2019-10-12 13:45:23.203 -- INFO BaseTeacherService:92 - Getting list of taught subjects for teacher with id 30.
2019-10-12 13:45:23.219 -- ERROR E05TeacherService:51 - INJECTED_ERROR: E05TeacherService_swapNameAndTeacher_swaps_name_column_with_teacher_column
Overview of functional tests full log
Overview of acceptance tests full report