Package org.rssowl.core.internal.persist

Examples of org.rssowl.core.internal.persist.Feed


   */
  @Test
  @SuppressWarnings("nls")
  public void testRDFAbout() throws Exception {
    InputStream inS = getClass().getResourceAsStream("/data/interpreter/feed_rdf_about.xml");
    IFeed feed = new Feed(new URI("http://www.data.interpreter.feed_rdf_about.xml"));
    Owl.getInterpreter().interpret(inS, feed, null);

    assertEquals("RDF", feed.getFormat());
    assertEquals("rdf_title", feed.getTitle());
    assertEquals(new URI("rdf_link"), feed.getHomepage());
    assertEquals("rdf_description", feed.getDescription());
    assertEquals("rdf_rights", feed.getCopyright());
    assertEquals("en-us", feed.getLanguage());

    assertNotNull(feed.getAuthor());
    assertEquals("rdf_publisher", feed.getAuthor().getName());

    assertNotNull(feed.getPublishDate());

    assertNotNull(feed.getImage());
    assertEquals(new URI("rdf_image.url"), feed.getImage().getLink());
    assertEquals("rdf_image.title", feed.getImage().getTitle());
    assertEquals(new URI("rdf_image.link"), feed.getImage().getHomepage());

    assertEquals(3, feed.getNews().size());

    INews news1 = feed.getNews().get(0);
    assertEquals("rdf_item1.title", news1.getTitle());
    assertEquals(new URI("rdf_item1.link"), news1.getLink());
    assertEquals("rdf_item1.description", news1.getDescription());

    assertNotNull(news1.getGuid());
    assertEquals("rdf_item1.identifier", news1.getGuid().getValue());

    assertNotNull(news1.getPublishDate());

    assertNotNull(news1.getAuthor());
    assertEquals("rdf_item1.publisher", news1.getAuthor().getName());

    assertNotNull(news1.getSource());
    assertEquals(new URI("rdf_item1.source"), news1.getSource().getLink());

    INews news2 = feed.getNews().get(1);
    assertNotNull(news2.getGuid());
    assertEquals("rdf_item2.link", news2.getGuid().getValue());
    assertTrue(news2.getGuid().isPermaLink());

    INews news3 = feed.getNews().get(2);
    assertNull(news3.getGuid());
  }
View Full Code Here


   */
  @Test
  @SuppressWarnings("nls")
  public void testCDF() throws Exception {
    InputStream inS = getClass().getResourceAsStream("/data/interpreter/feed_cdf.xml");
    IFeed feed = new Feed(new URI("http://www.data.interpreter.feed_cdf.xml"));
    Owl.getInterpreter().interpret(inS, feed, null);

    assertEquals("CDF", feed.getFormat());
    assertEquals(new URI("cdf_base"), feed.getHomepage());
    assertNotNull(feed.getLastModifiedDate());
    assertEquals("cdf_title", feed.getTitle());
    assertEquals("cdf_abstract", feed.getDescription());

    assertEquals(3, feed.getNews().size());

    INews news1 = feed.getNews().get(0);
    assertEquals("cdf_entry1.title", news1.getTitle());
    assertEquals("cdf_entry1.abstract", news1.getDescription());
    assertEquals(new URI("cdf_base/cdf_entry1.href"), news1.getLink());
    assertNotNull(news1.getPublishDate());
  }
View Full Code Here

   */
  @Test
  @SuppressWarnings("nls")
  public void testOPML() throws Exception {
    InputStream inS = getClass().getResourceAsStream("/data/interpreter/feed_opml.xml");
    IFeed feed = new Feed(new URI("http://www.data.interpreter.feed_opml.xml"));
    Owl.getInterpreter().interpret(inS, feed, null);

    assertEquals("OPML", feed.getFormat());
    assertEquals("opml_title", feed.getTitle());
    assertNotNull(feed.getLastModifiedDate());
    assertNotNull(feed.getLastBuildDate());

    assertNotNull(feed.getAuthor());
    assertEquals("opml_ownername", feed.getAuthor().getName());
    assertEquals(new URI("opml_owneremail"), feed.getAuthor().getEmail());

    assertEquals(4, feed.getNews().size());

    INews news1 = feed.getNews().get(0);
    assertEquals("opml_outline1.title", news1.getTitle());
    assertEquals(new URI("opml_outline1.url"), news1.getLink());
    assertEquals("opml_outline1.text", news1.getDescription());

    INews news4 = feed.getNews().get(3);
    assertEquals("opml_outline4.title", news4.getTitle());
    assertEquals(new URI("opml_outline4.url"), news4.getLink());
    assertEquals("opml_outline4.text", news4.getDescription());
  }
View Full Code Here

   */
  @Test
  @SuppressWarnings("nls")
  public void testFormat() throws Exception {
    InputStream inS = getClass().getResourceAsStream("/data/interpreter/feed_format.xml");
    IFeed feed = new Feed(new URI("http://www.data.interpreter.feed_format.xml"));
    Owl.getInterpreter().interpret(inS, feed, null);

    assertEquals("MyFeed", feed.getFormat());
    assertEquals("format_custom", feed.getTitle());
    assertEquals("format_channel.sprache", feed.getLanguage());

    assertEquals(1, feed.getNews().size());

    INews news1 = feed.getNews().get(0);
    assertEquals("format_item1.title", news1.getTitle());
    assertEquals(new URI("format_item1.link"), news1.getLink());
    assertEquals("format_item1.description", news1.getDescription());
  }
View Full Code Here

   */
  @Test
  @SuppressWarnings("nls")
  public void testISO() throws Exception {
    InputStream inS = getClass().getResourceAsStream("/data/interpreter/feed_ISO-8859-1.xml");
    IFeed feed = new Feed(new URI("http://www.data.interpreter.feed_atom.xml"));
    Owl.getInterpreter().interpret(inS, feed, null);

    assertEquals("iso_title#\u00F6\u00E4\u00FC\u00DF", feed.getTitle());
    assertEquals("iso_description#\u00F6\u00E4\u00FC\u00DF", feed.getDescription());

    assertEquals(1, feed.getNews().size());

    INews news1 = feed.getNews().get(0);
    assertEquals("iso_item1.title#\u00F6\u00E4\u00FC\u00DF", news1.getTitle());
    assertEquals("iso_item1.description#\u00F6\u00E4\u00FC\u00DF", news1.getDescription());
  }
View Full Code Here

   */
  @Test
  @SuppressWarnings("nls")
  public void testEntities() throws Exception {
    InputStream inS = getClass().getResourceAsStream("/data/interpreter/feed_entities.xml");
    IFeed feed = new Feed(new URI("http://www.data.interpreter.feed_atom.xml"));
    Owl.getInterpreter().interpret(inS, feed, null);

    assertEquals("entities_title#\u00F6\u00E4\u00FC&<>", feed.getTitle());
    assertEquals("entities_description#\u00F6\u00E4\u00FC&<>", feed.getDescription());

    assertEquals(1, feed.getNews().size());

    INews news1 = feed.getNews().get(0);
    assertEquals("entities_item1.title#\u00F6\u00E4\u00FC&<>", news1.getTitle());
    assertEquals("entities_item1.description#\u00F6\u00E4\u00FC&<>", news1.getDescription());
  }
View Full Code Here

  @Test
  @Ignore
  @SuppressWarnings("nls")
  public void testUndeclaredEntities() throws Exception {
    InputStream inS = getClass().getResourceAsStream("/data/interpreter/feed_undeclared_entities.xml");
    IFeed feed = new Feed(new URI("http://www.data.interpreter.feed_atom.xml"));
    Owl.getInterpreter().interpret(inS, feed, null);

    assertEquals("entities_title#\u00F6\u00E4\u00FC&<>", feed.getTitle());
    assertEquals("entities_description#\u00F6\u00E4\u00FC&<>", feed.getDescription());

    assertEquals(1, feed.getNews().size());

    INews news1 = feed.getNews().get(0);
    assertEquals("entities_item1.title#\u00F6\u00E4\u00FC&<>", news1.getTitle());
    assertEquals("entities_item1.description#\u00F6\u00E4\u00FC&<>", news1.getDescription());
  }
View Full Code Here

   */
  @Test
  @SuppressWarnings("nls")
  public void testMediaTitle() throws Exception {
    InputStream inS = getClass().getResourceAsStream("/data/interpreter/feed_media_title.xml");
    IFeed feed = new Feed(new URI("http://www.data.interpreter.feed_rss.xml"));
    Owl.getInterpreter().interpret(inS, feed, null);

    assertEquals(1, feed.getNews().size());

    INews news1 = feed.getNews().get(0);
    assertEquals("News Title", news1.getTitle());
  }
View Full Code Here

    InputSource source = new InputSource(inS);
    org.w3c.dom.Document doc = documentBuilder.parse(source);
    inS.close();

    IFeed feed = new Feed(new URI("http://www.data.interpreter.feed_opml.xml"));
    Owl.getInterpreter().interpretW3CDocument(doc, feed);

    assertEquals("OPML", feed.getFormat());
    assertEquals("opml_title", feed.getTitle());
    assertNotNull(feed.getLastModifiedDate());
    assertNotNull(feed.getLastBuildDate());

    assertNotNull(feed.getAuthor());
    assertEquals("opml_ownername", feed.getAuthor().getName());
    assertEquals(new URI("opml_owneremail"), feed.getAuthor().getEmail());

    assertEquals(4, feed.getNews().size());

    INews news1 = feed.getNews().get(0);
    assertEquals("opml_outline1.title", news1.getTitle());
    assertEquals(new URI("opml_outline1.url"), news1.getLink());
    assertEquals("opml_outline1.text", news1.getDescription());

    INews news4 = feed.getNews().get(3);
    assertEquals("opml_outline4.title", news4.getTitle());
    assertEquals(new URI("opml_outline4.url"), news4.getLink());
    assertEquals("opml_outline4.text", news4.getDescription());
  }
View Full Code Here

   */
  @Test
  @SuppressWarnings("nls")
  public void testUnknownFormat() throws Exception {
    InputStream inS = getClass().getResourceAsStream("/data/interpreter/feed_unknown.xml");
    IFeed feed = new Feed(new URI("http://www.data.interpreter.feed_unknown.xml"));
    UnknownFormatException e = null;

    try {
      Owl.getInterpreter().interpret(inS, feed, null);
    } catch (UnknownFormatException e1) {
View Full Code Here

TOP

Related Classes of org.rssowl.core.internal.persist.Feed

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.