@Test
public void testLoadAllBookMarks() throws Exception {
IFeed feed = fFactory.createFeed(null, new URI("http://www.myfeed.com"));
DynamicDAO.save(feed);
IBookMarkDAO markDAO = DynamicDAO.getDAO(IBookMarkDAO.class);
Collection<IBookMark> emptyBookmarks = markDAO.loadAll();
assertEquals(0, emptyBookmarks.size());
IFolder root1 = fFactory.createFolder(null, null, "Root 1");
root1 = DynamicDAO.save(root1);
IFolder childOfRoot1 = fFactory.createFolder(null, root1, "Child of Root 1");
childOfRoot1 = DynamicDAO.save(childOfRoot1);
IBookMark bookmark1 = fFactory.createBookMark(null, root1, new FeedLinkReference(feed.getLink()), "Bookmark 1");
IBookMark bookmark2 = fFactory.createBookMark(null, root1, new FeedLinkReference(feed.getLink()), "Bookmark 2");
IBookMark bookmark3 = fFactory.createBookMark(null, childOfRoot1, new FeedLinkReference(feed.getLink()), "Bookmark 3");
BookMarkReference bookmarkRef1 = new BookMarkReference(DynamicDAO.save(bookmark1).getId());
BookMarkReference bookmarkRef2 = new BookMarkReference(DynamicDAO.save(bookmark2).getId());
BookMarkReference bookmarkRef3 = new BookMarkReference(DynamicDAO.save(bookmark3).getId());
Collection<IBookMark> filledBookmarks = DynamicDAO.loadAll(IBookMark.class);
assertEquals(3, filledBookmarks.size());
filledBookmarks = markDAO.loadAll();
assertEquals(3, filledBookmarks.size());
for (IBookMark mark : filledBookmarks) {
if (bookmarkRef1.resolve().equals(mark))
assertEquals(bookmark1.getName(), mark.getName());