Package org.rssowl.core.persist.event

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


    INews savedNews = feed.getNews().get(0);
    final Long savedNewsId = savedNews.getId();
    savedNews.setTitle("News Title Updated #1");

    NewsListener newsListener = new NewsAdapter() {
      @Override
      public void entitiesUpdated(Set<NewsEvent> events) {
        assertEquals(1, events.size());
        NewsEvent event = events.iterator().next();
        assertEquals(savedNewsId, event.getEntity().getId());
View Full Code Here


    final AtomicBoolean listenerHit= new AtomicBoolean(false);

    IFeed feed = fFactory.createFeed(null, new URI("feed"));
    fFactory.createNews(null, feed, new Date());

    NewsListener listener = new NewsListener() {
      public void entitiesAdded(Set<NewsEvent> events) {
        listenerHit.set(true);

        for (NewsEvent event : events) {
          event.getEntity().getState();
View Full Code Here

    IFeed feed = fFactory.createFeed(null, new URI("feed"));
    final INews news = fFactory.createNews(null, feed, new Date());

    DynamicDAO.save(feed);

    NewsListener listener = new NewsListener() {
      public void entitiesUpdated(Set<NewsEvent> events) {
        listenerHit.set(true);

        for (NewsEvent event : events) {
          event.getEntity().getState();
View Full Code Here

    IFeed feed = fFactory.createFeed(null, new URI("feed"));
    final INews news = fFactory.createNews(null, feed, new Date());

    DynamicDAO.save(feed);

    NewsListener listener = new NewsListener() {
      public void entitiesDeleted(Set<NewsEvent> events) {
        listenerHit.set(true);

        for (NewsEvent event : events) {
          event.getEntity().getState();
View Full Code Here

   * @throws Exception
   */
  @Test
  public void testDeepFeedAddedEvents() throws Exception {
    FeedListener feedListener = null;
    NewsListener newsListener = null;
    AttachmentListener attachmentListener = null;
    PersonListener personListener = null;
    CategoryListener categoryListener = null;
    try {

View Full Code Here

   *
   * @throws Exception
   */
  @Test
  public void testDeepNewsAddedEvents() throws Exception {
    NewsListener newsListener = null;
    AttachmentListener attachmentListener = null;
    PersonListener personListener = null;
    CategoryListener categoryListener = null;
    try {
      IFeed feed = fFactory.createFeed(null, new URI("http://www.foobar.com"));
View Full Code Here

   *
   * @throws Exception
   */
  @Test
  public void testDeleteFeedNewsAndAttachment() throws Exception {
    NewsListener newsListener = null;
    AttachmentListener attachmentListener = null;
    try {
      IFeed feed = fFactory.createFeed(null, new URI("http://www.foobar.com"));
      FeedReference feedReference = new FeedReference(DynamicDAO.save(feed).getId());

      /* Check News Added */
      final INews news = fFactory.createNews(null, feedReference.resolve(), new Date());
      news.setTitle("News Title");
      final IAttachment attachment0 = fFactory.createAttachment(null, news);
      attachment0.setLink(new URI("http://www.attachment1.com"));
      final IAttachment attachment1 = fFactory.createAttachment(null, news);
      attachment1.setLink(new URI("http://www.attachment1.com"));
      DynamicDAO.save(feed);
      NewsReference newsRef = new NewsReference(feed.getNews().get(0).getId());
      AttachmentReference attachmentRef0 = new AttachmentReference(news.getAttachments().get(0).getId());
      AttachmentReference attachmentRef1 = new AttachmentReference(news.getAttachments().get(1).getId());

      final boolean[] newsDeleted = new boolean[1];
      newsListener = new NewsListener() {
        public void entitiesDeleted(Set<NewsEvent> events) {
          for (NewsEvent event : events) {
            assertFalse("Expected this Event to be no Root Event", event.isRoot());
            if (event.getEntity().getTitle().equals(news.getTitle()))
              newsDeleted[0] = true;
View Full Code Here

  /**
   * @throws Exception
   */
  @Test
  public void testDeleteAttachmentFiresNewsUpdatedEvent() throws Exception {
    NewsListener newsListener = null;
    AttachmentListener attachmentListener = null;
    try {
      final URI feedURI = new URI("http://www.foobar.com");
      IFeed feed = fFactory.createFeed(null, feedURI);
      FeedReference feedReference = new FeedReference(DynamicDAO.save(feed).getId());
View Full Code Here

   * @throws Exception
   */
  @Test
  public void testDeepFeedDeletedEvents() throws Exception {
    FeedListener feedListener = null;
    NewsListener newsListener = null;
    AttachmentListener attachmentListener = null;
    PersonListener personListener = null;
    CategoryListener categoryListener = null;
    NewsAdapter newsAdapter = null;
    try {
View Full Code Here

   *
   * @throws Exception
   */
  @Test
  public void testDeepNewsDeletedEvents() throws Exception {
    NewsListener newsListener = null;
    AttachmentListener attachmentListener = null;
    PersonListener personListener = null;
    CategoryListener categoryListener = null;
    try {

View Full Code Here

TOP

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

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.