this.bmpMockDispatcher = new BmpMockDispatcher(this.registry, this.sessionFactory);
}
- @Test
+ @Test(timeout = 20000)
public void testCreateClient() throws Exception {
final int port = InetSocketAddressUtil.getRandomPort();
final InetSocketAddress serverAddr = InetSocketAddressUtil.getRandomLoopbackInetSocketAddress(port);
final ChannelFuture channelFuture = this.bmpMockDispatcher.createClient(InetSocketAddressUtil
.getRandomLoopbackInetSocketAddress(0), serverAddr);
- waitFutureSuccess(channelFuture);
final Channel channel = channelFuture.sync().channel();
assertTrue(channel.isActive());
new NioEventLoopGroup(), new NioEventLoopGroup(), this.registry, this.sessionFactory);
final ChannelFuture futureServer2 = bmpDispatcher2
.createServer(serverAddr, this.slf, KeyMapping.getKeyMapping());
- waitFutureSuccess(futureServer2);
+ futureServer2.sync();
checkEquals(() -> assertTrue(this.sl.getStatus()));
bmpDispatcher2.close();
checkEquals(() -> assertFalse(this.sl.getStatus()));
}
- @Test
+ @Test(timeout = 20000)
public void testCreateServer() throws Exception {
final int port = InetSocketAddressUtil.getRandomPort();
final BmpDispatcherImpl bmpDispatcher = new BmpDispatcherImpl(
new NioEventLoopGroup(), new NioEventLoopGroup(), this.registry, this.sessionFactory);
final ChannelFuture futureServer = this.bmpMockDispatcher.createServer(
new InetSocketAddress(InetAddresses.forString("0.0.0.0"), port));
- waitFutureSuccess(futureServer);
+ futureServer.sync();
final ChannelFuture channelFuture = bmpDispatcher.createClient(
InetSocketAddressUtil.getRandomLoopbackInetSocketAddress(port), this.slf, KeyMapping.getKeyMapping());
- waitFutureSuccess(channelFuture);
final Channel channel = channelFuture.sync().channel();
assertTrue(channel.isActive());