Package de.nava.informa.impl.basic

Examples of de.nava.informa.impl.basic.ChannelBuilder


    throws IOException, ParseException {

    super("TestRSS_0_91_Parser", name);
    if (channel == null) {
      File inpFile = new File(getDataDir(), "xmlhack-0.91.xml");
      channel = FeedParser.parse(new ChannelBuilder(), inpFile);
      // for later reference
      inpURL = inpFile.toURL();
    }
  }
View Full Code Here


    super("TestRSS_1_0_Parser", name);
    this.method_name = name;
    if (channel == null) {
      File inpFile = new File(getDataDir(), "bloggy.rdf");
      channel = FeedParser.parse(new ChannelBuilder(), inpFile);
      // for later reference
      inpURL = inpFile.toURL();
    }
  }
View Full Code Here

    assertEquals(expDate.getTime(), item.getDate());
  }

  public void testParseGoogleWeblog() throws Exception {
    File inpFile = new File(getDataDir(), "google-weblog.rdf");
    ChannelIF channel_gw = FeedParser.parse(new ChannelBuilder(), inpFile);
    assertEquals("Google Weblog", channel_gw.getTitle());
    assertEquals(15, channel_gw.getItems().size());
    assertEquals(ChannelFormat.RSS_1_0, channel_gw.getFormat());
  }
View Full Code Here

    assertEquals(ChannelFormat.RSS_1_0, channel_gw.getFormat());
  }

  public void testParseW3CSynd() throws Exception {
    File inpFile = new File(getDataDir(), "w3c-synd.rdf");
    ChannelIF channel_w3c = FeedParser.parse(new ChannelBuilder(), inpFile);
    assertEquals("World Wide Web Consortium", channel_w3c.getTitle());
    assertEquals(7, channel_w3c.getItems().size());
    assertEquals(ChannelFormat.RSS_1_0, channel_w3c.getFormat());
  }
View Full Code Here

    assertEquals(ChannelFormat.RSS_1_0, channel_w3c.getFormat());
  }

  public void testParseContentEncoded() throws Exception {
    File inpFile = new File(getDataDir(), "rss10-content-encoded.rdf");
    ChannelIF channel = FeedParser.parse(new ChannelBuilder(), inpFile);

    ItemIF[] items = (ItemIF[])channel.getItems().toArray(new ItemIF[0]);
    assertEquals(3, items.length);
    assertEquals("1&", items[0].getDescription());
    assertEquals("2", items[1].getDescription());
View Full Code Here

    throws IOException, ParseException {
   
    super("TestRSS_2_0_Parser", name);
    if (channel == null) {
      File inpFile = new File(getDataDir(), "informa-projnews.xml");
      channel = FeedParser.parse(new ChannelBuilder(), inpFile);
      // for later reference
      inpURL = inpFile.toURL();
    }
  }
View Full Code Here

    assertEquals(expDate.getTime(), item.getDate());
  }
 
  public void testParseW3CSynd() throws Exception {
    File inpFile = new File(getDataDir(), "msdn-rss2.xml");
    ChannelIF channel_msdn = FeedParser.parse(new ChannelBuilder(), inpFile);
    assertEquals("MSDN Just Published", channel_msdn.getTitle());
    assertEquals(63, channel_msdn.getItems().size());
    assertEquals(ChannelFormat.RSS_2_0, channel_msdn.getFormat());
  }
View Full Code Here

    assertEquals(ChannelFormat.RSS_2_0, channel_msdn.getFormat());
  }

  public void testParseYahooBusiness() throws Exception {
    File inpFile = new File(getDataDir(), "business.rss");
    ChannelIF channel_business = FeedParser.parse(new ChannelBuilder(), inpFile);
    assertEquals("Yahoo! News - Business", channel_business.getTitle());
    assertEquals("http://news.yahoo.com/news?tmpl=index&cid=1885",
                 channel_business.getSite().toString());
    assertEquals(9, channel_business.getItems().size())// two pairs of duplicates
    assertEquals(ChannelFormat.RSS_2_0, channel_business.getFormat());
View Full Code Here

    assertNotNull("Item not found", item);
  }

  public void testParseWithDefaultNS() throws Exception {
    File inpFile = new File(getDataDir(), "rss2withNS.xml");
    ChannelIF channel_wns = FeedParser.parse(new ChannelBuilder(), inpFile);
    assertEquals("Blogging Roller", channel_wns.getTitle());
    assertEquals(15, channel_wns.getItems().size());
    assertEquals(ChannelFormat.RSS_2_0, channel_wns.getFormat());
    assertEquals(((CategoryIF)((ItemIF)channel_wns.getItems().toArray()[0]).getCategories().toArray()[0]).getTitle(), "Roller");
  }
View Full Code Here

    assertEquals(((CategoryIF)((ItemIF)channel_wns.getItems().toArray()[0]).getCategories().toArray()[0]).getTitle(), "Roller");
  }

  public void testParseContentEncoded() throws Exception {
    File inpFile = new File(getDataDir(), "rss20-content-encoded.xml");
    ChannelIF channel = FeedParser.parse(new ChannelBuilder(), inpFile);

    ItemIF[] items = (ItemIF[])channel.getItems().toArray(new ItemIF[0]);
    assertEquals(3, items.length);
    assertEquals("1&", items[0].getDescription());
    assertEquals("2", items[1].getDescription());
View Full Code Here

TOP

Related Classes of de.nava.informa.impl.basic.ChannelBuilder

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.