public void testCRUDBookmark() throws Exception{
BookmarkFolder folder=new BookmarkFolder();
folder.setName("test for folder");
folder.setUserName("user");
bookmarkFolderService.createBookmarkFolder(folder);
Bookmark bm=new Bookmark();
bm.setName("test for bookmark");
bm.setQueryString("http://test/");
bm.setBookmarkFolder(folder);
bookmarkService.createBookmark(bm);
Bookmark storedbm=bookmarkService.getBookmark(bm.getId());
assertNotNull(storedbm);
assertEquals(storedbm.getName(),bm.getName());
assertEquals(storedbm.getQueryString(),bm.getQueryString());
storedbm.setName("changed");
bookmarkService.updateBookmark(storedbm);
Bookmark changedbm=bookmarkService.getBookmark(storedbm.getId());
assertEquals(changedbm.getName(),"changed");
bookmarkService.deleteBookmark(changedbm);
bookmarkFolderService.deleteBookmarkFolder(folder);
assertNull(bookmarkService.getBookmark(changedbm.getId()));
}