Package de.nava.informa.impl.basic

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


    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(2000L, cs.getTtl(channel, 10000L)); // ttl < MINIMAL_TTL
      assertEquals(360000L, cs.getTtl(channel, 360000L)); // ttl > MINIMAL_TTL
View Full Code Here


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

    File inpFile = new File(getDataDir(), "bloggy.rdf");
    try {
      ChannelIF channel = FeedParser.parse(new ChannelBuilder(), inpFile);

      //test RSS1.00 behavior
      assertEquals(2000, cs.getTtl(channel, -1L));
      assertEquals(2000L, cs.getTtl(channel, 10000L)); // ttl < MINIMAL_TTL
      assertEquals(360000L, cs.getTtl(channel, 360000L)); // ttl > MINIMAL_TTL
View Full Code Here

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

    File inpFile = new File(getDataDir(), "slashdot-010604.rdf");
    try {
      ChannelIF channel = FeedParser.parse(new ChannelBuilder(), inpFile);

      //UpdatePeriod/UpdateFrequency = hourly/1 in feed
      assertEquals(3600000, cs.getTtl(channel, -1L));
      assertEquals(3600000, cs.getTtl(channel, 10000L));
      assertEquals(3600005, cs.getTtl(channel, 3600005)); // > ttl of the feed
View Full Code Here

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

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

      //test RSS2.00 behavior
      assertEquals((60*60*1000), cs.getTtl(channel, -1L));
      assertEquals((60*60*1000), cs.getTtl(channel, 10000L));
      // < ttl of feed && > MINIMAL_TTL
View Full Code Here

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

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

      //test RSS0.91 behavior
      // default ttl used
      assertEquals(3000, cs.getTtl(channel, -1L));
View Full Code Here

    FeedManager FM = new FeedManager(ChannelUpdatePeriod.UPDATE_HOURLY, 2);
    CacheSettings cs = new CacheSettings();
    cs.setDefaultTtl(3000);

    try {
      ChannelIF channel = FeedParser.parse(new ChannelBuilder(), "http://www.intertwingly.net/blog/index.rss");//inpFile);

      String url = new Feed(channel).getLocation().toString();
      FM.removeFeed(url);
      FM.addFeed(url);
      FeedIF feedRef1 = FM.getFeed(url);
View Full Code Here

    cs.setDefaultTtl(3000);

    /* test RDF behavior, this feed has an updatePeriod element */
    File inpFile = new File(getDataDir(), "slashdot-010604.rdf");
    try {
      ChannelIF channel = FeedParser.parse(new ChannelBuilder(), inpFile);

      //test RSS0.91 behavior
      // default ttl used
      assertEquals(60 * 60 * 1000, cs.getTtl(channel, -1L));

      String url = new Feed(channel).getLocation().toString();
      FM.removeFeed(url);

      channel = FeedParser.parse(new ChannelBuilder(), inpFile);
      //System.err.println("channel:"+channel);
      url = new Feed(channel).getLocation().toString();
      FeedIF feedRef1 = FM.addFeed(url);
      t1 = feedRef1.getLastUpdated().getTime();
      try {
View Full Code Here

    // clean channel object
    channel = null;
   
    // read in again
    File inpFile = new File(exp_file);
    channel = FeedParser.parse(new ChannelBuilder(), inpFile);

    assertEquals(ch_title, channel.getTitle());
    assertEquals(ch_desc, channel.getDescription());
   
    Collection items = channel.getItems();
View Full Code Here

  }

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

    assertEquals(ChannelFormat.ATOM_1_0, channel.getFormat());

    assertEquals("Whatever....", channel.getTitle());
    assertEquals("Jayant Kumar", channel.getCreator());
View Full Code Here

    assertEquals(updtDate.getTime(), channel.getPubDate());
  }

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

    assertEquals(ChannelFormat.ATOM_1_0, channel.getFormat());
    assertEquals(25, channel.getItems().size());

    // check each item that for null values
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.