Package org.rssowl.core.persist.event

Examples of org.rssowl.core.persist.event.NewsEvent


   * (org.rssowl.core.persist.IEntity)
   */
  @Override
  protected final NewsEvent createSaveEventTemplate(INews entity) {
    INews oldNews = DBHelper.peekPersistedNews(fDb, entity);
    return new NewsEvent(oldNews, entity, true);
  }
View Full Code Here


    unreadNews2.setState(INews.State.UNREAD);

    INews hiddenNews2 = fFactory.createNews(7L, feed, new Date());
    hiddenNews2.setState(INews.State.HIDDEN);

    NewsEvent event1 = new NewsEvent(newNews, newNews, true);
    NewsEvent event2 = new NewsEvent(newNews, unreadNews, true);
    NewsEvent event3 = new NewsEvent(newNews, readNews, true);
    NewsEvent event4 = new NewsEvent(unreadNews, readNews2, true);
    NewsEvent event5 = new NewsEvent(unreadNews, unreadNews2, true);
    NewsEvent event6 = new NewsEvent(hiddenNews, hiddenNews, true);
    NewsEvent event7 = new NewsEvent(newNews, hiddenNews2, true);
    NewsEvent event8 = new NewsEvent(newNews, deletedNews, true);

    events.add(event1);
    assertEquals(false, CoreUtils.isNewStateChange(events));
    events.add(event4);
    assertEquals(false, CoreUtils.isNewStateChange(events));
View Full Code Here

    unreadNews2.setState(INews.State.UNREAD);

    INews hiddenNews2 = fFactory.createNews(7L, feed, new Date());
    hiddenNews2.setState(INews.State.HIDDEN);

    NewsEvent event1 = new NewsEvent(newNews, newNews, true);
    NewsEvent event2 = new NewsEvent(newNews, unreadNews, true);
    NewsEvent event3 = new NewsEvent(newNews, readNews, true);
    NewsEvent event4 = new NewsEvent(unreadNews, readNews2, true);
    NewsEvent event5 = new NewsEvent(unreadNews, unreadNews2, true);
    NewsEvent event6 = new NewsEvent(hiddenNews, hiddenNews, true);
    NewsEvent event7 = new NewsEvent(newNews, hiddenNews2, true);
    NewsEvent event8 = new NewsEvent(newNews, deletedNews, true);
    NewsEvent event9 = new NewsEvent(readNews, newNews, true);
    NewsEvent event10 = new NewsEvent(hiddenNews, unreadNews, true);
    NewsEvent event11 = new NewsEvent(readNews, unreadNews, true);

    events.add(event1);
    assertEquals(false, CoreUtils.changedFromReadToUnread(events));
    events.add(event4);
    assertEquals(false, CoreUtils.changedFromReadToUnread(events));
View Full Code Here

    unreadNews2.setState(INews.State.UNREAD);

    INews hiddenNews2 = fFactory.createNews(7L, feed, new Date());
    hiddenNews2.setState(INews.State.HIDDEN);

    NewsEvent event1 = new NewsEvent(newNews, newNews, true);
    NewsEvent event2 = new NewsEvent(deletedNews, unreadNews, true);
    NewsEvent event3 = new NewsEvent(hiddenNews, updatedNews, true);
    NewsEvent event4 = new NewsEvent(unreadNews, readNews, true);
    NewsEvent event5 = new NewsEvent(unreadNews, unreadNews2, true);
    NewsEvent event6 = new NewsEvent(hiddenNews, hiddenNews, true);
    NewsEvent event7 = new NewsEvent(newNews, hiddenNews2, true);
    NewsEvent event8 = new NewsEvent(newNews, deletedNews, true);

    events.add(event1);
    assertEquals(false, CoreUtils.isReadStateChange(events));
    events.add(event4);
    assertEquals(true, CoreUtils.isReadStateChange(events));
View Full Code Here

      unreadNews2.setState(INews.State.UNREAD);

      INews hiddenNews2 = fFactory.createNews(7L, feed, new Date());
      hiddenNews2.setState(INews.State.HIDDEN);

      NewsEvent event1 = new NewsEvent(newNews, newNews, true);
      NewsEvent event2 = new NewsEvent(newNews, unreadNews, true);
      NewsEvent event3 = new NewsEvent(newNews, readNews, true);
      NewsEvent event4 = new NewsEvent(unreadNews, readNews2, true);
      NewsEvent event5 = new NewsEvent(unreadNews, unreadNews2, true);
      NewsEvent event6 = new NewsEvent(hiddenNews, hiddenNews, true);
      NewsEvent event7 = new NewsEvent(newNews, hiddenNews2, true);
      NewsEvent event8 = new NewsEvent(newNews, deletedNews, true);

      events.add(event1);
      assertEquals(false, CoreUtils.isNewOrReadStateChange(events));
      events.add(event4);
      assertEquals(true, CoreUtils.isNewOrReadStateChange(events));
      events.add(event5);
      assertEquals(true, CoreUtils.isNewOrReadStateChange(events));
      events.add(event6);
      assertEquals(true, CoreUtils.isNewOrReadStateChange(events));
      events.add(event2);
      assertEquals(true, CoreUtils.isNewOrReadStateChange(events));
      events.add(event3);
      assertEquals(true, CoreUtils.isNewOrReadStateChange(events));

      events.clear();
      events.add(event7);
      assertEquals(true, CoreUtils.isNewOrReadStateChange(events));

      events.clear();
      events.add(event8);
      assertEquals(true, CoreUtils.isNewOrReadStateChange(events));
    }

    {
      IFeed feed = fFactory.createFeed(Long.valueOf(0L), new URI("http://www.rssowl.org"));

      Set<ModelEvent> events = new HashSet<ModelEvent>();

      INews newNews = fFactory.createNews(0L, feed, new Date());
      newNews.setState(INews.State.NEW);

      INews unreadNews = fFactory.createNews(1L, feed, new Date());
      unreadNews.setState(INews.State.UNREAD);

      INews readNews = fFactory.createNews(2L, feed, new Date());
      readNews.setState(INews.State.READ);

      INews hiddenNews = fFactory.createNews(3L, feed, new Date());
      hiddenNews.setState(INews.State.HIDDEN);

      INews deletedNews = fFactory.createNews(4L, feed, new Date());
      deletedNews.setState(INews.State.DELETED);

      INews updatedNews = fFactory.createNews(5L, feed, new Date());
      updatedNews.setState(INews.State.UPDATED);

      INews unreadNews2 = fFactory.createNews(6L, feed, new Date());
      unreadNews2.setState(INews.State.UNREAD);

      INews hiddenNews2 = fFactory.createNews(7L, feed, new Date());
      hiddenNews2.setState(INews.State.HIDDEN);

      NewsEvent event1 = new NewsEvent(newNews, newNews, true);
      NewsEvent event2 = new NewsEvent(deletedNews, unreadNews, true);
      NewsEvent event3 = new NewsEvent(hiddenNews, updatedNews, true);
      NewsEvent event4 = new NewsEvent(unreadNews, readNews, true);
      NewsEvent event5 = new NewsEvent(unreadNews, unreadNews2, true);
      NewsEvent event6 = new NewsEvent(hiddenNews, hiddenNews, true);
      NewsEvent event7 = new NewsEvent(newNews, hiddenNews2, true);
      NewsEvent event8 = new NewsEvent(newNews, deletedNews, true);

      events.add(event1);
      assertEquals(false, CoreUtils.isNewOrReadStateChange(events));
      events.add(event4);
      assertEquals(true, CoreUtils.isNewOrReadStateChange(events));
View Full Code Here

    feed.addNews(news1);
    feed.addNews(news2);
    feed.addNews(news3);

    NewsEvent event1 = new NewsEvent(news1, news2, true);
    assertEquals(false, CoreUtils.isDateChange(new HashSet<NewsEvent>(Arrays.asList(new NewsEvent[] { event1 }))));

    event1 = new NewsEvent(news1, news3, true);
    assertEquals(true, CoreUtils.isDateChange(new HashSet<NewsEvent>(Arrays.asList(new NewsEvent[] { event1 }))));
  }
View Full Code Here

    feed.addNews(news1);
    feed.addNews(news2);
    feed.addNews(news3);

    NewsEvent event1 = new NewsEvent(news1, news2, true);
    assertEquals(false, CoreUtils.isPublishedDateChange(new HashSet<NewsEvent>(Arrays.asList(new NewsEvent[] { event1 }))));

    event1 = new NewsEvent(news1, news3, true);
    assertEquals(true, CoreUtils.isPublishedDateChange(new HashSet<NewsEvent>(Arrays.asList(new NewsEvent[] { event1 }))));
  }
View Full Code Here

    feed.addNews(news1);
    feed.addNews(news2);
    feed.addNews(news3);

    NewsEvent event1 = new NewsEvent(news1, news2, true);
    assertEquals(false, CoreUtils.isModifiedDateChange(new HashSet<NewsEvent>(Arrays.asList(new NewsEvent[] { event1 }))));

    event1 = new NewsEvent(news1, news3, true);
    assertEquals(true, CoreUtils.isModifiedDateChange(new HashSet<NewsEvent>(Arrays.asList(new NewsEvent[] { event1 }))));
  }
View Full Code Here

    feed.addNews(news1);

    INews news1Bin = fFactory.createNews(news1, bin1);
    INews news2Bin = fFactory.createNews(news1, bin2);

    NewsEvent event1 = new NewsEvent(news1, news1Bin, true);
    assertEquals(false, CoreUtils.isLocationChange(new HashSet<NewsEvent>(Arrays.asList(new NewsEvent[] { event1 }))));

    event1 = new NewsEvent(news1Bin, news2Bin, true);
    assertEquals(true, CoreUtils.isLocationChange(new HashSet<NewsEvent>(Arrays.asList(new NewsEvent[] { event1 }))));
  }
View Full Code Here

    feed.addNews(news1);
    feed.addNews(news2);
    feed.addNews(news3);
    feed.addNews(news4);

    NewsEvent event1 = new NewsEvent(news1, news2, true);
    assertEquals(false, CoreUtils.isAuthorChange(new HashSet<NewsEvent>(Arrays.asList(new NewsEvent[] { event1 }))));

    event1 = new NewsEvent(news1, news3, true);
    assertEquals(true, CoreUtils.isAuthorChange(new HashSet<NewsEvent>(Arrays.asList(new NewsEvent[] { event1 }))));

    event1 = new NewsEvent(news1, news4, true);
    assertEquals(true, CoreUtils.isAuthorChange(new HashSet<NewsEvent>(Arrays.asList(new NewsEvent[] { event1 }))));

    event1 = new NewsEvent(news4, news1, true);
    assertEquals(true, CoreUtils.isAuthorChange(new HashSet<NewsEvent>(Arrays.asList(new NewsEvent[] { event1 }))));
  }
View Full Code Here

TOP

Related Classes of org.rssowl.core.persist.event.NewsEvent

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.