Code example for URI

Methods: getScheme

0
        assertEquals("http://user:pa55w%3Frd@host:80/doc%7Csearch?q=green%20robots#over%206%22",
                uri.toString());
    } 
 
    public void testSchemeCaseIsNotCanonicalized() throws Exception { 
        URI uri = new URI("HTTP://host/path");
        assertEquals("HTTP", uri.getScheme());
    } 
 
    public void testEmptyAuthorityWithPath() throws Exception { 
        URI uri = new URI("http:///path");
        assertEquals(null, uri.getAuthority());
        assertEquals("/path", uri.getPath());
    } 
 
    public void testEmptyAuthorityWithQuery() throws Exception { 
        URI uri = new URI("http://?query");
        assertEquals(null, uri.getAuthority());
        assertEquals("", uri.getPath());
        assertEquals("query", uri.getQuery());
    }