Package org.rssowl.core.model.reference

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


    IFolder folder = fDao.saveFolder(fFactory.createFolder(null, null, "Root"));

    IFeed feed = createFeedWithNews(new URL("http://www.url.com"), 100, 20, today - 7 * DAY, today - 6 * DAY, 0);
    fFactory.createBookMark(null, folder, feed.getLink(),
        new FeedReference(feed.getId()), "BookMark1");

    fDao.saveFolder(folder);

    IBookMark bookmark = (IBookMark) folder.getMarks().get(0);
    assertEquals(100, countNews(bookmark));
View Full Code Here


    IFolder folder = fDao.saveFolder(fFactory.createFolder(null, null, "Root"));

    IFeed feed = createFeedWithNews(new URL("http://www.url.com"), 100, 20, today - 7 * DAY, today - 6 * DAY, 0);
    fFactory.createBookMark(null, folder, feed.getLink(),
        new FeedReference(feed.getId()), "BookMark1");

    fDao.saveFolder(folder);

    IBookMark bookmark = (IBookMark) folder.getMarks().get(0);
    assertEquals(100, countNews(bookmark));
View Full Code Here

    IFolder folder = fDao.saveFolder(fFactory.createFolder(null, null, "Root"));

    IFeed feed = createFeedWithNews(new URL("http://www.url.com"), 100, 20, today - 7 * DAY, today - 6 * DAY, 0);
    fFactory.createBookMark(null, folder, feed.getLink(),
        new FeedReference(feed.getId()), "BookMark1");

    fDao.saveFolder(folder);

    IBookMark bookmark = (IBookMark) folder.getMarks().get(0);
    assertEquals(100, countNews(bookmark));
View Full Code Here

    IFolder folder = fDao.saveFolder(fFactory.createFolder(null, null, "Root"));

    IFeed feed = createFeedWithNews(new URL("http://www.url.com"), 100, 20, today - 7 * DAY, today - 6 * DAY, 0);
    fFactory.createBookMark(null, folder, feed.getLink(),
        new FeedReference(feed.getId()), "BookMark1");

    fDao.saveFolder(folder);

    IBookMark bookmark = (IBookMark) folder.getMarks().get(0);
    assertEquals(100, countNews(bookmark));
View Full Code Here

    IFolder folder = fDao.saveFolder(fFactory.createFolder(null, null, "Root"));

    IFeed feed = createFeedWithNews(new URL("http://www.url.com"), 100, 20, today - 7 * DAY, today - 6 * DAY, 10);
    fFactory.createBookMark(null, folder, feed.getLink(),
        new FeedReference(feed.getId()), "BookMark1");

    fDao.saveFolder(folder);

    IBookMark bookmark = (IBookMark) folder.getMarks().get(0);
    assertEquals(100, countNews(bookmark));
View Full Code Here

    IFolder folder = fDao.saveFolder(fFactory.createFolder(null, null, "Root"));

    IFeed feed = createFeedWithNews(new URL("http://www.url.com"), 100, 20, today - 7 * DAY, today - 6 * DAY, 0);
    fFactory.createBookMark(null, folder, feed.getLink(),
        new FeedReference(feed.getId()), "BookMark");

    fDao.saveFolder(folder);

    /* Add unpersisted News */
    INews news1 = fFactory.createNews(null, feed, new Date());
View Full Code Here

    IFolder folder = fDao.saveFolder(fFactory.createFolder(null, null, "Root"));

    IFeed feed = createFeedWithNews(new URL("http://www.url.com"), 100, 20, today - 7 * DAY, today - 6 * DAY, 0);
    fFactory.createBookMark(null, folder, feed.getLink(),
        new FeedReference(feed.getId()), "BookMark");

    fDao.saveFolder(folder);

    /* Add unpersisted News */
    INews news1 = fFactory.createNews(null, feed, new Date());
View Full Code Here

    IFolder folder = fDao.saveFolder(fFactory.createFolder(null, null, "Root"));

    IFeed feed = createFeedWithNews(new URL("http://www.url.com"), 100, 20, today - 7 * DAY, today - 6 * DAY, 0);
    fFactory.createBookMark(null, folder, feed.getLink(),
        new FeedReference(feed.getId()), "BookMark");

    fDao.saveFolder(folder);

    /* Add unpersisted News */
    INews news1 = fFactory.createNews(null, feed, new Date());
View Full Code Here

      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);

      final int addedCounter[] = new int[] { 0 };
      final int updatedCounter[] = new int[] { 0 };
      newsListener = new NewsListener() {
        public void newsAdded(Set<NewsEvent> events) {
          addedCounter[0] += events.size();
        }

        public void newsDeleted(Set<NewsEvent> events) {
          fail("Did not expect this Event");
        }

        public void newsUpdated(Set<NewsEvent> events) {
          updatedCounter[0] += events.size();
        }
      };
      NewsModel.getDefault().addNewsListener(newsListener);

      /* First Reload */
      InMemoryProtocolHandler.FEED = generateFeed("Title", "http://www.link.de", null, null, "Hello World", "bpasero", null, "mp3");
      fController.reload(bookmark, null, new NullProgressMonitor());
      assertEquals(1, feedRef.resolve().getNews().size());
      assertEquals(1, getUnreadCount(feed));
      assertEquals(1, getNewCount(feed));
      assertEquals(INews.State.NEW, feedRef.resolve().getNews().get(0).getState());
      assertEquals("Hello World", feedRef.resolve().getNews().get(0).getDescription());
      assertEquals("bpasero", feedRef.resolve().getNews().get(0).getAuthor().getName());

      /* Set to Unread */
      fApplicationLayer.setNewsState(feedRef.resolve().getNews(), INews.State.UNREAD, true, false);

      /* Second Reload - changed Description */
      InMemoryProtocolHandler.FEED = generateFeed("Title", "http://www.link.de", null, null, "Hello World Changed", "bpasero", null, "mp3");
      fController.reload(bookmark, null, new NullProgressMonitor());
      assertEquals(1, feedRef.resolve().getNews().size());
      assertEquals(1, getUnreadCount(feed));
      assertEquals(0, getNewCount(feed));
      assertEquals(INews.State.UNREAD, feedRef.resolve().getNews().get(0).getState());
      assertEquals("Hello World Changed", feedRef.resolve().getNews().get(0).getDescription());

      /* Set to Unread and Reload */
      fApplicationLayer.setNewsState(feedRef.resolve().getNews(), INews.State.UNREAD, true, false);
      fController.reload(bookmark, null, new NullProgressMonitor());

      /* This Reload - added Enclosure */
      InMemoryProtocolHandler.FEED = generateFeed("Title", "http://www.link.de", null, null, "Hello World Changed", "bpasero", "http://www.download.de", "mp3");
      fController.reload(bookmark, null, new NullProgressMonitor());
      assertEquals(1, feedRef.resolve().getNews().size());
      assertEquals(1, getUnreadCount(feed));
      assertEquals(0, getNewCount(feed));
      assertEquals(INews.State.UNREAD, feedRef.resolve().getNews().get(0).getState());
      assertEquals(1, feedRef.resolve().getNews().get(0).getAttachments().size());
      assertEquals("http://www.download.de", feedRef.resolve().getNews().get(0).getAttachments().get(0).getUrl().toString());

      /* This Reload - Changed Author */
      InMemoryProtocolHandler.FEED = generateFeed("Title", "http://www.link.de", null, null, "Hello World Changed", "ijuma", "http://www.download.de", "mp3");
      fController.reload(bookmark, null, new NullProgressMonitor());
      assertEquals(1, feedRef.resolve().getNews().size());
      assertEquals(1, getUnreadCount(feed));
      assertEquals(0, getNewCount(feed));
      assertEquals(INews.State.UNREAD, feedRef.resolve().getNews().get(0).getState());
      assertEquals("ijuma", feedRef.resolve().getNews().get(0).getAuthor().getName());

      /* Test Event Counter */
      assertEquals(1, addedCounter[0]);
      assertEquals(3, updatedCounter[0]);
    } finally {
View Full Code Here

    AttachmentListener attachmentListener = null;
    try {
      IFeed feed = new Feed(new URL("inmemory://rss_2_0.xml")); //$NON-NLS-1$
      feed = NewsModel.getDefault().getPersistenceLayer().getModelDAO().saveFeed(feed);

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

      IBookMark bookmark = createBookMark(feed);

      final int addedCounter[] = new int[] { 0 };
      final int updatedCounter[] = new int[] { 0 };
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.