Search in sources :

Example 1 with CommentImpl

use of org.jbpm.services.task.impl.model.CommentImpl in project jbpm by kiegroup.

the class CollectionUtils method readCommentList.

public static List<Comment> readCommentList(ObjectInput in) throws IOException, ClassNotFoundException {
    int size = in.readInt();
    List<Comment> list = new ArrayList<Comment>(size);
    for (int i = 0; i < size; i++) {
        Comment item = new CommentImpl();
        item.readExternal(in);
        list.add(item);
    }
    return list;
}
Also used : Comment(org.kie.api.task.model.Comment) ArrayList(java.util.ArrayList) CommentImpl(org.jbpm.services.task.impl.model.CommentImpl)

Example 2 with CommentImpl

use of org.jbpm.services.task.impl.model.CommentImpl in project jbpm by kiegroup.

the class AbstractTaskSerializationTest method jaxbCommentTest.

@Test
public void jaxbCommentTest() throws Exception {
    Assume.assumeFalse(getType().equals(TestType.YAML));
    CommentImpl comment = new CommentImpl();
    comment.setAddedAt(new Date());
    comment.setAddedBy(new UserImpl("user"));
    comment.setId(23l);
    comment.setText("ILLUMINATI!");
    JaxbComment jaxbComment = new JaxbComment(comment);
    assertEquals("added at", comment.getAddedAt(), jaxbComment.getAddedAt());
    assertEquals("added by", comment.getAddedBy().getId(), jaxbComment.getAddedById());
    assertEquals("added by", comment.getAddedBy().getId(), jaxbComment.getAddedBy().getId());
    assertEquals("id", comment.getId(), jaxbComment.getId());
    assertEquals("text", comment.getText(), jaxbComment.getText());
    JaxbComment copyJaxbComment = testRoundTrip(jaxbComment);
    Assertions.assertThat(jaxbComment).isEqualToComparingFieldByFieldRecursively(copyJaxbComment);
}
Also used : UserImpl(org.jbpm.services.task.impl.model.UserImpl) CommentImpl(org.jbpm.services.task.impl.model.CommentImpl) JaxbComment(org.jbpm.services.task.impl.model.xml.JaxbComment) Date(java.util.Date) Test(org.junit.Test)

Aggregations

CommentImpl (org.jbpm.services.task.impl.model.CommentImpl)2 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 UserImpl (org.jbpm.services.task.impl.model.UserImpl)1 JaxbComment (org.jbpm.services.task.impl.model.xml.JaxbComment)1 Test (org.junit.Test)1 Comment (org.kie.api.task.model.Comment)1