@Test public void findAll() { List<TaskExec> list = taskExecDAO.findAll(TaskType.PROPAGATION); assertEquals(2, list.size()); list = taskExecDAO.findAll(TaskType.SCHEDULED); assertTrue(list.isEmpty()); list = taskExecDAO.findAll(TaskType.SYNCHRONIZATION); assertTrue(list.isEmpty()); list = taskExecDAO.findAll(TaskType.NOTIFICATION); assertTrue(list.isEmpty()); }
@Test public void findLatestStarted() { PropagationTask task = taskDAO.find(1L); assertNotNull(task); TaskExec latestStarted = taskExecDAO.findLatestStarted(task); assertNotNull(latestStarted); assertEquals(Long.valueOf(1L), latestStarted.getKey()); }
@Test public void issueSYNCOPE214() { PropagationTask task = taskDAO.find(1L); assertNotNull(task); String faultyMessage = "A faulty message"; faultyMessage = faultyMessage.replace('a', '\0'); TaskExec exec = entityFactory.newEntity(TaskExec.class); exec.setStartDate(new Date()); exec.setEndDate(new Date()); exec.setStatus(PropagationTaskExecStatus.SUCCESS.name()); exec.setMessage(faultyMessage); task.addExec(exec); exec.setTask(task); exec = taskExecDAO.save(exec); assertNotNull(exec); assertEquals(faultyMessage.replace('\0', '\n'), exec.getMessage()); }