From 5d11be58ea28c8832a2572acdbef7f467ccc19c0 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Thu, 4 Jun 2015 12:06:15 +0900 Subject: [PATCH] More meaningful assertion failure message We see sporadic failure in EpollSocketConnectionAttemptTest. Generate more useful failure message using hamcrest to know more. --- .../transport/socket/SocketConnectionAttemptTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketConnectionAttemptTest.java b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketConnectionAttemptTest.java index 3c716c8ada..1890d0d96a 100644 --- a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketConnectionAttemptTest.java +++ b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketConnectionAttemptTest.java @@ -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