More meaningful assertion failure message

We see sporadic failure in EpollSocketConnectionAttemptTest. Generate
more useful failure message using hamcrest to know more.
This commit is contained in:
Trustin Lee 2015-06-04 12:06:15 +09:00
parent 311532feb0
commit 5d11be58ea

View File

@ -97,8 +97,8 @@ public class SocketConnectionAttemptTest extends AbstractClientSocketTest {
cb.handler(handler);
cb.option(ChannelOption.ALLOW_HALF_CLOSURE, halfClosure);
ChannelFuture future = cb.connect(NetUtil.LOCALHOST, TestUtils.getFreePort()).awaitUninterruptibly();
assertTrue(future.cause() instanceof ConnectException);
assertNull(errorPromise.cause());
assertThat(future.cause(), is(instanceOf(ConnectException.class)));
assertThat(errorPromise.cause(), is(nullValue()));
}
@Test