Beispiel #1
0
  @Test
  public void findLatestStarted() {
    PropagationTask task = taskDAO.find(1L);
    assertNotNull(task);

    TaskExec latestStarted = taskExecDAO.findLatestStarted(task);
    assertNotNull(latestStarted);
    assertEquals(Long.valueOf(1L), latestStarted.getKey());
  }
Beispiel #2
0
  @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());
  }