Examples of retrieveFeed()


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

   *
   */
  public void testGZippedFeed() {
      FeedFetcher feedFetcher = getFeedFetcher();
    try {
      SyndFeed feed = feedFetcher.retrieveFeed(new URL("http://localhost:8080/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:8080/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.FeedFetcher.retrieveFeed()

     
      // second retrieval should get only the new item
      /*
       * This is breaking with Rome 0.5 ??
       */
      SyndFeed feed2 = feedFetcher.retrieveFeed(new URL("http://localhost:8080/rome/FetcherTestServlet?deltaencode=TRUE&refreshfeed=TRUE"));         
      assertNotNull(feed2);
      assertEquals(FetcherTestServlet.DELTA_FEED_TITLE, feed2.getTitle());
      assertEquals(3, feed2.getEntries().size());
      entry1 = (SyndEntry) feed2.getEntries().get(0);
      assertEquals(FetcherTestServlet.DELTA_FEED_ENTRY_TITLE, entry1.getTitle());
View Full Code Here

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

  }

  public void testRetrieveFeed() {
    FeedFetcher feedFetcher = getFeedFetcher();
    try {
      SyndFeed feed = feedFetcher.retrieveFeed(new URL("http://localhost:8080/rome/FetcherTestServlet/"));
      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()

            server.addContext(context);   
           
            server.start();           
           
            FeedFetcher feedFetcher = getAuthenticatedFeedFetcher();
      SyndFeed feed = feedFetcher.retrieveFeed(new URL("http://localhost:8080/rome/FetcherTestServlet/"));
      assertNotNull(feed);
      assertEquals("atom_0.3.feed.title", feed.getTitle());
           
           
        } catch (Exception e) {
View Full Code Here

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

   *
   */
  public void testRetrieveRedirectedFeed() {
    FeedFetcher feedFetcher = getFeedFetcher();
    try {
      SyndFeed feed = feedFetcher.retrieveFeed(new URL("http://localhost:8080/rome/FetcherTestServlet?redirect=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()

   *
   */
  public void testErrorHandling() {
    FeedFetcher feedFetcher = getFeedFetcher();
    try {
      SyndFeed feed = feedFetcher.retrieveFeed(new URL("http://localhost:8080/rome/FetcherTestServlet?error=404"));
      fail("4xx error handling did not work correctly");
    } catch (FetcherException e) {
      // expect this exception
      assertEquals(404, e.getResponseCode());
    } catch (Exception e) {
View Full Code Here

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

      e.printStackTrace();
      fail(e.getMessage());
    }
 
    try {
      SyndFeed feed = feedFetcher.retrieveFeed(new URL("http://localhost:8080/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:8080/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:8080/rome/FetcherTestServlet/"));
      assertNotNull(feed);
      assertTrue(listener.polled);
      assertTrue(listener.retrieved);
      assertFalse(listener.unchanged);
      listener.reset();
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.