Package org.rssowl.core.internal.persist

Examples of org.rssowl.core.internal.persist.News


   */
  @Test(expected = IllegalArgumentException.class)
  public void testNewsDAOSetStateFromDeletedWithAffectEquivalentNews() {
    final IFeed feed;
    feed = DynamicDAO.save(createFeed());
    final News initialNews = (News) createNews(feed);
    initialNews.setState(State.NEW);
    INews newsItem = null;
    NewsReference newsRef = null;
    newsItem = DynamicDAO.save(initialNews);
    newsRef = new NewsReference(newsItem.getId());
    List<INews> newsList = new ArrayList<INews>();
View Full Code Here


   */
  @Test(expected = IllegalArgumentException.class)
  public void testNewsDAOSetStateFromHiddenWithAffectEquivalentNews() {
    final IFeed feed;
    feed = DynamicDAO.save(createFeed());
    final News initialNews = (News) createNews(feed);
    initialNews.setState(State.NEW);
    INews newsItem = null;
    NewsReference newsRef = null;
    newsItem = DynamicDAO.save(initialNews);
    newsRef = new NewsReference(newsItem.getId());
    List<INews> newsList = new ArrayList<INews>();
View Full Code Here

        newsRef[0] = new NewsReference(events.iterator().next().getEntity().getId());
      }
    };
    DynamicDAO.addEntityListener(INews.class, newsAdapter);

    final News initialNews1 = (News) createNews(feed1);
    initialNews1.setGuid(null);
    initialNews1.setState(State.NEW);
    final News initialNews2 = (News) createNews(feed2);
    initialNews2.setGuid(null);
    initialNews2.setState(State.NEW);

    INews newsItem1 = null;
    NewsReference newsRef1 = null;

    INews newsItem2 = null;
    NewsReference newsRef2 = null;

    NewsReference newsRef3 = null;
    try {
      DynamicDAO.save(feed1);
      newsRef1 = newsRef[0];
      newsItem1 = newsRef1.resolve();

      feed2 = DynamicDAO.save(feed2);
      newsRef2 = newsRef[0];
      newsItem2 = newsRef2.resolve();

      final News initialNews3 = (News) createNews(feed2);
      initialNews3.setTitle("Some other title");
      initialNews3.setGuid(null);
      initialNews3.setLink(null);
      initialNews3.setState(State.NEW);
      DynamicDAO.save(feed2);
      newsRef3 = newsRef[0];
    } catch (PersistenceException e) {
      fail(e.getMessage());
      return;
View Full Code Here

      feed2 = DynamicDAO.save(tempFeed);
    } catch (PersistenceException e) {
      fail(e.getMessage());
      return;
    }
    final News initialNews1 = (News) createNews(feed1);
    initialNews1.setState(State.NEW);
    final News initialNews2 = (News) createNews(feed2);
    initialNews2.setState(State.NEW);

    final NewsReference[] newsRef = new NewsReference[1];

    newsAdapter = new NewsAdapter() {
      @Override
      public void entitiesAdded(Set<NewsEvent> events) {
        assertEquals(1, events.size());
        newsRef[0] = new NewsReference(events.iterator().next().getEntity().getId());
      }
    };
    DynamicDAO.addEntityListener(INews.class, newsAdapter);
    INews newsItem1 = null;
    NewsReference newsRef1 = null;

    INews newsItem2 = null;
    NewsReference newsRef2 = null;

    NewsReference newsRef3 = null;
    try {
      DynamicDAO.save(feed1);
      newsRef1 = newsRef[0];
      newsItem1 = newsRef1.resolve();

      feed2 = DynamicDAO.save(feed2);
      newsRef2 = newsRef[0];
      newsItem2 = newsRef2.resolve();

      final News initialNews3 = (News) createNews(feed2);
      initialNews3.setTitle("Some other title");
      initialNews3.setGuid(null);
      initialNews3.setLink(null);
      initialNews3.setState(State.NEW);
      DynamicDAO.save(feed2);
      newsRef3 = newsRef[0];
    } catch (PersistenceException e) {
      fail(e.getMessage());
      return;
View Full Code Here

   * Tests {@link INewsDAO#setState(Collection, State, boolean, boolean)}.
   */
  @Test
  public void testNewsManagerSetStateWithGuidNull() {
    final IFeed feed = DynamicDAO.save(createFeed());
    final News initialNews = (News) createNews(feed);
    initialNews.setState(State.NEW);
    initialNews.setGuid(null);
    INews newsItem = null;
    NewsReference newsRef = null;
    newsItem = DynamicDAO.save(initialNews);
    newsRef = new NewsReference(newsItem.getId());
    List<INews> newsList = new ArrayList<INews>();
View Full Code Here

  @Test
  public void testIsDateChange() throws Exception {
    Date now = new Date();

    IFeed feed = new Feed(new URI("http://www.link.com"));
    INews news1 = new News(null, feed, new Date());
    news1.setPublishDate(now);

    INews news2 = new News(null, feed, new Date());
    news2.setPublishDate(now);

    INews news3 = new News(null, feed, new Date());
    news3.setPublishDate(new Date(System.currentTimeMillis() + 1000));

    feed.addNews(news1);
    feed.addNews(news2);
    feed.addNews(news3);
View Full Code Here

    IPerson author2 = new Person((Long) null);
    author2.setName("Bar");

    IFeed feed = new Feed(new URI("http://www.link.com"));
    INews news1 = new News(null, feed, new Date());
    news1.setAuthor(author1);

    INews news2 = new News(null, feed, new Date());
    news2.setAuthor(author1);

    INews news3 = new News(null, feed, new Date());
    news3.setPublishDate(new Date(System.currentTimeMillis() + 1000));
    news3.setAuthor(author2);

    INews news4 = new News(null, feed, new Date());

    feed.addNews(news1);
    feed.addNews(news2);
    feed.addNews(news3);
    feed.addNews(news4);
View Full Code Here

    ICategory cat3 = new Category();
    cat3.setName("Cat3");

    IFeed feed = new Feed(new URI("http://www.link.com"));
    INews news1 = new News(null, feed, new Date());
    news1.addCategory(cat1);

    INews news2 = new News(null, feed, new Date());
    news2.addCategory(cat1);

    INews news3 = new News(null, feed, new Date());
    news3.setPublishDate(new Date(System.currentTimeMillis() + 1000));
    news3.addCategory(cat2);

    INews news4 = new News(null, feed, new Date());
    news4.addCategory(cat1);
    news4.addCategory(cat2);

    INews news5 = new News(null, feed, new Date());

    INews news6 = new News(null, feed, new Date());
    news6.addCategory(cat1);
    news6.addCategory(cat2);
    news6.addCategory(cat3);

    INews news7 = new News(null, feed, new Date());
    news7.addCategory(cat1);
    news7.addCategory(cat3);

    feed.addNews(news1);
    feed.addNews(news2);
    feed.addNews(news3);
    feed.addNews(news4);
View Full Code Here

  public void testIsLabelChangeSingle() throws Exception {
    ILabel label1 = new Label(null, "Label1");
    ILabel label2 = new Label(null, "Label2");

    IFeed feed = new Feed(new URI("http://www.link.com"));
    INews news1 = new News(null, feed, new Date());
    news1.addLabel(label1);

    INews news2 = new News(null, feed, new Date());
    news2.addLabel(label1);

    INews news3 = new News(null, feed, new Date());
    news3.setPublishDate(new Date(System.currentTimeMillis() + 1000));
    news3.addLabel(label2);

    INews news4 = new News(null, feed, new Date());

    feed.addNews(news1);
    feed.addNews(news2);
    feed.addNews(news3);
    feed.addNews(news4);
View Full Code Here

    ILabel label1 = new Label(null, "Label1");
    ILabel label2 = new Label(null, "Label2");
    ILabel label3 = new Label(null, "Label3");

    IFeed feed = new Feed(new URI("http://www.link.com"));
    INews news1 = new News(null, feed, new Date());
    news1.addLabel(label1);
    news1.addLabel(label3);

    INews news2 = new News(null, feed, new Date());
    news2.addLabel(label1);

    INews news3 = new News(null, feed, new Date());
    news3.setPublishDate(new Date(System.currentTimeMillis() + 1000));
    news3.addLabel(label1);
    news3.addLabel(label2);

    INews news4 = new News(null, feed, new Date());

    feed.addNews(news1);
    feed.addNews(news2);
    feed.addNews(news3);
    feed.addNews(news4);
View Full Code Here

TOP

Related Classes of org.rssowl.core.internal.persist.News

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.