{
// first check that the page has no comments
assertEquals(0, rpc.getComments(pageId).size());
// then add some comments
Comment comment = new Comment();
comment.setPageId(pageId);
comment.setContent("Comment1");
Comment c1 = rpc.addComment(comment);
assertNotNull(c1.getId());
assertEquals(pageId, c1.getPageId());
assertEquals("Comment1", c1.getContent());
assertNotNull(c1.getUrl());
comment.setContent("Comment2");
Comment c2 = rpc.addComment(comment);
assertNotNull(c2.getId());
assertEquals(pageId, c2.getPageId());
assertEquals("Comment2", c2.getContent());
assertNotNull(c2.getUrl());
// check that the page has the comments
assertEquals(2, rpc.getComments(pageId).size());
Comment c11 = rpc.getComment(c1.getId());
assertEquals(c1.getId(), c11.getId());
assertEquals(c1.getTitle(), c11.getTitle());
assertEquals(c1.getPageId(), c11.getPageId());
assertEquals(c1.getContent(), c11.getContent());
assertEquals(c1.getCreated(), c11.getCreated());
assertEquals(c1.getCreator(), c11.getCreator());
assertURLEquals(c1.getUrl(), c11.getUrl());
Comment c22 = rpc.getComment(c2.getId());
assertEquals(c2.getId(), c22.getId());
assertEquals(c2.getTitle(), c22.getTitle());
assertEquals(c2.getPageId(), c22.getPageId());
assertEquals(c2.getContent(), c22.getContent());
assertEquals(c2.getCreated(), c22.getCreated());
assertEquals(c2.getCreator(), c22.getCreator());
assertURLEquals(c2.getUrl(), c22.getUrl());
// delete 1st comment
assertTrue(rpc.removeComment(c1.getId()));
// check that 1st comment is still there
assertEquals(1, rpc.getComments(pageId).size());