Package de.nava.informa.impl.basic

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


    this.method_name = name;
  }

  public void testParseDiveIntoMark() throws Exception {
    File inpFile = new File(getDataDir(), "diveintomark.xml");
    ChannelIF channel_mark = FeedParser.parse(new ChannelBuilder(), inpFile);
    assertEquals("dive into mark", channel_mark.getTitle());
    assertEquals(3, channel_mark.getItems().size());

    // test generator
    assertEquals("Movable Type", channel_mark.getGenerator());
View Full Code Here


    assertEquals(ChannelFormat.ATOM_0_3, channel_mark.getFormat());
  }

  public void testParseBloggerLinuxHelp() throws Exception {
    File inpFile = new File(getDataDir(), "atom-0.3-linuxhelp.xml");
    ChannelIF channel = FeedParser.parse(new ChannelBuilder(), inpFile);

    assertEquals(10, channel.getItems().size());
    assertEquals(ChannelFormat.ATOM_0_3, channel.getFormat());

    // check each item that for null values
View Full Code Here

    }
  }

  public void testEntryTitleFormat() throws Exception {
    File inpFile = new File(getDataDir(), "blink.xml");
    ChannelIF channel = FeedParser.parse(new ChannelBuilder(), inpFile);
    java.util.Iterator itemsColl = channel.getItems().iterator();
    // skip first entry
    itemsColl.next();
    while( itemsColl.hasNext() ) {
      Item item = (Item) itemsColl.next();
View Full Code Here

    }
    }

  public void testLanguage() throws Exception {
    File inpFile = new File(getDataDir(), "diveintomark.xml");
    ChannelIF channel = FeedParser.parse(new ChannelBuilder(), inpFile);

    assertEquals("en",channel.getLanguage());

    }
View Full Code Here

    }

  public void testCopyright() throws Exception {
    File inpFile = new File(getDataDir(), "multilink-linkblog.xml");
    ChannelIF channel = FeedParser.parse(new ChannelBuilder(), inpFile);

    //  test copyright text/plain
    assertEquals("Copyright (c) 2004 Mark Pilgrim", channel.getCopyright());

    inpFile = new File(getDataDir(), "diveintomark.xml");
    channel = FeedParser.parse(new ChannelBuilder(), inpFile);
    assertEquals("Copyright \u00a9 2004, Mark Pilgrim", channel.getCopyright());

    }
View Full Code Here

  /**
   * Tests parsing of feed with no version specified (0.3 is assumed).
   */
  public void testNoVersion() throws Exception {
    File inpFile = new File(getDataDir(), "ongoing.atom");
    FeedParser.parse(new ChannelBuilder(), inpFile);
  }
View Full Code Here

    FeedParser.parse(new ChannelBuilder(), inpFile);
  }

  public void testSummaryOnly() throws Exception {
    File inpFile = new File(getDataDir(), "atom-summary-only.xml");
    ChannelIF channel = FeedParser.parse(new ChannelBuilder(), inpFile);

    ItemIF[] items = (ItemIF[]) channel.getItems().toArray(new ItemIF[0]);
    assertEquals(3, items.length);

    assertEquals("Google <b>Blog</b>", items[1].getDescription());
View Full Code Here

  /**
   * Tests parsing of titles and descriptions with CDATA objects inside.
   */
  public void testCDATAInTitlesAndDescriptions() throws IOException, ParseException {
    File inpFile = new File(getDataDir(), "atomic-cdata.xml");
    ChannelIF feed = FeedParser.parse(new ChannelBuilder(), inpFile);

    Collection items = feed.getItems();
    assertEquals(1, items.size());

    Item item = (Item) items.iterator().next();
View Full Code Here

  }

  public void testSort() throws Exception {

    File inpFile = new File(getDataDir(), "snipsnap-org.rss");
    ChannelIF channel = FeedParser.parse(new ChannelBuilder(), inpFile);

    // convert from List to Array
    Set<ItemIF> itemsSet = channel.getItems();
    ItemIF[] items = itemsSet.toArray(new ItemIF[itemsSet.size()]);
    // sort news items
View Full Code Here

    CacheSettings cs = new CacheSettings();
    cs.setDefaultTtl(2000);

    File inpFile = new File(getDataDir(), "xmlhack-0.91.xml");
    try {
      ChannelIF channel = FeedParser.parse(new ChannelBuilder(), inpFile);

      //test RSS0.91 behavior
      assertEquals(2000, cs.getTtl(channel, -1L));

      String url = new Feed(channel).getLocation().toString();
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.