Fixed a test failure where OioSocketServerBootstrapTest blocks indefinitely

This commit is contained in:
Trustin Lee 2009-08-19 09:26:01 +00:00
parent b0bdef67be
commit c861adf6e0

View File

@ -26,6 +26,7 @@ import static org.easymock.EasyMock.*;
import static org.junit.Assert.*;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.concurrent.Executor;
@ -109,8 +110,12 @@ public abstract class AbstractSocketServerBootstrapTest {
public void testFailedBindAttempt() throws Exception {
ServerBootstrap bootstrap = new ServerBootstrap();
bootstrap.setFactory(newServerSocketChannelFactory(executor));
bootstrap.setOption("localAddress", new InetSocketAddress("255.255.255.255", 0));
bootstrap.bind();
bootstrap.setOption(
"localAddress",
new InetSocketAddress(
InetAddress.getByAddress(new byte[] { -1, -1, -1, -1 }),
0));
bootstrap.bind().close().awaitUninterruptibly();
}
@Test(timeout = 30000)