throw UnknownHostException if host is not found in InetAddress.getByName

This commit is contained in:
Joel Dice
2013-12-18 10:43:11 -07:00
parent 5f40c1642e
commit 59d5bbbb1a
2 changed files with 18 additions and 8 deletions

View File

@ -291,6 +291,14 @@ public class Misc {
expect(java.util.Arrays.equals
(new byte[] { 0, 0, 0, 0 },
java.net.InetAddress.getByName("0.0.0.0").getAddress()));
try {
java.net.InetAddress.getByName
("bs.thisdomaindoesntexistseriouslynoway");
throw new AssertionError();
} catch (java.net.UnknownHostException e) {
// cool
}
}
protected class Protected { }