Package org.rssowl.core.model.reference

Examples of org.rssowl.core.model.reference.FeedReference


    IFeed feed = new Feed(new URL("inmemory://rss_2_0.xml")); //$NON-NLS-1$
    feed = NewsModel.getDefault().getPersistenceLayer().getModelDAO().saveFeed(feed);
    assertEquals(0, getUnreadCount(feed));
    assertEquals(0, getNewCount(feed));

    FeedReference feedRef = new FeedReference(feed.getId());

    IBookMark bookmark = createBookMark(feed);
    IPreferencesScope preferences = NewsModel.getDefault().getEntityScope(bookmark);
    preferences.putInteger(DefaultPreferences.DEL_NEWS_BY_COUNT_VALUE, 0);
    preferences.putBoolean(DefaultPreferences.DEL_NEWS_BY_COUNT_STATE, true);

    /* First Reload */
    InMemoryProtocolHandler.FEED = generateFeed("Title", "http://www.link.de", null, null);
    fController.reload(bookmark, null, new NullProgressMonitor());
    assertEquals(1, feedRef.resolve().getNews().size());
    assertEquals(1, getUnreadCount(feed));
    assertEquals(1, getNewCount(feed));

    /* Set to UNREAD */
    fApplicationLayer.setNewsState(feedRef.resolve().getNews(), INews.State.UNREAD, true, false);
    assertEquals(0, getNewCount(feed));

    /* Second Reload */
    fController.reload(bookmark, null, new NullProgressMonitor());
    assertEquals(0, getUnreadCount(feed));
    assertEquals(0, getNewCount(feed));

    /* Third Reload */
    InMemoryProtocolHandler.FEED = generateEmptyFeed();
    fController.reload(bookmark, null, new NullProgressMonitor());
    assertEquals(0, feedRef.resolve().getNews().size());
  }
View Full Code Here


  private IBookMark createBookMark(IFeed feed) throws PersistenceException {
    IModelDAO dao = NewsModel.getDefault().getPersistenceLayer().getModelDAO();
    IFolder folder = dao.saveFolder(NewsModel.getDefault().getTypesFactory().createFolder(null, null, "Root"));

    return dao.saveBookMark(NewsModel.getDefault().getTypesFactory().createBookMark(null, folder, feed.getLink(), new FeedReference(feed.getId()), "BookMark"));
  }
View Full Code Here

  public void testReloadFeed() throws Exception {
    IFeed feed = new Feed(new URL("http://www.rssowl.org/rssowl2dg/tests/manager/rss_2_0.xml")); //$NON-NLS-1$
    feed = NewsModel.getDefault().getPersistenceLayer().getModelDAO().saveFeed(feed);
    Controller.getDefault().reload(createBookMark(feed), null, new NullProgressMonitor());

    assertEquals(new FeedReference(feed.getId()).resolve().getFormat(), "RSS 2.0"); //$NON-NLS-1$
  }
View Full Code Here

    feed = NewsModel.getDefault().getPersistenceLayer().getModelDAO().saveFeed(feed);

    IFolder folder = NewsModel.getDefault().getTypesFactory().createFolder(null, null, "Folder");
    folder = NewsModel.getDefault().getPersistenceLayer().getModelDAO().saveFolder(folder);
    IBookMark bookmark = NewsModel.getDefault().getTypesFactory().createBookMark(
        null, folder, feed.getLink(), new FeedReference(feed.getId()), "BookMark");

    Controller.getDefault().reload(bookmark, null, new NullProgressMonitor());

    assertEquals(new FeedReference(feed.getId()).resolve().getFormat(), "RSS 2.0"); //$NON-NLS-1$
  }
View Full Code Here

    feed = NewsModel.getDefault().getPersistenceLayer().getModelDAO().saveFeed(feed);

    IFolder folder = NewsModel.getDefault().getTypesFactory().createFolder(null, null, "Folder");
    folder = NewsModel.getDefault().getPersistenceLayer().getModelDAO().saveFolder(folder);
    IBookMark bookmark = NewsModel.getDefault().getTypesFactory().createBookMark(
        null, folder, feed.getLink(), new FeedReference(feed.getId()), "BookMark");

    Controller.getDefault().reload(bookmark, null, new NullProgressMonitor());

    assertEquals(true, new BookMarkReference(bookmark.getId()).resolve().isErrorLoading());
  }
View Full Code Here

    feed = NewsModel.getDefault().getPersistenceLayer().getModelDAO().saveFeed(feed);

    IFolder folder = NewsModel.getDefault().getTypesFactory().createFolder(null, null, "Folder");
    folder = NewsModel.getDefault().getPersistenceLayer().getModelDAO().saveFolder(folder);
    IBookMark bookmark = NewsModel.getDefault().getTypesFactory().createBookMark(
        null, folder, feed.getLink(), new FeedReference(feed.getId()), "BookMark");

    Controller.getDefault().reload(bookmark, null, new NullProgressMonitor());

    int unreadCounter = getUnreadCount(feed);
    int newCounter = getNewCount(feed);
View Full Code Here

  private IBookMark createBookMark(IFeed feed) throws PersistenceException {
    IModelDAO dao = NewsModel.getDefault().getPersistenceLayer().getModelDAO();
    IFolder folder = dao.saveFolder(NewsModel.getDefault().getTypesFactory().createFolder(null, null, "Root"));

    return dao.saveBookMark(NewsModel.getDefault().getTypesFactory().createBookMark(
        null, folder, feed.getLink(), new FeedReference(feed.getId()), "BookMark"));
  }
View Full Code Here

TOP

Related Classes of org.rssowl.core.model.reference.FeedReference

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.