Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.NullProgressMonitor


      };
      DynamicDAO.addEntityListener(INews.class, 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 */
      fNewsDao.setState(feedRef.resolve().getNews(), INews.State.UNREAD, true, false);
      assertEquals(1, updatedCounter[0]);

      /* 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());
      assertEquals(2, updatedCounter[0]);

      /* Set to Unread and Reload */
      fNewsDao.setState(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, feed.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).getLink().toString());
      assertEquals(3, updatedCounter[0]);

      /* This Reload - Changed Author */
      InMemoryProtocolHandler.FEED = generateFeed("Title", "http://www.link.de", null, null, "Hello World Changed", "ijuma", "http://www.download.de", "mp3");
      oldNewsListener = new NewsAdapter() {
        @Override
        public void entitiesUpdated(Set<NewsEvent> events) {
          assertEquals(1, events.size());
          int attachmentsSize = events.iterator().next().getOldNews().getAttachments().size();
          assertEquals(1, attachmentsSize);
        }
      };
      DynamicDAO.addEntityListener(INews.class, oldNewsListener);
      fController.reload(bookmark, null, new NullProgressMonitor());
      DynamicDAO.removeEntityListener(INews.class, oldNewsListener);
      assertEquals(1, feedRef.resolve().getNews().size());
      assertEquals(1, getUnreadCount(feed));
      assertEquals(0, getNewCount(feed));
      assertEquals(INews.State.UNREAD, feedRef.resolve().getNews().get(0).getState());
View Full Code Here


      };
      DynamicDAO.addEntityListener(IAttachment.class, attachmentListener);

      /* First Reload */
      InMemoryProtocolHandler.FEED = generateFeedWithEnclosure("Title", null, "http://www.mp3.com/me.mp3", "wav");
      fController.reload(bookmark, null, new NullProgressMonitor());

      /* Second Reload with different attachment type */
      InMemoryProtocolHandler.FEED = generateFeedWithEnclosure("Title", null, "http://www.mp3.com/me.mp3", "mp3");
      fController.reload(bookmark, null, new NullProgressMonitor());

      assertEquals(1, addedCounter[0]);
      assertEquals(1, updatedCounter[0]);
    } finally {
      if (attachmentListener != null)
View Full Code Here

    preferences.putInteger(DefaultPreferences.DEL_NEWS_BY_COUNT_VALUE, 0);
    preferences.putBoolean(DefaultPreferences.DEL_NEWS_BY_COUNT_STATE, true);

    /* First Reload */
    InMemoryProtocolHandler.FEED = generateFeed("Title", "http://www.link.de", null, null);
    fController.reload(bookmark, null, new NullProgressMonitor());
    assertEquals(1, feedRef.resolve().getNews().size());
    assertEquals(1, getUnreadCount(feed));
    assertEquals(1, getNewCount(feed));

    /* Set to UNREAD */
    fNewsDao.setState(feedRef.resolve().getNews(), INews.State.UNREAD, true, false);
    assertEquals(0, getNewCount(feed));

    /* Second Reload */
    fController.reload(bookmark, null, new NullProgressMonitor());
    assertEquals(0, getUnreadCount(feed));
    assertEquals(0, getNewCount(feed));

    /* Third Reload */
    InMemoryProtocolHandler.FEED = generateEmptyFeed();
    fController.reload(bookmark, null, new NullProgressMonitor());
    assertEquals(0, feedRef.resolve().getNews().size());
  }
View Full Code Here

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

      IBookMark bookmark = createBookMark(feed);

      InMemoryProtocolHandler.FEED = generateFeedWithDuplicateNews("News Title", null, null, null, "Description", null, null, null);
      fController.reload(bookmark, null, new NullProgressMonitor());
      assertEquals(1, feedRef.resolve().getNews().size());
      DynamicDAO.delete(feedRef.resolve());
    }

    /* Duplicate News with: Title, Link */
    {
      IFeed feed = new Feed(new URI("inmemory://rss_2_0.xml")); //$NON-NLS-1$
      feed = DynamicDAO.save(feed);

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

      IBookMark bookmark = createBookMark(feed);

      InMemoryProtocolHandler.FEED = generateFeedWithDuplicateNews("News Title", "http://www.link.com", null, null, "Description", null, null, null);
      fController.reload(bookmark, null, new NullProgressMonitor());
      assertEquals(1, feedRef.resolve().getNews().size());
      DynamicDAO.delete(feedRef.resolve());
    }

    /* Duplicate News with: Title, Guid */
    {
      IFeed feed = new Feed(new URI("inmemory://rss_2_0.xml")); //$NON-NLS-1$
      feed = DynamicDAO.save(feed);

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

      IBookMark bookmark = createBookMark(feed);

      InMemoryProtocolHandler.FEED = generateFeedWithDuplicateNews("News Title", null, "http://www.link.com", null, "Description", null, null, null);
      fController.reload(bookmark, null, new NullProgressMonitor());
      assertEquals(1, feedRef.resolve().getNews().size());
      DynamicDAO.delete(feedRef.resolve());
    }

    /* Duplicate News with: Title, Link, Guid */
    {
      IFeed feed = new Feed(new URI("inmemory://rss_2_0.xml")); //$NON-NLS-1$
      feed = DynamicDAO.save(feed);

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

      IBookMark bookmark = createBookMark(feed);

      InMemoryProtocolHandler.FEED = generateFeedWithDuplicateNews("News Title", "http://www.link.com", "http://www.guid.com", null, "Description", null, null, null);
      fController.reload(bookmark, null, new NullProgressMonitor());
      assertEquals(1, feedRef.resolve().getNews().size());
      DynamicDAO.delete(feedRef.resolve());
    }
  }
View Full Code Here

      if (mark instanceof IBookMark) {
        final IBookMark bookmark = (IBookMark) mark;

        tasks.add(new TaskAdapter() {
          public IStatus run(IProgressMonitor monitor) {
            return fController.reload(bookmark, null, new NullProgressMonitor());
          }
        });
      }
    }
View Full Code Here

  @Test
  @SuppressWarnings( { "unchecked", "null" })
  public void testDefragment() {
    String dbPath = DBManager.getDBFilePath();
    File originDbFile = new File(dbPath + ".origin");
    DBHelper.copyFileIO(new File(dbPath), originDbFile, new NullProgressMonitor());
    File defragmentedDbFile = new File(dbPath + ".dest");
    DBManager.copyDatabase(originDbFile, defragmentedDbFile, new NullProgressMonitor());

    System.gc();
    ObjectContainer db = Db4o.openFile(DBManager.createConfiguration(false), originDbFile.getAbsolutePath());
    ObjectContainer defragmentedDb = Db4o.openFile(DBManager.createConfiguration(false), defragmentedDbFile.getAbsolutePath());
View Full Code Here

  @Test
  @SuppressWarnings("nls")
  public void testGetLabel() throws Exception {
    IConnectionService conManager = Owl.getConnectionService();
    URI feedUrl = new URI("http://www.rssowl.org/node/feed");
    String label = conManager.getLabel(feedUrl, new NullProgressMonitor());
    assertEquals("RSSOwl News", label);
  }
View Full Code Here

  @Test
  @SuppressWarnings("nls")
  public void testGetFavicon() throws Exception {
    IConnectionService conManager = Owl.getConnectionService();
    URI feedUrl = new URI("http://www.rssowl.org/node/feed");
    byte[] feedIcon = conManager.getFeedIcon(feedUrl, new NullProgressMonitor());
    assertNotNull(feedIcon);
    assertTrue(feedIcon.length != 0);
  }
View Full Code Here

  @SuppressWarnings("nls")
  public void testLoadFeedFromWebsiteWithRedirect() throws Exception {
    IConnectionService conManager = Owl.getConnectionService();
    URI feedUrl = new URI("http://www.planeteclipse.org");

    assertEquals("http://www.planeteclipse.org/planet/rss20.xml", conManager.getFeed(feedUrl, new NullProgressMonitor()).toString());
  }
View Full Code Here

  @SuppressWarnings("nls")
  public void testLoadFeedFromWebsiteWithoutRedirect() throws Exception {
    IConnectionService conManager = Owl.getConnectionService();
    URI feedUrl = new URI("http://www.heise.de");

    assertEquals("http://www.heise.de/newsticker/heise-atom.xml", conManager.getFeed(feedUrl, new NullProgressMonitor()).toString());
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.NullProgressMonitor

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.