Code example for URI

Methods: getUserInfo

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