@Override public EmployeeDO getById(Serializable id) throws AccessException { return employeeDao.getById(id); }
@Test public void testMarkAsDeleted() { //Get initial infos log.info("Count employees: " + employeeList.size()); assertTrue(employeeList.size() > 0); EmployeeDO e = employeeList.get(0); log.info("Employee: " + e.toString()); //Mark as deleted employeeDao.markAsDeleted(e); //Check updates EmployeeDO updatdEmployee = employeeDao.getById(e.getId()); assertTrue(updatdEmployee.isDeleted()); employeeDao.update(e); }
@Test public void testBirthday() { //Get initial infos log.info("Count employees: " + employeeList.size()); assertTrue(employeeList.size() > 0); EmployeeDO e = employeeList.get(0); log.info("Employee: " + e.toString()); List<DisplayHistoryEntry> historyEntries = employeeDao.getDisplayHistoryEntries(e); log.info("Employee history entry size: " + historyEntries.size()); //Update employee Calendar birthday = new GregorianCalendar(1985, Calendar.DECEMBER, 17); e.setBirthday(birthday.getTime()); employeeDao.update(e); //Check updates EmployeeDO updatdEmployee = employeeDao.getById(e.getId()); assertEquals(updatdEmployee.getBirthday().getTime(), e.getBirthday().getTime()); // test history List<DisplayHistoryEntry> updatedHistoryEntries = employeeDao.getDisplayHistoryEntries(e); assertEquals(updatedHistoryEntries.size(), historyEntries.size() + 1); //Remove data and check e.setBirthday(null); employeeDao.update(e); //Check updates EmployeeDO updatdEmployeeRemove = employeeDao.getById(e.getId()); assertNull(updatdEmployeeRemove.getBirthday()); // test history List<DisplayHistoryEntry> updatedHistoryRemoveEntries = employeeDao.getDisplayHistoryEntries(e); assertEquals(updatedHistoryRemoveEntries.size(), historyEntries.size() + 2); }
employeeDao.save(e); EmployeeDO luser = employeeDao.getById(e.getId()); final String comment = luser.getComment(); Assert.assertTrue(luser.getTimeableAttributes().isEmpty() == false); row.putAttribute("hollydays", 43); employeeDao.update(luser); luser = employeeDao.getById(e.getId()); row = luser.getTimeableAttributes().get(0); rhol = row.getAttribute("hollydays", Integer.class);