Code example for URI

Methods: getQuery

0
        assertEquals("host", uri.getHost());
        assertEquals("/path", uri.getPath());
    } 
 
    public void testQueryOnly() throws Exception { 
        URI uri = new URI("http://host?query");
        assertEquals("host", uri.getHost());
        assertEquals("", uri.getPath());
        assertEquals("query", uri.getQuery());
    } 
 
    public void testFragmentOnly() throws Exception { 
        URI uri = new URI("http://host#fragment");
        assertEquals("host", uri.getHost());
        assertEquals("", uri.getPath());
        assertEquals(null, uri.getQuery());
        assertEquals("fragment", uri.getFragment());
    } 
 
    public void testAtSignInPath() throws Exception { 
        URI uri = new URI("http://host/file@foo");