示例#1
0
  /** Tests that the date can never be null. */
  public void testDate() {
    assertNotNull(comment.getDate());

    comment.setDate(new Date());
    assertNotNull(comment.getDate());

    comment.setDate(null);
    assertNotNull(comment.getDate());
  }
示例#2
0
 public Comment addComment(String message, Account currAccount, Task task) {
   Hibernate.initialize(task.getComments());
   Comment comment = new Comment();
   comment.setTask(task);
   comment.setAuthor(currAccount);
   comment.setDate(new Date());
   comment.setMessage(message);
   wlSrv.addActivityLog(task, message, LogType.COMMENT);
   return save(comment);
 }