	@Test
	public void testAddComment() {

		Connection db = getConnection();
		long app = getAppId();
		try {
			List<Long> recordIds = insertRecords();
			long record = recordIds.get(0);
			List<MentionDto> mentions = new ArrayList<MentionDto>();
			mentions.add(new MentionDto("kadoya", "USER"));
			mentions.add(new MentionDto("sato", "USER"));
			String text = "this is a comment";
			long id = db.addComment(app, record, text, mentions);
			
			CommentSet cs = db.getComments(app, record, true);
			assertEquals(cs.size(), 1);
			assertEquals(cs.hasNewer(), false);
			assertEquals(cs.hasOlder(), false);
			
			cs.next();
			assertEquals(cs.getId().longValue(), id);
			assertEquals((cs.getText().indexOf(text) > 0), true);
			assertEquals(cs.getCreator().getCode(), "Administrator");
			assertEquals(cs.getMentions().size(), 2);
			assertEquals(cs.getMentions().get(1).getCode(), "sato");
		} catch (Exception e) {
			fail("db exception:" + e.getMessage());
		}
	}