Package org.apache.abdera.i18n.iri

Examples of org.apache.abdera.i18n.iri.IRI.resolve()


      String charset = getCharacterEncoding();
      if (charset != null) options.setCharset(charset);
      IRI cl = getContentLocation();
      if (cl != null && !cl.isAbsolute()) {
        IRI r = new IRI(getUri());
        cl = r.resolve(cl);
      }
      String base = (cl != null) ? cl.toASCIIString() : getUri();
      Document<T> doc = parser.parse(getReader(), base, options);
      EntityTag etag = getEntityTag();
      if (etag != null) doc.setEntityTag(etag);
View Full Code Here


            return;
        Feed feed = doc.getRoot();
        assertNotNull(feed);
        Generator generator = feed.getGenerator();
        assertNotNull(generator);
        assertEquals(uri.resolve("misc/Colophon"), generator.getResolvedUri());
    }

    @Test
    public void testSection425IconInvalidUri() throws Exception {
        // http://feedvalidator.org/testcases/atom/4.2.5/icon_invalid_uri.xml
View Full Code Here

        if (doc == null)
            return;
        Feed feed = doc.getRoot();
        assertNotNull(feed);
        assertNotNull(feed.getIconElement());
        assertEquals(uri.resolve("favicon.ico"), feed.getIconElement().getResolvedValue());
    }

    @Test
    public void testSection426IdDotSegments() throws Exception {
        // http://feedvalidator.org/testcases/atom/4.2.6/id-dot-segments.xml
View Full Code Here

        Feed feed = doc.getRoot();
        List<Entry> entries = feed.getEntries();
        for (Entry entry : entries) {
            List<Link> links = entry.getLinks();
            for (Link link : links) {
                assertEquals(uri.resolve("/2003/12/13/atom03"), link.getResolvedHref());
            }
        }
    }

    @Test
View Full Code Here

        if (doc == null)
            return;

        Feed feed = doc.getRoot();
        assertNotNull(feed.getLogoElement());
        assertEquals(uri.resolve("atomlogo.png"), feed.getLogoElement().getResolvedValue());
    }

    @Test
    public void testSection429PublishedInvalidDate() throws Exception {
        // http://feedvalidator.org/testcases/atom/4.2.9/published-invalid-date.xml
View Full Code Here

        List<Entry> entries = feed.getEntries();
        for (Entry entry : entries) {
            Content content = entry.getContentElement();
            assertNotNull(content);
            assertEquals(Content.Type.MEDIA, content.getContentType());
            assertEquals(uri.resolve("2003/12/12/atom03.pdf"), content.getResolvedSrc());
        }
    }

    @Test
    public void testSection4132ContentSrcTypeHtml() throws Exception {
View Full Code Here

        Feed feed = doc.getRoot();
        assertNotNull(feed);
        List<Person> contr = feed.getContributors();
        for (Person person : contr) {
            assertEquals(new IRI("~jane/"), person.getUriElement().getValue());
            assertEquals(uri.resolve("~jane/"), person.getUriElement().getResolvedValue());
        }
    }

    @Test
    public void testSection323EmailRss20Style() throws Exception {
View Full Code Here

     List<Entry> entries = feed.getEntries();
     for (Entry entry : entries) {
       Content content = entry.getContentElement();
       assertNotNull(content);
       assertEquals(content.getContentType(), Content.Type.MEDIA);
       assertEquals(content.getResolvedSrc(), uri.resolve("2003/12/12/atom03.pdf"));
     }
   }
  
   @Test public void testSection4132ContentSrcTypeHtml() throws Exception {
     //http://feedvalidator.org/testcases/atom/4.1.3.2/content-src-type-html.xml
View Full Code Here

     assertNotNull(doc);
     Feed feed = doc.getRoot();
     assertNotNull(feed);
     Generator generator = feed.getGenerator();
     assertNotNull(generator);
     assertEquals(generator.getResolvedUri(), uri.resolve("misc/Colophon"));
   }
  
   @Test public void testSection425IconInvalidUri() throws Exception {
     //http://feedvalidator.org/testcases/atom/4.2.5/icon_invalid_uri.xml
     IRI uri = baseURI.resolve("4.2.5/icon_invalid_uri.xml");
View Full Code Here

     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Feed feed = doc.getRoot();
     assertNotNull(feed);
     assertNotNull(feed.getIconElement());
     assertEquals(feed.getIconElement().getResolvedValue(), uri.resolve("favicon.ico"));
   }
  
   @Test public void testSection426IdDotSegments() throws Exception {
     //http://feedvalidator.org/testcases/atom/4.2.6/id-dot-segments.xml
     IRI uri = baseURI.resolve("4.2.6/id-dot-segments.xml");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.