if (InetAddress.getLocalHost().getHostAddress().equals(loopbackIP)) {
fail("Local host address must not be the same as "
+ loopbackIP + " in order for this test case to run");
}
URI loopback = URIHelper.create(scheme, loopbackIP, port);
SocketRequestInfo acceptInfo = getSocketRequestInfo(loopback);
acceptInfo.setBindAll(false);
// create the acceptor
ManagedConnectionAcceptor acceptor
= createAcceptor(null, acceptInfo);
TestAcceptorEventListener listener = new TestAcceptorEventListener(
new TestInvocationHandler());
acceptor.accept(listener);
// connections to this should fail
String host = InetAddress.getLocalHost().getHostName();
URI localhost = URIHelper.create(scheme, host, port);
SocketRequestInfo failInfo = getSocketRequestInfo(localhost);
// verify that a connection can't be established
try {
createConnection(null, failInfo);