From e200e4811b69cc74f97d485843cc4d35ca11b56a Mon Sep 17 00:00:00 2001 From: Scott Mitchell Date: Wed, 1 Jun 2016 18:45:46 -0700 Subject: [PATCH] SocketRstTest fails due to exception message check Motivation: For lack of a better way the SocketRstTest inspects the content of the exception message to check if a RST occurred. However on windows the exception message is different than on other Unix based platforms and the assertion statement fails. Modifications: - Hack another string check in the unit test Result: SocketRstTest passes on windows Fixes https://github.com/netty/netty/issues/5335 --- .../io/netty/testsuite/transport/socket/SocketRstTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketRstTest.java b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketRstTest.java index d467f3f22a..4eb1b84653 100644 --- a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketRstTest.java +++ b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketRstTest.java @@ -35,7 +35,8 @@ import static org.junit.Assert.assertTrue; public class SocketRstTest extends AbstractSocketTest { protected void assertRstOnCloseException(IOException cause, Channel clientChannel) { if (Locale.getDefault() == Locale.US || Locale.getDefault() == Locale.UK) { - assertTrue("actual message: " + cause.getMessage(), cause.getMessage().contains("reset")); + assertTrue("actual message: " + cause.getMessage(), + cause.getMessage().contains("reset") || cause.getMessage().contains("closed")); } }