Code example for URI

Methods: isAbsolute, isOpaque, resolve

0
        assertEquals("http://a/b/c/g;x=1/y", base.resolve("g;x=1/./y").toString());
        assertEquals("http://a/b/c/y", base.resolve("g;x=1/../y").toString());
    } 
 
    public void testRfc1808AbnormalExampleRelativeScheme() throws Exception { 
        URI base = new URI("http://a/b/c/d;p?q");
        URI uri = base.resolve("http:g");
        assertEquals("http:g", uri.toString()); // this is an opaque URI
        assertEquals(true, uri.isOpaque());
        assertEquals(true, uri.isAbsolute());
    } 
 
    public void testRfc1808AbnormalExampleQueryOrFragmentDots() throws Exception { 
        URI base = new URI("http://a/b/c/d;p?q");
        assertEquals("http://a/b/c/g?y/./x", base.resolve("g?y/./x").toString());
        assertEquals("http://a/b/c/g?y/../x", base.resolve("g?y/../x").toString());
        assertEquals("http://a/b/c/g#s/./x", base.resolve("g#s/./x").toString());
        assertEquals("http://a/b/c/g#s/../x", base.resolve("g#s/../x").toString());
    } 
 
    public void testSquareBracketsInUserInfo() throws Exception {