Package org.rssowl.core.persist.reference

Examples of org.rssowl.core.persist.reference.NewsReference.resolve()


      NewsReference newsRef = new NewsReference(feedRef.resolve().getNews().get(0).getId());

      DynamicDAO.delete(feedRef.resolve());

      assertNull("Expected this Entity to be NULL", feedRef.resolve());
      assertNull("Expected this Entity to be NULL", newsRef.resolve());
    }
  }

  /**
   * @throws Exception
View Full Code Here


      fTypesFactory.createAttachment(null, news);
      DynamicDAO.save(feed);
      feed = null;
      news = null;
      System.gc();
      assertEquals(1, newsRef.resolve().getAttachments().size());
      newsListener = new NewsAdapter() {
        @Override
        public void entitiesUpdated(Set<NewsEvent> events) {
          assertEquals(1, events.size());
          int attachmentsSize = events.iterator().next().getOldNews().getAttachments().size();
View Full Code Here

          int attachmentsSize = events.iterator().next().getOldNews().getAttachments().size();
          assertEquals(1, attachmentsSize);
        }
      };
      DynamicDAO.addEntityListener(INews.class, newsListener);
      DynamicDAO.save(newsRef.resolve());
    } finally {
      if (newsListener != null)
        DynamicDAO.removeEntityListener(INews.class, newsListener);
    }
  }
View Full Code Here

    DynamicDAO.save(news);
    NewsReference newsRef = new NewsReference(news.getId());
    feed = null;
    news = null;
    System.gc();
    news = newsRef.resolve();
    assertNewsEquals(categoryName, attachmentLink, authorName, sourceLink, news);
    authorName = authorName + " changed";
    attachmentLink = createURI(attachmentLink.toString() + "/new");
    categoryName = categoryName + " changed";
    sourceLink = createURI(sourceLink.toString() + "/new");
View Full Code Here

    sourceLink = createURI(sourceLink.toString() + "/new");
    updateNews(authorName, attachmentLink, categoryName, sourceLink, news);
    DynamicDAO.save(news.getFeedReference().resolve());
    news = null;
    System.gc();
    news = newsRef.resolve();
    assertNewsEquals(categoryName, attachmentLink, authorName, sourceLink, news);
  }

  /**
   * Tests that {@link INewsDAO#save(INews)} cascades the complex types
View Full Code Here

    DynamicDAO.save(news);
    NewsReference newsRef = new NewsReference(news.getId());
    feed = null;
    news = null;
    System.gc();
    news = newsRef.resolve();
    assertNewsEquals(categoryName, attachmentLink, authorName, sourceLink, news);
    authorName = authorName + " changed";
    attachmentLink = createURI(attachmentLink.toString() + "/new");
    categoryName = categoryName + " changed";
    sourceLink = createURI(sourceLink.toString() + "/new");
View Full Code Here

    sourceLink = createURI(sourceLink.toString() + "/new");
    updateNews(authorName, attachmentLink, categoryName, sourceLink, news);
    DynamicDAO.save(news);
    news = null;
    System.gc();
    news = newsRef.resolve();
    assertNewsEquals(categoryName, attachmentLink, authorName, sourceLink, news);
  }

  /**
   * Tests that {@link DynamicDAO#saveAll(Collection)} cascades the complex
View Full Code Here

    DynamicDAO.saveAll(Collections.singletonList(news));
    NewsReference newsRef = new NewsReference(news.getId());
    feed = null;
    news = null;
    System.gc();
    news = newsRef.resolve();
    assertNewsEquals(categoryName, attachmentLink, authorName, sourceLink, news);
    authorName = authorName + " changed";
    attachmentLink = createURI(attachmentLink.toString() + "/new");
    categoryName = categoryName + " changed";
    sourceLink = createURI(sourceLink.toString() + "/new");
View Full Code Here

    sourceLink = createURI(sourceLink.toString() + "/new");
    updateNews(authorName, attachmentLink, categoryName, sourceLink, news);
    DynamicDAO.saveAll(Collections.singletonList(news));
    news = null;
    System.gc();
    news = newsRef.resolve();
    assertNewsEquals(categoryName, attachmentLink, authorName, sourceLink, news);
  }

  private void updateNews(String authorName, URI attachmentLink, String categoryName, URI sourceLink, INews news) {
    news.getAuthor().setName(authorName);
View Full Code Here

    newsItem = DynamicDAO.save(initialNews);
    newsRef = new NewsReference(newsItem.getId());
    List<INews> newsList = new ArrayList<INews>();
    newsList.add(newsItem);
    Owl.getPersistenceService().getDAOService().getNewsDAO().setState(newsList, State.UPDATED, true, false);
    INews news = newsRef.resolve();
    assertEquals(State.UPDATED, news.getState());
    Owl.getPersistenceService().getDAOService().getNewsDAO().setState(newsList, State.DELETED, true, false);
    news = newsRef.resolve();
    assertEquals(State.DELETED, news.getState());
    Owl.getPersistenceService().getDAOService().getNewsDAO().setState(newsList, State.HIDDEN, false, false);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.