Example #1
0
  /** Tests the finding of first feed who's XML URL matches the given. */
  public void testFindFirstFeedByXmlURLSingleGuide() throws MalformedURLException {
    DirectFeed feed0 = new DirectFeed();
    feed0.setBaseTitle("0");
    feed0.setXmlURL(new URL("file://0"));
    DirectFeed feed1 = new DirectFeed();
    feed1.setBaseTitle("1");
    feed1.setXmlURL(new URL("file://test"));
    DirectFeed feed2 = new DirectFeed();
    feed2.setBaseTitle("2");
    feed2.setXmlURL(new URL("file://test"));

    StandardGuide guide1 = new StandardGuide();
    guide1.add(feed0);
    guide1.add(feed1);
    guide1.add(feed2);

    set.add(guide1);

    NetworkFeed feed = set.findDirectFeed(new URL("file://test"));
    assertTrue("Wrong feed found: " + feed, feed == feed1);
  }
Example #2
0
  /** Tests the finding of first feed who's XML URL matches the given. */
  public void testFindFirstFeedByXmlURLNoMatch() throws MalformedURLException {
    DirectFeed feed0 = new DirectFeed();
    feed0.setBaseTitle("0");
    feed0.setXmlURL(new URL("file://0"));

    StandardGuide guide1 = new StandardGuide();
    guide1.add(feed0);

    set.add(guide1);

    NetworkFeed feed = set.findDirectFeed(new URL("file://test"));
    assertNull("Feed should not be found.", feed);
  }