Package org.rssowl.core.persist.event

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


    try {
      IFeed feed = Owl.getModelFactory().createFeed(null, new URI("http://www.feed.com"));
      final boolean addedEvent[] = new boolean[1];
      final boolean deletedEvent[] = new boolean[1];

      feedListener = new NewsAdapter() {
        @Override
        public void entitiesAdded(Set<NewsEvent> events) {
          addedEvent[0] = true;
        }
View Full Code Here


      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);
View Full Code Here

    return fgNotificationPopup != null;
  }

  /* Startup this Service */
  private NewsListener registerListeners() {
    NewsListener listener = new NewsAdapter() {
      @Override
      public void entitiesAdded(final Set<NewsEvent> events) {
        onNewsAdded(events);
      }
    };
View Full Code Here

          });
        }
      };

      /* News Listener */
      fNewsListener = new NewsAdapter() {

        @Override
        public void entitiesAdded(final Set<NewsEvent> events) {
          JobRunner.runInUIThread(fViewer.getControl(), new Runnable() {
            public void run() {
View Full Code Here

      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();
          assertEquals(1, attachmentsSize);
View Full Code Here

    final News[] updatedNews = new News[1];
    final boolean[] NewsAddedCalled = new boolean[] { false };
    final boolean[] NewsUpdatedCalled = new boolean[] { false };
    NewsListener newsListener = null;
    try {
      newsListener = new NewsAdapter() {
        @Override
        public void entitiesAdded(Set<NewsEvent> events) {
          NewsEvent event = events.iterator().next();
          NewsAddedCalled[0] = true;
          initialFeed[0] = (Feed) initialNews.getFeedReference().resolve();
View Full Code Here

   */
  @Test
  public void testNewsManagerSetStateWithMultipleFeedsAndGuidNull() {
    final IFeed feed1;
    IFeed feed2;
    NewsAdapter newsAdapter;
    try {
      feed1 = DynamicDAO.save(createFeed());
      IFeed tempFeed = createFeed("http://adifferentlink.com");
      tempFeed.setTitle("A different title");
      feed2 = DynamicDAO.save(tempFeed);
    } catch (PersistenceException e) {
      fail(e.getMessage());
      return;
    }

    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());
      }
View Full Code Here

    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());
      }
View Full Code Here

    final AtomicInteger mode = new AtomicInteger(0);
    final AtomicInteger counter = new AtomicInteger(0);

    NewsListener listener = null;
    try {
      listener = new NewsAdapter() {
        @Override
        public void entitiesUpdated(Set<NewsEvent> events) {
          assertEquals(1, events.size());

          if (mode.get() == 0) {
View Full Code Here

    final AtomicInteger mode = new AtomicInteger(0);
    final AtomicInteger counter = new AtomicInteger(0);

    NewsListener listener = null;
    try {
      listener = new NewsAdapter() {
        @Override
        public void entitiesUpdated(Set<NewsEvent> events) {
          assertEquals(1, events.size());

          if (mode.get() == 0) {
View Full Code Here

TOP

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

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.