From 176be69b0fef39781d24f6042e474e9f6178a4d6 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Mon, 19 Dec 2016 11:08:58 -0500 Subject: [PATCH] Fix expected messages for the TcpNioConnReadTests https://build.spring.io/browse/INT-MASTER-475/ https://build.spring.io/browse/INT-MJATS41-850/ **Cherry-pick to 4.3.x** (cherry picked from commit 44ad811) --- .../ip/tcp/connection/TcpNioConnectionReadTests.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionReadTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionReadTests.java index 937c5d92e1..f384f9ca86 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionReadTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionReadTests.java @@ -301,7 +301,8 @@ public class TcpNioConnectionReadTests { assertTrue(errorMessageLetch.await(10, TimeUnit.SECONDS)); assertThat(errorMessageRef.get().getMessage(), - containsString("ETX not found before max message length: 1024")); + anyOf(containsString("Connection is closed"), + containsString("ETX not found before max message length: 1024"))); assertTrue(semaphore.tryAcquire(10000, TimeUnit.MILLISECONDS)); assertTrue(removed.size() > 0); @@ -351,7 +352,8 @@ public class TcpNioConnectionReadTests { assertTrue(errorMessageLetch.await(10, TimeUnit.SECONDS)); assertThat(errorMessageRef.get().getMessage(), - containsString("CRLF not found before max message length: 1024")); + anyOf(containsString("Connection is closed"), + containsString("CRLF not found before max message length: 1024"))); assertTrue(semaphore.tryAcquire(10000, TimeUnit.MILLISECONDS)); assertTrue(removed.size() > 0); @@ -528,7 +530,8 @@ public class TcpNioConnectionReadTests { assertTrue(errorMessageLetch.await(10, TimeUnit.SECONDS)); assertThat(errorMessageRef.get().getMessage(), - containsString("Connection is closed")); + anyOf(containsString("Connection is closed"), + containsString("Socket closed during message assembly"))); assertTrue(semaphore.tryAcquire(10000, TimeUnit.MILLISECONDS)); assertTrue(removed.size() > 0);