Tag tag2 = tagDao.findTag("tag2").get(0);
assertEquals(0,tag2.getCount());
}
public void testUpdateBookmark4() throws Exception{
Bookmark bm1 = new Bookmark(new User(2),new Link(204));
bm1.setTitle("bookmark_1_title");
bm1.setTags("loc:columbia,md locality:baltimore,maryland");
Bookmark bm2 = new Bookmark(new User(3),new Link(204));
bm2.setTitle("bookmark_2_title");
bm2.setTags("loc:columbia,md");
int id1 = manager.addBookmark(bm1);
int id2 = manager.addBookmark(bm2);
assertTrue((id1 > 0));
assertTrue((id2 > 0));
bm1 = manager.getBookmark(id1);
bm2 = manager.getBookmark(id2);
bm1.setTags("locality:baltimore,maryland");
assertTrue(manager.updateBookmark(bm1));
Tag tag1 = tagDao.findTag("loc:columbia,md").get(0);
assertEquals(1,tag1.getCount());
UserTag user1tag1 = tagDao.findUserTag(new User(2), tag1).get(0);
assertEquals(0,user1tag1.getCount());
bm2.setTags("");;
assertTrue(manager.updateBookmark(bm2));
tag1 = tagDao.findTag("loc:columbia,md").get(0);
assertEquals(0,tag1.getCount());
}