public void testUpdateBookmark() throws Exception{
Bookmark bm = bookmarkDao.getBookmark(300);
assertEquals(202,bm.getLink().getId());
// change the link that this bookmark ref
Link link = new Link(204);
bm.setLink(link);
// change tag counts
bm.setTags("foobar");
// change the URL link that this bookmark reference
Link ln = new Link("http://newlink.com");
bm.setLink(ln);
assertTrue(manager.updateBookmark(bm));
bm = bookmarkDao.getBookmark(300);
GnizrDaoUtil.fillObject(bookmarkDao, userDao, linkDao, bm);
assertEquals("foobar",bm.getTags());
Tag cnn = tagDao.findTag("cnn").get(0);
assertEquals(0,cnn.getCount());
Tag news = tagDao.findTag("news").get(0);
assertEquals(0,news.getCount());
Tag foobar = tagDao.findTag("foobar").get(0);
assertEquals(1,foobar.getCount());
UserTag foobar_u = tagDao.findUserTag(new User(1), foobar).get(0);
assertEquals(1,foobar_u.getCount());
Link bmLink = bm.getLink();
assertEquals(ln.getUrl(),bmLink.getUrl());
assertEquals(Link.computeUrlHash(ln.getUrl()),bmLink.getUrlHash());
// change bookmark's notes
bm.setNotes("hello world");
// erase the id of the link id. make sure
// BookmarkManager knows how to work out id from