コード例 #1
0
 /**
  * Sets up all of the comments about the classified used in the current test. The comment to use
  * in the invocation of the callback is also set.
  */
 protected void setUpClassifiedComments() {
   ForeignPK classifiedPk = new ForeignPK(String.valueOf(CLASSIFIED_ID), CLASSIFIED_INSTANCEID);
   for (int i = 0; i < 5; i++) {
     Date date = new Date();
     UserDetail commentAuthor = new UserDetail();
     commentAuthor.setId(String.valueOf(i));
     Comment aComment =
         new Comment(
             new CommentPK(String.valueOf(i), CLASSIFIED_INSTANCEID),
             COMMENT_RESOURCETYPE,
             classifiedPk,
             i,
             "Toto" + i,
             "comment " + i,
             date,
             date);
     aComment.setOwnerDetail(commentAuthor);
     classifiedComments.add(aComment);
   }
   Date date = new Date();
   UserDetail commentAuthor = new UserDetail();
   commentAuthor.setId(String.valueOf(COMMENT_AUTHORID));
   concernedComment =
       new Comment(
           new CommentPK("10", CLASSIFIED_INSTANCEID),
           COMMENT_RESOURCETYPE,
           classifiedPk,
           Integer.parseInt(COMMENT_AUTHORID),
           "Toto" + COMMENT_AUTHORID,
           "concerned comment",
           date,
           date);
   concernedComment.setOwnerDetail(commentAuthor);
   classifiedComments.add(concernedComment);
 }
コード例 #2
0
 protected static Classified aClassified() {
   UserDetail author = new UserDetail();
   author.setId("0");
   Classified classified =
       new Classified(CLASSIFIED_ID, CLASSIFIED_INSTANCEID)
           .createdBy(author)
           .entitled("a classified");
   return classified;
 }