// =====================================================================
// =====================================================================
// Test Expectations
// =====================================================================
ProtocolSocketChannelFactory factory =
new ProtocolSocketChannelFactory(Period.INDEFINITELY);
String host = "-unknown-host-";
try {
factory.createSocket(host, 8080);
fail("Did not detect unknown host");
} catch (UnknownHostException expected) {
assertEquals(host, expected.getMessage());
}
try {
factory.createSocket(host, 8080, InetAddress.getLocalHost(), 0);
fail("Did not detect unknown host");
} catch (UnknownHostException expected) {
assertEquals(host, expected.getMessage());
}
}