Examples of retrieveFeed()


Examples of com.sun.syndication.fetcher.FeedFetcher.retrieveFeed()

      e.printStackTrace();
      fail(e.getMessage());
    }
 
    try {
      SyndFeed feed = feedFetcher.retrieveFeed(new URL("http://localhost:"+testPort+"/rome/FetcherTestServlet?error=500"));
      fail("5xx error handling did not work correctly");
    } catch (FetcherException e) {
      // expect this exception
      assertEquals(500, e.getResponseCode());
    } catch (Exception e) {
View Full Code Here

Examples of com.sun.syndication.fetcher.FeedFetcher.retrieveFeed()

  public void testFetchEvents() {
    FeedFetcher feedFetcher = getFeedFetcher();
    FetcherEventListenerImpl listener = new FetcherEventListenerImpl();
    feedFetcher.addFetcherEventListener(listener);
    try {
      SyndFeed feed = feedFetcher.retrieveFeed(new URL("http://localhost:"+testPort+"/rome/FetcherTestServlet/"));
      assertNotNull(feed);
      assertTrue(listener.polled);
      assertTrue(listener.retrieved);
      assertFalse(listener.unchanged);
      listener.reset();
View Full Code Here

Examples of com.sun.syndication.fetcher.FeedFetcher.retrieveFeed()

      assertFalse(listener.unchanged);
      listener.reset();
 
      // since there is no cache, the events fired should be exactly the same if
      // we re-retrieve the feed
      feed = feedFetcher.retrieveFeed(new URL("http://localhost:"+testPort+"/rome/FetcherTestServlet/"));
      assertNotNull(feed);
      assertTrue(listener.polled);
      assertTrue(listener.retrieved);
      assertFalse(listener.unchanged);
      listener.reset();
View Full Code Here

Examples of com.sun.syndication.fetcher.FeedFetcher.retrieveFeed()

    FeedFetcherCache feedInfoCache = new HashMapFeedInfoCache();
    FeedFetcher feedFetcher = getFeedFetcher(feedInfoCache);
    FetcherEventListenerImpl listener = new FetcherEventListenerImpl();
    feedFetcher.addFetcherEventListener(listener);
    try {
      SyndFeed feed = feedFetcher.retrieveFeed(new URL("http://localhost:"+testPort+"/rome/FetcherTestServlet/"));
      assertNotNull(feed);
      assertTrue(listener.polled);
      assertTrue(listener.retrieved);
      assertFalse(listener.unchanged);
      listener.reset();
View Full Code Here

Examples of com.sun.syndication.fetcher.FeedFetcher.retrieveFeed()

      assertFalse(listener.unchanged);
      listener.reset();
 
      // Since the feed is cached, the second request should not
      // actually retrieve the feed
      feed = feedFetcher.retrieveFeed(new URL("http://localhost:"+testPort+"/rome/FetcherTestServlet/"));
      assertNotNull(feed);
      assertTrue(listener.polled);
      assertFalse(listener.retrieved);
      assertTrue(listener.unchanged);
      listener.reset();
View Full Code Here

Examples of com.sun.syndication.fetcher.FeedFetcher.retrieveFeed()

      assertFalse(listener.retrieved);
      assertTrue(listener.unchanged);
      listener.reset();
 
      // now simulate getting the feed after it has changed
      feed = feedFetcher.retrieveFeed(new URL("http://localhost:"+testPort+"/rome/FetcherTestServlet?refreshfeed=TRUE"));
      assertNotNull(feed);
      assertTrue(listener.polled);
      assertTrue(listener.retrieved);
      assertFalse(listener.unchanged);
      listener.reset();
View Full Code Here

Examples of com.sun.syndication.fetcher.FeedFetcher.retrieveFeed()

   *
   */
  public void testGZippedFeed() {
      FeedFetcher feedFetcher = getFeedFetcher();
    try {
      SyndFeed feed = feedFetcher.retrieveFeed(new URL("http://localhost:"+testPort+"/rome/FetcherTestServlet?gzipfeed=TRUE"));
      assertNotNull(feed);
      assertEquals("atom_0.3.feed.title", feed.getTitle());
    } catch (Exception e) {
      e.printStackTrace();
      fail(e.getMessage());
View Full Code Here

Examples of com.sun.syndication.fetcher.FeedFetcher.retrieveFeed()

    FeedFetcher feedFetcher = getFeedFetcher(feedInfoCache);         
    try {
        feedFetcher.setUsingDeltaEncoding(true);
       
        // first retrieval should just grab the default feed
      SyndFeed feed1 = feedFetcher.retrieveFeed(new URL("http://localhost:"+testPort+"/rome/FetcherTestServlet?deltaencode=TRUE&refreshfeed=TRUE"));
      assertNotNull(feed1);
      assertEquals("atom_0.3.feed.title", feed1.getTitle());
      assertEquals(2, feed1.getEntries().size());
      SyndEntry entry1 = (SyndEntry) feed1.getEntries().get(0);
      assertEquals("atom_0.3.feed.entry[0].title", entry1.getTitle());
View Full Code Here

Examples of com.sun.syndication.fetcher.impl.HttpClientFeedFetcher.retrieveFeed()

          {
            FeedFetcher feedFetcher = new HttpClientFeedFetcher(null, authenticateFeed(source.getAuthentication()));
            if ((null != source.getRssConfig()) && (null != source.getRssConfig().getUserAgent())) {
              feedFetcher.setUserAgent(source.getRssConfig().getUserAgent());
            }
            SyndFeed retVal = feedFetcher.retrieveFeed(new URL(this.cleanUrlStart(url)));
            if (null == retVal) {
              handleRssError(new RuntimeException("Unknown RSS error") , source);             
            }
            return retVal;
          }
View Full Code Here

Examples of com.sun.syndication.fetcher.impl.HttpClientFeedFetcher.retrieveFeed()

            FeedFetcherCache feedInfoCache = HashMapFeedInfoCache.getInstance();
            FeedFetcher feedFetcher = new HttpURLFeedFetcher(feedInfoCache);
            if ((null != source.getRssConfig()) && (null != source.getRssConfig().getUserAgent())) {
              feedFetcher.setUserAgent(source.getRssConfig().getUserAgent());
            }
            SyndFeed retVal = feedFetcher.retrieveFeed(new URL(this.cleanUrlStart(url)));
            if (null == retVal) {
              handleRssError(new RuntimeException("Unknown RSS error") , source);             
            }
            return retVal;
          }
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.