Beispiel #1
0
  private void debug(List tasks) {
    logger.info("tasks size:", tasks.size());
    for (Iterator iterator = tasks.iterator(); iterator.hasNext(); ) {
      // Object[] object = (Object[]) iterator.next();
      Object object = (Object) iterator.next();
      // System.out.println(object.getClass().getSimpleName());
      // Task task = (Task) object[0];
      Task task = (Task) object;
      // System.out.println(object[1].getClass().getSimpleName());
      // Long sum = (Long) object[1];

      // System.out.println(object.getClass().getSimpleName());
      if (task != null) {
        User user = task.getUser();
        if (user != null) logger.info("createdBy to : " + user.getDisplayname());
        logger.info(
            "createdBy:"
                + user
                + " Days: "
                + task.getTimeInDays()
                + " Primary Key"
                + task.getPkey()
                + "content"
                + task.getContent()
                + "status:"
                + task.getStatus());
      }

      // System.out.println("Sum:" + sum);
      // System.out.println("Status" + (TaskStatus) object[3]);
    }
  }
Beispiel #2
0
  @Test
  public void testStatusUpdate() {
    int taskId = 1;
    // status update
    String status = "IN_PROGRESS";
    Task task = taskManager.readTask(taskId);
    task.setStatus(TaskStatus.valueOf(status));
    User createdBy = userServiceManager.readUser(1);
    task.setCreatedByUser(createdBy);
    taskManager.updateTask(task);

    Task updatedTask = taskManager.readTask(taskId);
    assertEquals(TaskStatus.IN_PROGRESS, updatedTask.getStatus());
  }