commentHome.getInstance().setSubject("Some Subject");
commentHome.getTextEditor().setValue("Some Content");
invokeMethod("#{commentHome.persist}");
CommentQuery commentQuery = (CommentQuery)getInstance(CommentQuery.class);
assert commentQuery.getComments().size() == 7;
assert commentQuery.getComments().get(0).getId().equals(10l);
assert commentQuery.getComments().get(1).getId().equals(11l);
assert commentQuery.getComments().get(2).getId().equals(12l);
assert commentQuery.getComments().get(3).getId().equals(13l);
assert commentQuery.getComments().get(4).getId().equals(14l);
assert commentQuery.getComments().get(5).getId().equals(15l);
assert commentQuery.getComments().get(6).getCreatedBy().getUsername().equals(MEMBER_USERNAME);
assert commentQuery.getComments().get(6).getFromUserName().equals("Foo");
assert commentQuery.getComments().get(6).getFromUserHomepage().equals("http://foo.bar");
assert commentQuery.getComments().get(6).getFromUserEmail().equals("foo@bar.tld");
assertEquals(commentQuery.getComments().get(6).getSubject(), "Some Subject");
assertEquals(commentQuery.getComments().get(6).getContent(), "Some Content");
assertEquals(commentQuery.getComments().get(6).getParent().getId(), new Long(6));
assert commentQuery.getComments().get(6).getName().matches("One\\.Comment[0-9]+");
assert !commentQuery.getComments().get(6).getWikiname().contains(" ");
}
}.run();
}