@Test
public void testExtractURIComponent() throws Exception {
String uriStr = "http://user-info@www.fool.com:8080/errors.log?foo=x&foo=y&foo=z#fragment";
URI uri = new URI(uriStr);
testExtractURIComponent2(uriStr, "scheme", uri.getScheme());
testExtractURIComponent2(uriStr, "authority", uri.getAuthority());
testExtractURIComponent2(uriStr, "path", uri.getPath());
testExtractURIComponent2(uriStr, "query", uri.getQuery());
testExtractURIComponent2(uriStr, "fragment", uri.getFragment());
testExtractURIComponent2(uriStr, "host", uri.getHost());
testExtractURIComponent2(uriStr, "port", uri.getPort());
testExtractURIComponent2(uriStr, "schemeSpecificPart", uri.getSchemeSpecificPart());
testExtractURIComponent2(uriStr, "userInfo", uri.getUserInfo());
try {
testExtractURIComponent2(uriStr, "illegalType", uri.getUserInfo());
fail();
} catch (MorphlineCompilationException e) {
;
}
testExtractURIComponent2("invalidURI:", "host", uri.getHost(), false);
}