Code example for URI

Methods: resolve

0
        assertEquals("http://a/", base.resolve("../../").toString());
        assertEquals("http://a/g", base.resolve("../../g").toString());
    } 
 
    public void testRfc1808AbnormalExampleTooManyDotDotSequences() throws Exception { 
        URI base = new URI("http://a/b/c/d;p?q");
        assertEquals("http://a/g", base.resolve("../../../g").toString()); // RI doesn't normalize
        assertEquals("http://a/g", base.resolve("../../../../g").toString()); // fails on RI
    } 
 
    public void testRfc1808AbnormalExampleRemoveDotSegments() throws Exception { 
        URI base = new URI("http://a/b/c/d;p?q");
        assertEquals("http://a/g", base.resolve("/./g").toString()); // RI doesn't normalize
        assertEquals("http://a/g", base.resolve("/../g").toString()); // fails on RI
        assertEquals("http://a/b/c/g.", base.resolve("g.").toString());
        assertEquals("http://a/b/c/.g", base.resolve(".g").toString());
        assertEquals("http://a/b/c/g..", base.resolve("g..").toString());
        assertEquals("http://a/b/c/..g", base.resolve("..g").toString());
    } 
 
    public void testRfc1808AbnormalExampleNonsensicalDots() throws Exception {