/** *Teststhat{@linkDefaultProxySelector#select(URI)}throws *{@linkIllegalArgumentException}whenpassed{@codenull}
*/
@Test publicvoid testIllegalArgForNull() { final ProxySelector selector = new DefaultProxySelector(); try {
selector.select(null); Assert.fail("select() was expected to fail for null URI");
} catch (IllegalArgumentException iae) { // expected
}
}
/** *Teststhat{@linkDefaultProxySelector}throwsa{@linkIllegalArgumentException} *forURIsthatdon'thavehostinformation * *@throwsException
*/
@Test publicvoid testIllegalArgForNoHost() throws Exception { final ProxySelector selector = new DefaultProxySelector();
assertFailsWithIAE(selector, new URI("http", "/test", null));
assertFailsWithIAE(selector, new URI("https", "/test2", null));
assertFailsWithIAE(selector, new URI("ftp", "/test3", null));
}
/** *Teststhat{@linkDefaultProxySelector}throwsa{@linkIllegalArgumentException} *forURIsthatdon'thaveprotocol/schemeinformation * *@throwsException
*/
@Test publicvoid testIllegalArgForNoScheme() throws Exception { final ProxySelector selector = new DefaultProxySelector();
assertFailsWithIAE(selector, new URI(null, "/test", null));
}
privatestaticvoid assertFailsWithIAE(final ProxySelector selector, final URI uri) { try {
selector.select(uri); Assert.fail("select() was expected to fail for URI " + uri);
} catch (IllegalArgumentException iae) { // expected
}
}
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.9Bemerkung:
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.