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 c72082ea7f
commit 86a7c6d9ee

View File

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