Package org.rssowl.core.internal.persist.dao

Examples of org.rssowl.core.internal.persist.dao.CachingDAO


    System.gc();
    Owl.getPersistenceService().startup(new NullOperationMonitor());

    /* Assert Folders */
    CachingDAO dao = (CachingDAO) DynamicDAO.getDAO(IFolderDAO.class);
    root = (IFolder) dao.load(rootFolderId);
    assertNotNull(root);
    assertEquals("Root", root.getName());
    assertProperties(root);

    subRoot1 = (IFolder) dao.load(subRootFolder1Id);
    assertNotNull(subRoot1);
    assertEquals("Sub Root 1", subRoot1.getName());
    assertProperties(subRoot1);

    subRoot2 = (IFolder) dao.load(subRootFolder2Id);
    assertNotNull(subRoot2);
    assertEquals("Sub Root 2", subRoot2.getName());
    assertProperties(subRoot2);

    subRoot3 = (IFolder) dao.load(subRootFolder3Id);
    assertNotNull(subRoot3);
    assertEquals("Sub Root 3", subRoot3.getName());
    assertProperties(subRoot3);

    subSubRoot1 = (IFolder) dao.load(subSubRootFolder1Id);
    assertNotNull(subSubRoot1);
    assertEquals("Sub Sub Root 1", subSubRoot1.getName());
    assertProperties(subSubRoot1);

    subSubSubRoot1 = (IFolder) dao.load(subSubSubRootFolder1Id);
    assertNotNull(subSubSubRoot1);
    assertEquals("Sub Sub Sub Root 1", subSubSubRoot1.getName());
    assertProperties(subSubSubRoot1);

    /* Assert Bookmarks */
    dao = (CachingDAO) DynamicDAO.getDAO(IBookMarkDAO.class);

    rootBM1 = (IBookMark) dao.load(rootBM1Id);
    assertNotNull(rootBM1);
    assertEquals("Root Bookmark 1", rootBM1.getName());
    assertProperties(rootBM1);

    rootBM2 = (IBookMark) dao.load(rootBM2Id);
    assertNotNull(rootBM2);
    assertEquals("Root Bookmark 2", rootBM2.getName());
    assertProperties(rootBM2);

    subRoot1BM1 = (IBookMark) dao.load(subRoot1BM1Id);
    assertNotNull(subRoot1BM1);
    assertEquals("Sub Root 1 Bookmark 1", subRoot1BM1.getName());
    assertProperties(subRoot1BM1);

    subRoot1BM2 = (IBookMark) dao.load(subRoot1BM2Id);
    assertNotNull(subRoot1BM2);
    assertEquals("Sub Root 1 Bookmark 2", subRoot1BM2.getName());
    assertProperties(subRoot1BM2);

    subRoot2BM1 = (IBookMark) dao.load(subRoot2BM1Id);
    assertNotNull(subRoot2BM1);
    assertEquals("Sub Root 2 Bookmark 1", subRoot2BM1.getName());
    assertProperties(subRoot2BM1);

    subRoot3BM1 = (IBookMark) dao.load(subRoot3BM1Id);
    assertNotNull(subRoot3BM1);
    assertEquals("Sub Root 3 Bookmark 1", subRoot3BM1.getName());
    assertProperties(subRoot3BM1);

    subSubRoot1BM1 = (IBookMark) dao.load(subSubRoot1BM1Id);
    assertNotNull(subSubRoot1BM1);
    assertEquals("Sub Sub Root 1 Bookmark 1", subSubRoot1BM1.getName());
    assertProperties(subSubRoot1BM1);

    subSubSubRoot1BM1 = (IBookMark) dao.load(subSubSubRoot1BM1Id);
    assertNotNull(subSubSubRoot1BM1);
    assertEquals("Sub Sub Sub Root 1 Bookmark 1", subSubSubRoot1BM1.getName());
    assertProperties(subSubSubRoot1BM1);

    /* Assert News Bins */
    dao = (CachingDAO) DynamicDAO.getDAO(INewsBinDAO.class);

    rootNB1 = (INewsBin) dao.load(rootNB1Id);
    assertNotNull(rootNB1);
    assertEquals("Root Newsbin 1", rootNB1.getName());
    assertProperties(rootNB1);

    rootNB2 = (INewsBin) dao.load(rootNB2Id);
    assertNotNull(rootNB2);
    assertEquals("Root Newsbin 2", rootNB2.getName());
    assertProperties(rootNB2);

    subRoot1NB1 = (INewsBin) dao.load(subRoot1NB1Id);
    assertNotNull(subRoot1NB1);
    assertEquals("Sub Root 1 Newsbin 1", subRoot1NB1.getName());
    assertProperties(subRoot1NB1);

    subRoot1NB2 = (INewsBin) dao.load(subRoot1NB2Id);
    assertNotNull(subRoot1NB2);
    assertEquals("Sub Root 1 Newsbin 2", subRoot1NB2.getName());
    assertProperties(subRoot1NB2);

    subRoot2NB1 = (INewsBin) dao.load(subRoot2NB1Id);
    assertNotNull(subRoot2NB1);
    assertEquals("Sub Root 2 Newsbin 1", subRoot2NB1.getName());
    assertProperties(subRoot2NB1);

    subRoot3NB1 = (INewsBin) dao.load(subRoot3NB1Id);
    assertNotNull(subRoot3NB1);
    assertEquals("Sub Root 3 Newsbin 1", subRoot3NB1.getName());
    assertProperties(subRoot3NB1);

    subSubRoot1NB1 = (INewsBin) dao.load(subSubRoot1NB1Id);
    assertNotNull(subSubRoot1NB1);
    assertEquals("Sub Sub Root 1 Newsbin 1", subSubRoot1NB1.getName());
    assertProperties(subSubRoot1NB1);

    subSubSubRoot1NB1 = (INewsBin) dao.load(subSubSubRoot1NB1Id);
    assertNotNull(subSubSubRoot1NB1);
    assertEquals("Sub Sub Sub Root 1 Newsbin 1", subSubSubRoot1NB1.getName());
    assertProperties(subSubSubRoot1NB1);

    /* Assert Search Marks */
    dao = (CachingDAO) DynamicDAO.getDAO(ISearchMarkDAO.class);

    rootSM1 = (ISearchMark) dao.load(rootSM1Id);
    assertNotNull(rootSM1);
    assertEquals("Root Searchmark 1", rootSM1.getName());
    assertProperties(rootSM1);

    rootSM2 = (ISearchMark) dao.load(rootSM2Id);
    assertNotNull(rootSM2);
    assertEquals("Root Searchmark 2", rootSM2.getName());
    assertProperties(rootSM2);

    subRoot1SM1 = (ISearchMark) dao.load(subRoot1SM1Id);
    assertNotNull(subRoot1SM1);
    assertEquals("Sub Root 1 Searchmark 1", subRoot1SM1.getName());
    assertProperties(subRoot1SM1);

    subRoot1SM2 = (ISearchMark) dao.load(subRoot1SM2Id);
    assertNotNull(subRoot1SM2);
    assertEquals("Sub Root 1 Searchmark 2", subRoot1SM2.getName());
    assertProperties(subRoot1SM2);

    subRoot2SM1 = (ISearchMark) dao.load(subRoot2SM1Id);
    assertNotNull(subRoot2SM1);
    assertEquals("Sub Root 2 Searchmark 1", subRoot2SM1.getName());
    assertProperties(subRoot2SM1);

    subRoot3SM1 = (ISearchMark) dao.load(subRoot3SM1Id);
    assertNotNull(subRoot3SM1);
    assertEquals("Sub Root 3 Searchmark 1", subRoot3SM1.getName());
    assertProperties(subRoot3SM1);

    subSubRoot1SM1 = (ISearchMark) dao.load(subSubRoot1SM1Id);
    assertNotNull(subSubRoot1SM1);
    assertEquals("Sub Sub Root 1 Searchmark 1", subSubRoot1SM1.getName());
    assertProperties(subSubRoot1SM1);

    subSubSubRoot1SM1 = (ISearchMark) dao.load(subSubSubRoot1SM1Id);
    assertNotNull(subSubSubRoot1SM1);
    assertEquals("Sub Sub Sub Root 1 Searchmark 1", subSubSubRoot1SM1.getName());
    assertProperties(subSubSubRoot1SM1);
  }
View Full Code Here


    System.gc();
    Owl.getPersistenceService().startup(new NullOperationMonitor());

    /* Assert Folders */
    CachingDAO dao = (CachingDAO) DynamicDAO.getDAO(IFolderDAO.class);
    root1 = (IFolder) dao.load(rootFolder1Id);
    assertNotNull(root1);
    assertEquals("Root 1", root1.getName());
    assertProperties(root1);

    root2 = (IFolder) dao.load(rootFolder2Id);
    assertNotNull(root2);
    assertEquals("Root 2", root2.getName());
    assertProperties(root2);

    root3 = (IFolder) dao.load(rootFolder3Id);
    assertNotNull(root3);
    assertEquals("Root 3", root3.getName());
    assertProperties(root3);

    subRoot1 = (IFolder) dao.load(subRootFolder1Id);
    assertNotNull(subRoot1);
    assertEquals("Sub Root 1", subRoot1.getName());
    assertProperties(subRoot1);

    subRoot2 = (IFolder) dao.load(subRootFolder2Id);
    assertNotNull(subRoot2);
    assertEquals("Sub Root 2", subRoot2.getName());
    assertProperties(subRoot2);

    subRoot3 = (IFolder) dao.load(subRootFolder3Id);
    assertNotNull(subRoot3);
    assertEquals("Sub Root 3", subRoot3.getName());
    assertProperties(subRoot3);

    subSubRoot1 = (IFolder) dao.load(subSubRootFolder1Id);
    assertNotNull(subSubRoot1);
    assertEquals("Sub Sub Root 1", subSubRoot1.getName());
    assertProperties(subSubRoot1);

    subSubSubRoot1 = (IFolder) dao.load(subSubSubRootFolder1Id);
    assertNotNull(subSubSubRoot1);
    assertEquals("Sub Sub Sub Root 1", subSubSubRoot1.getName());
    assertProperties(subSubSubRoot1);

    /* Assert Bookmarks */
    dao = (CachingDAO) DynamicDAO.getDAO(IBookMarkDAO.class);

    rootBM1 = (IBookMark) dao.load(rootBM1Id);
    assertNotNull(rootBM1);
    assertEquals("Root Bookmark 1", rootBM1.getName());
    assertProperties(rootBM1);

    rootBM2 = (IBookMark) dao.load(rootBM2Id);
    assertNotNull(rootBM2);
    assertEquals("Root Bookmark 2", rootBM2.getName());
    assertProperties(rootBM2);

    subRoot1BM1 = (IBookMark) dao.load(subRoot1BM1Id);
    assertNotNull(subRoot1BM1);
    assertEquals("Sub Root 1 Bookmark 1", subRoot1BM1.getName());
    assertProperties(subRoot1BM1);

    subRoot1BM2 = (IBookMark) dao.load(subRoot1BM2Id);
    assertNotNull(subRoot1BM2);
    assertEquals("Sub Root 1 Bookmark 2", subRoot1BM2.getName());
    assertProperties(subRoot1BM2);

    subRoot2BM1 = (IBookMark) dao.load(subRoot2BM1Id);
    assertNotNull(subRoot2BM1);
    assertEquals("Sub Root 2 Bookmark 1", subRoot2BM1.getName());
    assertProperties(subRoot2BM1);

    subRoot3BM1 = (IBookMark) dao.load(subRoot3BM1Id);
    assertNotNull(subRoot3BM1);
    assertEquals("Sub Root 3 Bookmark 1", subRoot3BM1.getName());
    assertProperties(subRoot3BM1);

    subSubRoot1BM1 = (IBookMark) dao.load(subSubRoot1BM1Id);
    assertNotNull(subSubRoot1BM1);
    assertEquals("Sub Sub Root 1 Bookmark 1", subSubRoot1BM1.getName());
    assertProperties(subSubRoot1BM1);

    subSubSubRoot1BM1 = (IBookMark) dao.load(subSubSubRoot1BM1Id);
    assertNotNull(subSubSubRoot1BM1);
    assertEquals("Sub Sub Sub Root 1 Bookmark 1", subSubSubRoot1BM1.getName());
    assertProperties(subSubSubRoot1BM1);

    /* Assert News Bins */
    dao = (CachingDAO) DynamicDAO.getDAO(INewsBinDAO.class);

    rootNB1 = (INewsBin) dao.load(rootNB1Id);
    assertNotNull(rootNB1);
    assertEquals("Root Newsbin 1", rootNB1.getName());
    assertProperties(rootNB1);

    rootNB2 = (INewsBin) dao.load(rootNB2Id);
    assertNotNull(rootNB2);
    assertEquals("Root Newsbin 2", rootNB2.getName());
    assertProperties(rootNB2);

    subRoot1NB1 = (INewsBin) dao.load(subRoot1NB1Id);
    assertNotNull(subRoot1NB1);
    assertEquals("Sub Root 1 Newsbin 1", subRoot1NB1.getName());
    assertProperties(subRoot1NB1);

    subRoot1NB2 = (INewsBin) dao.load(subRoot1NB2Id);
    assertNotNull(subRoot1NB2);
    assertEquals("Sub Root 1 Newsbin 2", subRoot1NB2.getName());
    assertProperties(subRoot1NB2);

    subRoot2NB1 = (INewsBin) dao.load(subRoot2NB1Id);
    assertNotNull(subRoot2NB1);
    assertEquals("Sub Root 2 Newsbin 1", subRoot2NB1.getName());
    assertProperties(subRoot2NB1);

    subRoot3NB1 = (INewsBin) dao.load(subRoot3NB1Id);
    assertNotNull(subRoot3NB1);
    assertEquals("Sub Root 3 Newsbin 1", subRoot3NB1.getName());
    assertProperties(subRoot3NB1);

    subSubRoot1NB1 = (INewsBin) dao.load(subSubRoot1NB1Id);
    assertNotNull(subSubRoot1NB1);
    assertEquals("Sub Sub Root 1 Newsbin 1", subSubRoot1NB1.getName());
    assertProperties(subSubRoot1NB1);

    subSubSubRoot1NB1 = (INewsBin) dao.load(subSubSubRoot1NB1Id);
    assertNotNull(subSubSubRoot1NB1);
    assertEquals("Sub Sub Sub Root 1 Newsbin 1", subSubSubRoot1NB1.getName());
    assertProperties(subSubSubRoot1NB1);

    /* Assert Search Marks */
    dao = (CachingDAO) DynamicDAO.getDAO(ISearchMarkDAO.class);

    rootSM1 = (ISearchMark) dao.load(rootSM1Id);
    assertNotNull(rootSM1);
    assertEquals("Root Searchmark 1", rootSM1.getName());
    assertProperties(rootSM1);

    rootSM2 = (ISearchMark) dao.load(rootSM2Id);
    assertNotNull(rootSM2);
    assertEquals("Root Searchmark 2", rootSM2.getName());
    assertProperties(rootSM2);

    subRoot1SM1 = (ISearchMark) dao.load(subRoot1SM1Id);
    assertNotNull(subRoot1SM1);
    assertEquals("Sub Root 1 Searchmark 1", subRoot1SM1.getName());
    assertProperties(subRoot1SM1);

    subRoot1SM2 = (ISearchMark) dao.load(subRoot1SM2Id);
    assertNotNull(subRoot1SM2);
    assertEquals("Sub Root 1 Searchmark 2", subRoot1SM2.getName());
    assertProperties(subRoot1SM2);

    subRoot2SM1 = (ISearchMark) dao.load(subRoot2SM1Id);
    assertNotNull(subRoot2SM1);
    assertEquals("Sub Root 2 Searchmark 1", subRoot2SM1.getName());
    assertProperties(subRoot2SM1);

    subRoot3SM1 = (ISearchMark) dao.load(subRoot3SM1Id);
    assertNotNull(subRoot3SM1);
    assertEquals("Sub Root 3 Searchmark 1", subRoot3SM1.getName());
    assertProperties(subRoot3SM1);

    subSubRoot1SM1 = (ISearchMark) dao.load(subSubRoot1SM1Id);
    assertNotNull(subSubRoot1SM1);
    assertEquals("Sub Sub Root 1 Searchmark 1", subSubRoot1SM1.getName());
    assertProperties(subSubRoot1SM1);

    subSubSubRoot1SM1 = (ISearchMark) dao.load(subSubSubRoot1SM1Id);
    assertNotNull(subSubSubRoot1SM1);
    assertEquals("Sub Sub Sub Root 1 Searchmark 1", subSubSubRoot1SM1.getName());
    assertProperties(subSubSubRoot1SM1);
  }
View Full Code Here

    Owl.getPersistenceService().shutdown(false);
    System.gc();
    Owl.getPersistenceService().startup(new NullOperationMonitor());

    /* Assert Folders */
    CachingDAO dao = (CachingDAO) DynamicDAO.getDAO(IFolderDAO.class);
    Collection all = dao.loadAll();
    assertEquals(20, all.size());
    for (Object object : all) {
      if (object instanceof IFolder)
        assertProperties((IFolder) object);
      else
        fail();
    }

    /* Assert Bookmarks */
    dao = (CachingDAO) DynamicDAO.getDAO(IBookMarkDAO.class);
    all = dao.loadAll();
    assertEquals(20, all.size());
    for (Object object : all) {
      if (object instanceof IBookMark)
        assertProperties((IBookMark) object);
      else
        fail();
    }

    /* Assert News Bins */
    dao = (CachingDAO) DynamicDAO.getDAO(INewsBinDAO.class);
    all = dao.loadAll();
    assertEquals(20, all.size());
    for (Object object : all) {
      if (object instanceof INewsBin)
        assertProperties((INewsBin) object);
      else
        fail();
    }

    /* Assert Search Marks */
    dao = (CachingDAO) DynamicDAO.getDAO(ISearchMarkDAO.class);
    all = dao.loadAll();
    assertEquals(20, all.size());
    for (Object object : all) {
      if (object instanceof ISearchMark)
        assertProperties((ISearchMark) object);
      else
View Full Code Here

    Owl.getPersistenceService().shutdown(false);
    System.gc();
    Owl.getPersistenceService().startup(new NullOperationMonitor());

    /* Assert Folders */
    CachingDAO dao = (CachingDAO) DynamicDAO.getDAO(ILabelDAO.class);

    label1 = (ILabel) dao.load(label1Id);
    assertEquals("Hello", label1.getName());
    assertEquals(5, label1.getOrder());

    label2 = (ILabel) dao.load(label2Id);
    assertEquals("Hello World", label2.getName());
    assertEquals("255,255,0", label2.getColor());

    label3 = (ILabel) dao.load(label3Id);
    assertEquals("Foo Bar", label3.getName());
    assertEquals("value", label3.getProperty("key"));
  }
View Full Code Here

    System.gc();
    Owl.getPersistenceService().startup(new NullOperationMonitor(), false, false);

    /* Assert Folders */
    CachingDAO dao = (CachingDAO) DynamicDAO.getDAO(IFolderDAO.class);
    root1 = (IFolder) dao.load(rootFolder1Id);
    assertNotNull(root1);
    assertEquals("Root 1", root1.getName());
    assertProperties(root1);

    root2 = (IFolder) dao.load(rootFolder2Id);
    assertNotNull(root2);
    assertEquals("Root 2", root2.getName());
    assertProperties(root2);

    root3 = (IFolder) dao.load(rootFolder3Id);
    assertNotNull(root3);
    assertEquals("Root 3", root3.getName());
    assertProperties(root3);

    subRoot1 = (IFolder) dao.load(subRootFolder1Id);
    assertNotNull(subRoot1);
    assertEquals("Sub Root 1", subRoot1.getName());
    assertProperties(subRoot1);

    subRoot2 = (IFolder) dao.load(subRootFolder2Id);
    assertNotNull(subRoot2);
    assertEquals("Sub Root 2", subRoot2.getName());
    assertProperties(subRoot2);

    subRoot3 = (IFolder) dao.load(subRootFolder3Id);
    assertNotNull(subRoot3);
    assertEquals("Sub Root 3", subRoot3.getName());
    assertProperties(subRoot3);

    subSubRoot1 = (IFolder) dao.load(subSubRootFolder1Id);
    assertNotNull(subSubRoot1);
    assertEquals("Sub Sub Root 1", subSubRoot1.getName());
    assertProperties(subSubRoot1);

    subSubSubRoot1 = (IFolder) dao.load(subSubSubRootFolder1Id);
    assertNotNull(subSubSubRoot1);
    assertEquals("Sub Sub Sub Root 1", subSubSubRoot1.getName());
    assertProperties(subSubSubRoot1);

    /* Assert Bookmarks */
    dao = (CachingDAO) DynamicDAO.getDAO(IBookMarkDAO.class);

    rootBM1 = (IBookMark) dao.load(rootBM1Id);
    assertNotNull(rootBM1);
    assertEquals("Root Bookmark 1", rootBM1.getName());
    assertProperties(rootBM1);

    rootBM2 = (IBookMark) dao.load(rootBM2Id);
    assertNotNull(rootBM2);
    assertEquals("Root Bookmark 2", rootBM2.getName());
    assertProperties(rootBM2);

    subRoot1BM1 = (IBookMark) dao.load(subRoot1BM1Id);
    assertNotNull(subRoot1BM1);
    assertEquals("Sub Root 1 Bookmark 1", subRoot1BM1.getName());
    assertProperties(subRoot1BM1);

    subRoot1BM2 = (IBookMark) dao.load(subRoot1BM2Id);
    assertNotNull(subRoot1BM2);
    assertEquals("Sub Root 1 Bookmark 2", subRoot1BM2.getName());
    assertProperties(subRoot1BM2);

    subRoot2BM1 = (IBookMark) dao.load(subRoot2BM1Id);
    assertNotNull(subRoot2BM1);
    assertEquals("Sub Root 2 Bookmark 1", subRoot2BM1.getName());
    assertProperties(subRoot2BM1);

    subRoot3BM1 = (IBookMark) dao.load(subRoot3BM1Id);
    assertNotNull(subRoot3BM1);
    assertEquals("Sub Root 3 Bookmark 1", subRoot3BM1.getName());
    assertProperties(subRoot3BM1);

    subSubRoot1BM1 = (IBookMark) dao.load(subSubRoot1BM1Id);
    assertNotNull(subSubRoot1BM1);
    assertEquals("Sub Sub Root 1 Bookmark 1", subSubRoot1BM1.getName());
    assertProperties(subSubRoot1BM1);

    subSubSubRoot1BM1 = (IBookMark) dao.load(subSubSubRoot1BM1Id);
    assertNotNull(subSubSubRoot1BM1);
    assertEquals("Sub Sub Sub Root 1 Bookmark 1", subSubSubRoot1BM1.getName());
    assertProperties(subSubSubRoot1BM1);

    /* Assert News Bins */
    dao = (CachingDAO) DynamicDAO.getDAO(INewsBinDAO.class);

    rootNB1 = (INewsBin) dao.load(rootNB1Id);
    assertNotNull(rootNB1);
    assertEquals("Root Newsbin 1", rootNB1.getName());
    assertProperties(rootNB1);

    rootNB2 = (INewsBin) dao.load(rootNB2Id);
    assertNotNull(rootNB2);
    assertEquals("Root Newsbin 2", rootNB2.getName());
    assertProperties(rootNB2);

    subRoot1NB1 = (INewsBin) dao.load(subRoot1NB1Id);
    assertNotNull(subRoot1NB1);
    assertEquals("Sub Root 1 Newsbin 1", subRoot1NB1.getName());
    assertProperties(subRoot1NB1);

    subRoot1NB2 = (INewsBin) dao.load(subRoot1NB2Id);
    assertNotNull(subRoot1NB2);
    assertEquals("Sub Root 1 Newsbin 2", subRoot1NB2.getName());
    assertProperties(subRoot1NB2);

    subRoot2NB1 = (INewsBin) dao.load(subRoot2NB1Id);
    assertNotNull(subRoot2NB1);
    assertEquals("Sub Root 2 Newsbin 1", subRoot2NB1.getName());
    assertProperties(subRoot2NB1);

    subRoot3NB1 = (INewsBin) dao.load(subRoot3NB1Id);
    assertNotNull(subRoot3NB1);
    assertEquals("Sub Root 3 Newsbin 1", subRoot3NB1.getName());
    assertProperties(subRoot3NB1);

    subSubRoot1NB1 = (INewsBin) dao.load(subSubRoot1NB1Id);
    assertNotNull(subSubRoot1NB1);
    assertEquals("Sub Sub Root 1 Newsbin 1", subSubRoot1NB1.getName());
    assertProperties(subSubRoot1NB1);

    subSubSubRoot1NB1 = (INewsBin) dao.load(subSubSubRoot1NB1Id);
    assertNotNull(subSubSubRoot1NB1);
    assertEquals("Sub Sub Sub Root 1 Newsbin 1", subSubSubRoot1NB1.getName());
    assertProperties(subSubSubRoot1NB1);

    /* Assert Search Marks */
    dao = (CachingDAO) DynamicDAO.getDAO(ISearchMarkDAO.class);

    rootSM1 = (ISearchMark) dao.load(rootSM1Id);
    assertNotNull(rootSM1);
    assertEquals("Root Searchmark 1", rootSM1.getName());
    assertProperties(rootSM1);

    rootSM2 = (ISearchMark) dao.load(rootSM2Id);
    assertNotNull(rootSM2);
    assertEquals("Root Searchmark 2", rootSM2.getName());
    assertProperties(rootSM2);

    subRoot1SM1 = (ISearchMark) dao.load(subRoot1SM1Id);
    assertNotNull(subRoot1SM1);
    assertEquals("Sub Root 1 Searchmark 1", subRoot1SM1.getName());
    assertProperties(subRoot1SM1);

    subRoot1SM2 = (ISearchMark) dao.load(subRoot1SM2Id);
    assertNotNull(subRoot1SM2);
    assertEquals("Sub Root 1 Searchmark 2", subRoot1SM2.getName());
    assertProperties(subRoot1SM2);

    subRoot2SM1 = (ISearchMark) dao.load(subRoot2SM1Id);
    assertNotNull(subRoot2SM1);
    assertEquals("Sub Root 2 Searchmark 1", subRoot2SM1.getName());
    assertProperties(subRoot2SM1);

    subRoot3SM1 = (ISearchMark) dao.load(subRoot3SM1Id);
    assertNotNull(subRoot3SM1);
    assertEquals("Sub Root 3 Searchmark 1", subRoot3SM1.getName());
    assertProperties(subRoot3SM1);

    subSubRoot1SM1 = (ISearchMark) dao.load(subSubRoot1SM1Id);
    assertNotNull(subSubRoot1SM1);
    assertEquals("Sub Sub Root 1 Searchmark 1", subSubRoot1SM1.getName());
    assertProperties(subSubRoot1SM1);

    subSubSubRoot1SM1 = (ISearchMark) dao.load(subSubSubRoot1SM1Id);
    assertNotNull(subSubSubRoot1SM1);
    assertEquals("Sub Sub Sub Root 1 Searchmark 1", subSubSubRoot1SM1.getName());
    assertProperties(subSubSubRoot1SM1);
  }
View Full Code Here

    Owl.getPersistenceService().shutdown(false);
    System.gc();
    Owl.getPersistenceService().startup(new NullOperationMonitor(), false, false);

    /* Assert Folders */
    CachingDAO dao = (CachingDAO) DynamicDAO.getDAO(IFolderDAO.class);
    Collection all = dao.loadAll();
    assertEquals(20, all.size());
    for (Object object : all) {
      if (object instanceof IFolder)
        assertProperties((IFolder) object);
      else
        fail();
    }

    /* Assert Bookmarks */
    dao = (CachingDAO) DynamicDAO.getDAO(IBookMarkDAO.class);
    all = dao.loadAll();
    assertEquals(20, all.size());
    for (Object object : all) {
      if (object instanceof IBookMark)
        assertProperties((IBookMark) object);
      else
        fail();
    }

    /* Assert News Bins */
    dao = (CachingDAO) DynamicDAO.getDAO(INewsBinDAO.class);
    all = dao.loadAll();
    assertEquals(20, all.size());
    for (Object object : all) {
      if (object instanceof INewsBin)
        assertProperties((INewsBin) object);
      else
        fail();
    }

    /* Assert Search Marks */
    dao = (CachingDAO) DynamicDAO.getDAO(ISearchMarkDAO.class);
    all = dao.loadAll();
    assertEquals(20, all.size());
    for (Object object : all) {
      if (object instanceof ISearchMark)
        assertProperties((ISearchMark) object);
      else
View Full Code Here

    System.gc();
    Owl.getPersistenceService().startup(new NullOperationMonitor(), true, false);

    /* Assert Folders */
    {
      CachingDAO dao = (CachingDAO) DynamicDAO.getDAO(IFolderDAO.class);
      Collection all = dao.loadAll();
      assertEquals(20, all.size());
      for (Object object : all) {
        if (object instanceof IFolder)
          assertProperties((IFolder) object);
        else
          fail();
      }

      /* Assert Bookmarks */
      dao = (CachingDAO) DynamicDAO.getDAO(IBookMarkDAO.class);
      all = dao.loadAll();
      assertEquals(20, all.size());
      for (Object object : all) {
        if (object instanceof IBookMark)
          assertProperties((IBookMark) object);
        else
          fail();
      }

      /* Assert News Bins */
      dao = (CachingDAO) DynamicDAO.getDAO(INewsBinDAO.class);
      all = dao.loadAll();
      assertEquals(20, all.size());
      for (Object object : all) {
        if (object instanceof INewsBin)
          assertProperties((INewsBin) object);
        else
          fail();
      }

      /* Assert Search Marks */
      dao = (CachingDAO) DynamicDAO.getDAO(ISearchMarkDAO.class);
      all = dao.loadAll();
      assertEquals(20, all.size());
      for (Object object : all) {
        if (object instanceof ISearchMark)
          assertProperties((ISearchMark) object);
        else
          fail();
      }
    }

    /* Reopen Database */
    Owl.getPersistenceService().shutdown(false);
    System.gc();
    Owl.getPersistenceService().startup(new NullOperationMonitor(), false, false);

    /* Assert Folders */
    CachingDAO dao = (CachingDAO) DynamicDAO.getDAO(IFolderDAO.class);
    Collection all = dao.loadAll();
    assertEquals(20, all.size());
    for (Object object : all) {
      if (object instanceof IFolder)
        assertProperties((IFolder) object);
      else
        fail();
    }

    /* Assert Bookmarks */
    dao = (CachingDAO) DynamicDAO.getDAO(IBookMarkDAO.class);
    all = dao.loadAll();
    assertEquals(20, all.size());
    for (Object object : all) {
      if (object instanceof IBookMark)
        assertProperties((IBookMark) object);
      else
        fail();
    }

    /* Assert News Bins */
    dao = (CachingDAO) DynamicDAO.getDAO(INewsBinDAO.class);
    all = dao.loadAll();
    assertEquals(20, all.size());
    for (Object object : all) {
      if (object instanceof INewsBin)
        assertProperties((INewsBin) object);
      else
        fail();
    }

    /* Assert Search Marks */
    dao = (CachingDAO) DynamicDAO.getDAO(ISearchMarkDAO.class);
    all = dao.loadAll();
    assertEquals(20, all.size());
    for (Object object : all) {
      if (object instanceof ISearchMark)
        assertProperties((ISearchMark) object);
      else
View Full Code Here

    Owl.getPersistenceService().shutdown(false);
    System.gc();
    Owl.getPersistenceService().startup(new NullOperationMonitor(), false, false);

    /* Assert Folders */
    CachingDAO dao = (CachingDAO) DynamicDAO.getDAO(ILabelDAO.class);

    label1 = (ILabel) dao.load(label1Id);
    assertEquals("Hello", label1.getName());
    assertEquals(5, label1.getOrder());

    label2 = (ILabel) dao.load(label2Id);
    assertEquals("Hello World", label2.getName());
    assertEquals("255,255,0", label2.getColor());

    label3 = (ILabel) dao.load(label3Id);
    assertEquals("Foo Bar", label3.getName());
    assertEquals("value", label3.getProperty("key"));
  }
View Full Code Here

    Owl.getPersistenceService().shutdown(false);
    System.gc();
    Owl.getPersistenceService().startup(new NullOperationMonitor(), true, false);

    /* Assert Folders */
    CachingDAO dao = (CachingDAO) DynamicDAO.getDAO(ILabelDAO.class);

    label1 = (ILabel) dao.load(label1Id);
    assertEquals("Hello", label1.getName());
    assertEquals(5, label1.getOrder());

    label2 = (ILabel) dao.load(label2Id);
    assertEquals("Hello World", label2.getName());
    assertEquals("255,255,0", label2.getColor());

    label3 = (ILabel) dao.load(label3Id);
    assertEquals("Foo Bar", label3.getName());
    assertEquals("value", label3.getProperty("key"));

    /* Reopen Database */
    Owl.getPersistenceService().shutdown(false);
    System.gc();
    Owl.getPersistenceService().startup(new NullOperationMonitor(), false, false);

    label1 = (ILabel) dao.load(label1Id);
    assertEquals("Hello", label1.getName());
    assertEquals(5, label1.getOrder());

    label2 = (ILabel) dao.load(label2Id);
    assertEquals("Hello World", label2.getName());
    assertEquals("255,255,0", label2.getColor());

    label3 = (ILabel) dao.load(label3Id);
    assertEquals("Foo Bar", label3.getName());
    assertEquals("value", label3.getProperty("key"));
  }
View Full Code Here

    System.gc();
    Owl.getPersistenceService().startup(new NullOperationMonitor(), false, false);

    /* Assert Folders */
    CachingDAO dao = (CachingDAO) DynamicDAO.getDAO(IFolderDAO.class);
    root = (IFolder) dao.load(rootFolderId);
    assertNotNull(root);
    assertEquals("Root", root.getName());
    assertProperties(root);

    subRoot1 = (IFolder) dao.load(subRootFolder1Id);
    assertNotNull(subRoot1);
    assertEquals("Sub Root 1", subRoot1.getName());
    assertProperties(subRoot1);

    subRoot2 = (IFolder) dao.load(subRootFolder2Id);
    assertNotNull(subRoot2);
    assertEquals("Sub Root 2", subRoot2.getName());
    assertProperties(subRoot2);

    subRoot3 = (IFolder) dao.load(subRootFolder3Id);
    assertNotNull(subRoot3);
    assertEquals("Sub Root 3", subRoot3.getName());
    assertProperties(subRoot3);

    subSubRoot1 = (IFolder) dao.load(subSubRootFolder1Id);
    assertNotNull(subSubRoot1);
    assertEquals("Sub Sub Root 1", subSubRoot1.getName());
    assertProperties(subSubRoot1);

    subSubSubRoot1 = (IFolder) dao.load(subSubSubRootFolder1Id);
    assertNotNull(subSubSubRoot1);
    assertEquals("Sub Sub Sub Root 1", subSubSubRoot1.getName());
    assertProperties(subSubSubRoot1);

    /* Assert Bookmarks */
    dao = (CachingDAO) DynamicDAO.getDAO(IBookMarkDAO.class);

    rootBM1 = (IBookMark) dao.load(rootBM1Id);
    assertNotNull(rootBM1);
    assertEquals("Root Bookmark 1", rootBM1.getName());
    assertProperties(rootBM1);

    rootBM2 = (IBookMark) dao.load(rootBM2Id);
    assertNotNull(rootBM2);
    assertEquals("Root Bookmark 2", rootBM2.getName());
    assertProperties(rootBM2);

    subRoot1BM1 = (IBookMark) dao.load(subRoot1BM1Id);
    assertNotNull(subRoot1BM1);
    assertEquals("Sub Root 1 Bookmark 1", subRoot1BM1.getName());
    assertProperties(subRoot1BM1);

    subRoot1BM2 = (IBookMark) dao.load(subRoot1BM2Id);
    assertNotNull(subRoot1BM2);
    assertEquals("Sub Root 1 Bookmark 2", subRoot1BM2.getName());
    assertProperties(subRoot1BM2);

    subRoot2BM1 = (IBookMark) dao.load(subRoot2BM1Id);
    assertNotNull(subRoot2BM1);
    assertEquals("Sub Root 2 Bookmark 1", subRoot2BM1.getName());
    assertProperties(subRoot2BM1);

    subRoot3BM1 = (IBookMark) dao.load(subRoot3BM1Id);
    assertNotNull(subRoot3BM1);
    assertEquals("Sub Root 3 Bookmark 1", subRoot3BM1.getName());
    assertProperties(subRoot3BM1);

    subSubRoot1BM1 = (IBookMark) dao.load(subSubRoot1BM1Id);
    assertNotNull(subSubRoot1BM1);
    assertEquals("Sub Sub Root 1 Bookmark 1", subSubRoot1BM1.getName());
    assertProperties(subSubRoot1BM1);

    subSubSubRoot1BM1 = (IBookMark) dao.load(subSubSubRoot1BM1Id);
    assertNotNull(subSubSubRoot1BM1);
    assertEquals("Sub Sub Sub Root 1 Bookmark 1", subSubSubRoot1BM1.getName());
    assertProperties(subSubSubRoot1BM1);

    /* Assert News Bins */
    dao = (CachingDAO) DynamicDAO.getDAO(INewsBinDAO.class);

    rootNB1 = (INewsBin) dao.load(rootNB1Id);
    assertNotNull(rootNB1);
    assertEquals("Root Newsbin 1", rootNB1.getName());
    assertProperties(rootNB1);

    rootNB2 = (INewsBin) dao.load(rootNB2Id);
    assertNotNull(rootNB2);
    assertEquals("Root Newsbin 2", rootNB2.getName());
    assertProperties(rootNB2);

    subRoot1NB1 = (INewsBin) dao.load(subRoot1NB1Id);
    assertNotNull(subRoot1NB1);
    assertEquals("Sub Root 1 Newsbin 1", subRoot1NB1.getName());
    assertProperties(subRoot1NB1);

    subRoot1NB2 = (INewsBin) dao.load(subRoot1NB2Id);
    assertNotNull(subRoot1NB2);
    assertEquals("Sub Root 1 Newsbin 2", subRoot1NB2.getName());
    assertProperties(subRoot1NB2);

    subRoot2NB1 = (INewsBin) dao.load(subRoot2NB1Id);
    assertNotNull(subRoot2NB1);
    assertEquals("Sub Root 2 Newsbin 1", subRoot2NB1.getName());
    assertProperties(subRoot2NB1);

    subRoot3NB1 = (INewsBin) dao.load(subRoot3NB1Id);
    assertNotNull(subRoot3NB1);
    assertEquals("Sub Root 3 Newsbin 1", subRoot3NB1.getName());
    assertProperties(subRoot3NB1);

    subSubRoot1NB1 = (INewsBin) dao.load(subSubRoot1NB1Id);
    assertNotNull(subSubRoot1NB1);
    assertEquals("Sub Sub Root 1 Newsbin 1", subSubRoot1NB1.getName());
    assertProperties(subSubRoot1NB1);

    subSubSubRoot1NB1 = (INewsBin) dao.load(subSubSubRoot1NB1Id);
    assertNotNull(subSubSubRoot1NB1);
    assertEquals("Sub Sub Sub Root 1 Newsbin 1", subSubSubRoot1NB1.getName());
    assertProperties(subSubSubRoot1NB1);

    /* Assert Search Marks */
    dao = (CachingDAO) DynamicDAO.getDAO(ISearchMarkDAO.class);

    rootSM1 = (ISearchMark) dao.load(rootSM1Id);
    assertNotNull(rootSM1);
    assertEquals("Root Searchmark 1", rootSM1.getName());
    assertProperties(rootSM1);

    rootSM2 = (ISearchMark) dao.load(rootSM2Id);
    assertNotNull(rootSM2);
    assertEquals("Root Searchmark 2", rootSM2.getName());
    assertProperties(rootSM2);

    subRoot1SM1 = (ISearchMark) dao.load(subRoot1SM1Id);
    assertNotNull(subRoot1SM1);
    assertEquals("Sub Root 1 Searchmark 1", subRoot1SM1.getName());
    assertProperties(subRoot1SM1);

    subRoot1SM2 = (ISearchMark) dao.load(subRoot1SM2Id);
    assertNotNull(subRoot1SM2);
    assertEquals("Sub Root 1 Searchmark 2", subRoot1SM2.getName());
    assertProperties(subRoot1SM2);

    subRoot2SM1 = (ISearchMark) dao.load(subRoot2SM1Id);
    assertNotNull(subRoot2SM1);
    assertEquals("Sub Root 2 Searchmark 1", subRoot2SM1.getName());
    assertProperties(subRoot2SM1);

    subRoot3SM1 = (ISearchMark) dao.load(subRoot3SM1Id);
    assertNotNull(subRoot3SM1);
    assertEquals("Sub Root 3 Searchmark 1", subRoot3SM1.getName());
    assertProperties(subRoot3SM1);

    subSubRoot1SM1 = (ISearchMark) dao.load(subSubRoot1SM1Id);
    assertNotNull(subSubRoot1SM1);
    assertEquals("Sub Sub Root 1 Searchmark 1", subSubRoot1SM1.getName());
    assertProperties(subSubRoot1SM1);

    subSubSubRoot1SM1 = (ISearchMark) dao.load(subSubSubRoot1SM1Id);
    assertNotNull(subSubSubRoot1SM1);
    assertEquals("Sub Sub Sub Root 1 Searchmark 1", subSubSubRoot1SM1.getName());
    assertProperties(subSubSubRoot1SM1);
  }
View Full Code Here

TOP

Related Classes of org.rssowl.core.internal.persist.dao.CachingDAO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.