Package org.apache.abdera.model

Examples of org.apache.abdera.model.Entry


  public static void testSection3112TextWithEscapedHtml() throws Exception {
    //http://feedvalidator.org/testcases/atom/3.1.1.2/text_with_escaped_html.xml
    IRI uri = baseURI.resolve("3.1.1.2/text_with_escaped_html.xml");
    Document<Feed> doc = get(uri);
    assertNotNull(doc);
    Entry entry = doc.getRoot().getEntries().get(0);
    assertEquals(entry.getSummary().trim(), "So I was reading <a href=\"http://example.com/\">example.com</a> the other day, it's really interesting.");
  }
View Full Code Here


  public static void testSection3112ValidHtml() throws Exception {
    //http://feedvalidator.org/testcases/atom/3.1.1.2/valid_html.xml
    IRI uri = baseURI.resolve("3.1.1.2/valid_html.xml");
    Document<Feed> doc = get(uri);
    assertNotNull(doc);
    Entry entry = doc.getRoot().getEntries().get(0);
    assertEquals(entry.getSummary().trim(), "<h3>Heading</h3>");

  }
View Full Code Here

  public static void testSection411DuplicateEntries() throws Exception {
    //http://feedvalidator.org/testcases/atom/4.1.1/duplicate-entries.xml
    IRI uri = baseURI.resolve("4.1.1/duplicate-entries.xml");
    Document<Feed> doc = get(uri);
    assertNotNull(doc);
    Entry e1 = doc.getRoot().getEntries().get(0);
    Entry e2 = doc.getRoot().getEntries().get(1);
    assertEquals(e1.getId(),e2.getId());
    assertEquals(e1.getUpdated(),e2.getUpdated());
  }
View Full Code Here

  public static void testSection4111NoContentOrSummary() throws Exception {
    //http://feedvalidator.org/testcases/atom/4.1.1.1/no-content-or-summary.xml
    IRI uri = baseURI.resolve("4.1.1.1/no-content-or-summary.xml");
    Document<Feed> doc = get(uri);
    assertNotNull(doc);
    Entry entry = doc.getRoot().getEntries().get(0);
    assertNull(entry.getContent());
    assertNull(entry.getSummary());
  }
View Full Code Here

  public static void testSection412ContentSrcNoSummary() throws Exception {
    //http://feedvalidator.org/testcases/atom/4.1.2/content-src-no-summary.xml
    IRI uri = baseURI.resolve("4.1.2/content-src-no-summary.xml");
    Document<Feed> doc = get(uri);
    assertNotNull(doc);
    Entry entry = doc.getRoot().getEntries().get(0);
    assertNull(entry.getSummary());
    assertEquals(entry.getContentElement().getResolvedSrc(), new IRI("http://example.org/2003/12/13/atom03"));
  }
View Full Code Here

  public static void testSection412EntrySourceAuthor() throws Exception {
    //http://feedvalidator.org/testcases/atom/4.1.2/entry-source-author.xml
    IRI uri = baseURI.resolve("4.1.2/entry-source-author.xml");
    Document<Entry> doc = get(uri);
    assertNotNull(doc);
    Entry entry = doc.getRoot();
    assertNotNull(entry);
    assertNotNull(entry.getSource());
    assertNotNull(entry.getSource().getAuthor());
  }
View Full Code Here

  public static void testSection412LinkSameRelTypeHreflang() throws Exception {
    //http://feedvalidator.org/testcases/atom/4.1.2/link-same-rel-type-hreflang.xml
    IRI uri = baseURI.resolve("4.1.2/link-same-rel-type-hreflang.xml");
    Document<Feed> doc = get(uri);
    assertNotNull(doc);
    Entry entry = doc.getRoot().getEntries().get(0);
    assertEquals(entry.getAlternateLink().getResolvedHref(), new IRI("http://example.org/2003/12/13/atom02"));
  }
View Full Code Here

  public static void testSection412LinkSameRelTypeNoHreflang() throws Exception {
    //http://feedvalidator.org/testcases/atom/4.1.2/link-same-rel-type-no-hreflang.xml
    IRI uri = baseURI.resolve("4.1.2/link-same-rel-type-no-hreflang.xml");
    Document<Feed> doc = get(uri);
    assertNotNull(doc);
    Entry entry = doc.getRoot().getEntries().get(0);
    assertEquals(entry.getAlternateLink().getResolvedHref(), new IRI("http://example.org/2003/12/13/atom02"));
  }
View Full Code Here

   public static void testSection4133ContentXhtmlNoXhtmlDiv() throws Exception {
     //http://feedvalidator.org/testcases/atom/4.1.3.3/content-xhtml-no-xhtml-div.xml
     IRI uri = baseURI.resolve("4.1.3.3/content-xhtml-no-xhtml-div.xml");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Entry entry = doc.getRoot().getEntries().get(0);
     assertEquals(entry.getContentType(), Content.Type.XHTML);
     assertNull(entry.getContent());
   }
View Full Code Here

   public static void testSection4133ContentXhtmlNotmarkup() throws Exception {
     //http://feedvalidator.org/testcases/atom/4.1.3.3/content-xhtml-notmarkup.xml
     IRI uri = baseURI.resolve("4.1.3.3/content-xhtml-notmarkup.xml");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Entry entry = doc.getRoot().getEntries().get(0);
     assertEquals(entry.getContentType(), Content.Type.XHTML);
     String c = entry.getContent();
     c = c.replaceAll(">", "&gt;");
     assertEquals(c,"Some &lt;x&gt;bold&lt;/x&gt; text.");
   }
View Full Code Here

TOP

Related Classes of org.apache.abdera.model.Entry

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.