From 44ad81114c6f3fd0ecdb8c73f1ed5b25e0479c41 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** --- .../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 673eff62b1..ff7b489c7a 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 @@ -278,7 +278,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); @@ -328,7 +329,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); @@ -508,7 +510,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);