Package com.colorfulsoftware.rss

Examples of com.colorfulsoftware.rss.Channel


      rss1 = rssDoc.readRSSToBean(expectedRSS1);
      assertNotNull(rss1);
      assertNotNull(rss1.getAttributes());
      assertNotNull(rss1.getChannel());
      assertNotNull(rss1.getExtensions());
      Channel channel = rss1.getChannel();
      assertNotNull(channel.getCategories());
      assertNotNull(channel.getRating());
      assertNotNull(channel.getManagingEditor());
      assertNotNull(channel.getCloud());
      assertNotNull(channel.getSkipDays());
      assertNotNull(channel.getSkipHours());
      assertNotNull(channel.getTtl());
      assertNotNull(channel.getWebMaster());

    } catch (Exception e) {
      e.printStackTrace();
      fail("should be working. " + e.getLocalizedMessage());
    }
View Full Code Here


      assertEquals(r.getMessage(),
          "rss elements MUST contain a channel element.");
    }

    try {
      Channel channel = rssDoc.buildChannel(rssDoc
          .buildTitle("this is a title"), rssDoc
          .buildLink("http://www.minoritydirectory.net"), rssDoc
          .buildDescription("this is a description"), null, null,
          null, null, null, null, null, null, null, null, null, null,
          null, null, null, null, null, null);
View Full Code Here

      fail("should not get here.");
    }

    try {
      rss1 = rssDoc.readRSSToBean(expectedRSS2);
      Channel channel = rss1.getChannel();
      List<Extension> extns = channel.getExtensions();
      if (extns == null) {
        extns = new LinkedList<Extension>();
      }
      // test a bound extension prefix.
      List<Attribute> attrs = new LinkedList<Attribute>();
      attrs.add(rssDoc.buildAttribute("xmlns:test", "http://12345.com"));
      extns.add(rssDoc.buildExtension("test:ext", attrs,
          "I am a bound extension element"));
      channel = rssDoc.buildChannel(channel.getTitle(),
          channel.getLink(), channel.getDescription(), channel
              .getLanguage(), channel.getCopyright(), channel
              .getManagingEditor(), channel.getWebMaster(),
          channel.getPubDate(), channel.getLastBuildDate(), channel
              .getCategories(), channel.getGenerator(), channel
              .getDocs(), channel.getCloud(), channel.getTtl(),
          channel.getImage(), channel.getRating(), channel
              .getTextInput(), channel.getSkipHours(), channel
              .getSkipDays(), extns, channel.getItems());
      assertNotNull(rssDoc.buildRSS(channel, rss1.getAttributes(), rss1
          .getExtensions()));

      // test an unbound extension prefix at the channel level.
      extns = new LinkedList<Extension>();
      extns.add(rssDoc.buildExtension("test:ext", null,
          "I am an unbound extension element"));
      channel = rssDoc.buildChannel(channel.getTitle(),
          channel.getLink(), channel.getDescription(), channel
              .getLanguage(), channel.getCopyright(), channel
              .getManagingEditor(), channel.getWebMaster(),
          channel.getPubDate(), channel.getLastBuildDate(), channel
              .getCategories(), channel.getGenerator(), channel
              .getDocs(), channel.getCloud(), channel.getTtl(),
          channel.getImage(), channel.getRating(), channel
              .getTextInput(), channel.getSkipHours(), channel
              .getSkipDays(), extns, channel.getItems());
      rssDoc
          .buildRSS(channel, rss1.getAttributes(), rss1
              .getExtensions());
      fail("should not get here");
    } catch (Exception e) {
View Full Code Here

      rss1 = rssDoc.readRSSToBean(expectedRSS1);
      assertNotNull(rss1);
      assertNotNull(rss1.getAttributes());
      assertNotNull(rss1.getChannel());
      assertNotNull(rss1.getExtensions());
      Channel channel = rss1.getChannel();
      assertNotNull(channel.getCategories());
      assertNotNull(channel.getRating());
      assertNotNull(channel.getManagingEditor());
      assertNotNull(channel.getCloud());
      assertNotNull(channel.getSkipDays());
      assertNotNull(channel.getSkipHours());
      assertNotNull(channel.getTtl());
      assertNotNull(channel.getWebMaster());

    } catch (Exception e) {
      e.printStackTrace();
      fail("should be working. " + e.getLocalizedMessage());
    }
View Full Code Here

      assertEquals(r.getMessage(),
          "rss elements MUST contain a channel element.");
    }

    try {
      Channel channel = rssDoc.buildChannel(rssDoc
          .buildTitle("this is a title"), rssDoc
          .buildLink("http://www.minoritydirectory.net"), rssDoc
          .buildDescription("this is a description"), null, null,
          null, null, null, null, null, null, null, null, null, null,
          null, null, null, null, null, null);
View Full Code Here

      fail("should not get here.");
    }

    try {
      rss1 = rssDoc.readRSSToBean(expectedRSS2);
      Channel channel = rss1.getChannel();
      List<Extension> extns = channel.getExtensions();
      if (extns == null) {
        extns = new LinkedList<Extension>();
      }
      // test a bound extension prefix.
      List<Attribute> attrs = new LinkedList<Attribute>();
      attrs.add(rssDoc.buildAttribute("xmlns:test", "http://12345.com"));
      extns.add(rssDoc.buildExtension("test:ext", attrs,
          "I am a bound extension element"));
      channel = rssDoc.buildChannel(channel.getTitle(),
          channel.getLink(), channel.getDescription(), channel
              .getLanguage(), channel.getCopyright(), channel
              .getManagingEditor(), channel.getWebMaster(),
          channel.getPubDate(), channel.getLastBuildDate(), channel
              .getCategories(), channel.getGenerator(), channel
              .getDocs(), channel.getCloud(), channel.getTtl(),
          channel.getImage(), channel.getRating(), channel
              .getTextInput(), channel.getSkipHours(), channel
              .getSkipDays(), extns, channel.getItems());
      assertNotNull(rssDoc.buildRSS(channel, rss1.getAttributes(), rss1
          .getExtensions()));

      // test an unbound extension prefix at the channel level.
      extns = new LinkedList<Extension>();
      extns.add(rssDoc.buildExtension("test:ext", null,
          "I am an unbound extension element"));
      channel = rssDoc.buildChannel(channel.getTitle(),
          channel.getLink(), channel.getDescription(), channel
              .getLanguage(), channel.getCopyright(), channel
              .getManagingEditor(), channel.getWebMaster(),
          channel.getPubDate(), channel.getLastBuildDate(), channel
              .getCategories(), channel.getGenerator(), channel
              .getDocs(), channel.getCloud(), channel.getTtl(),
          channel.getImage(), channel.getRating(), channel
              .getTextInput(), channel.getSkipHours(), channel
              .getSkipDays(), extns, channel.getItems());
      rssDoc
          .buildRSS(channel, rss1.getAttributes(), rss1
              .getExtensions());
      fail("should not get here");
    } catch (Exception e) {
View Full Code Here

      rss1 = rssDoc.readRSSToBean(expectedRSS1);
      assertNotNull(rss1);
      assertNotNull(rss1.getAttributes());
      assertNotNull(rss1.getChannel());
      assertNotNull(rss1.getExtensions());
      Channel channel = rss1.getChannel();
      assertNotNull(channel.getCategories());
      assertNotNull(channel.getRating());
      assertNotNull(channel.getManagingEditor());
      assertNotNull(channel.getCloud());
      assertNotNull(channel.getSkipDays());
      assertNotNull(channel.getSkipHours());
      assertNotNull(channel.getTtl());
      assertNotNull(channel.getWebMaster());

    } catch (Exception e) {
      e.printStackTrace();
      fail("should be working. " + e.getLocalizedMessage());
    }
View Full Code Here

      assertEquals(r.getMessage(),
          "rss elements MUST contain a channel element.");
    }

    try {
      Channel channel = rssDoc.buildChannel(
          rssDoc.buildTitle("this is a title"),
          rssDoc.buildLink("http://www.minoritydirectory.net"),
          rssDoc.buildDescription("this is a description"), null,
          null, null, null, null, null, null, null, null, null, null,
          null, null, null, null, null, null, null);
View Full Code Here

      fail("should not get here.");
    }

    try {
      rss1 = rssDoc.readRSSToBean(expectedRSS2);
      Channel channel = rss1.getChannel();
      List<Extension> extns = channel.getExtensions();
      if (extns == null) {
        extns = new LinkedList<Extension>();
      }
      // test a bound extension prefix.
      List<Attribute> attrs = new LinkedList<Attribute>();
      attrs.add(rssDoc.buildAttribute("xmlns:test", "http://12345.com"));
      extns.add(rssDoc.buildExtension("test:ext", attrs,
          "I am a bound extension element"));
      channel = rssDoc.buildChannel(channel.getTitle(),
          channel.getLink(), channel.getDescription(),
          channel.getLanguage(), channel.getCopyright(),
          channel.getManagingEditor(), channel.getWebMaster(),
          channel.getPubDate(), channel.getLastBuildDate(),
          channel.getCategories(), channel.getGenerator(),
          channel.getDocs(), channel.getCloud(), channel.getTtl(),
          channel.getImage(), channel.getRating(),
          channel.getTextInput(), channel.getSkipHours(),
          channel.getSkipDays(), extns, channel.getItems());
      assertNotNull(rssDoc.buildRSS(channel, rss1.getAttributes(),
          rss1.getExtensions()));

      // test an unbound extension prefix at the channel level.
      extns = new LinkedList<Extension>();
      extns.add(rssDoc.buildExtension("test:ext", null,
          "I am an unbound extension element"));
      channel = rssDoc.buildChannel(channel.getTitle(),
          channel.getLink(), channel.getDescription(),
          channel.getLanguage(), channel.getCopyright(),
          channel.getManagingEditor(), channel.getWebMaster(),
          channel.getPubDate(), channel.getLastBuildDate(),
          channel.getCategories(), channel.getGenerator(),
          channel.getDocs(), channel.getCloud(), channel.getTtl(),
          channel.getImage(), channel.getRating(),
          channel.getTextInput(), channel.getSkipHours(),
          channel.getSkipDays(), extns, channel.getItems());
      rssDoc.buildRSS(channel, rss1.getAttributes(), rss1.getExtensions());
      fail("should not get here");
    } catch (Exception e) {
      assertTrue(e instanceof RSSpectException);
      assertTrue(e
View Full Code Here

      rss1 = rssDoc.readRSSToBean(expectedRSS1);
      assertNotNull(rss1);
      assertNotNull(rss1.getAttributes());
      assertNotNull(rss1.getChannel());
      assertNotNull(rss1.getExtensions());
      Channel channel = rss1.getChannel();
      assertNotNull(channel.getCategories());
      assertNotNull(channel.getRating());
      assertNotNull(channel.getManagingEditor());
      assertNotNull(channel.getCloud());
      assertNotNull(channel.getSkipDays());
      assertNotNull(channel.getSkipHours());
      assertNotNull(channel.getTtl());
      assertNotNull(channel.getWebMaster());

    } catch (Exception e) {
      e.printStackTrace();
      fail("should be working. " + e.getLocalizedMessage());
    }
View Full Code Here

TOP

Related Classes of com.colorfulsoftware.rss.Channel

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.