Assert for another exception in TcpNioConReadTests
https://build.spring.io/browse/INT-MJATS41-847/ **Cherry-pick to 4.3.x**
This commit is contained in:
@@ -53,7 +53,7 @@ public class ByteArrayCrLfSerializer extends AbstractPooledBufferByteArraySerial
|
||||
int n = 0;
|
||||
int bite;
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Available to read:" + inputStream.available());
|
||||
logger.debug("Available to read: " + inputStream.available());
|
||||
}
|
||||
try {
|
||||
while (true) {
|
||||
@@ -67,8 +67,7 @@ public class ByteArrayCrLfSerializer extends AbstractPooledBufferByteArraySerial
|
||||
}
|
||||
buffer[n++] = (byte) bite;
|
||||
if (n >= this.maxMessageSize) {
|
||||
throw new IOException("CRLF not found before max message length: "
|
||||
+ this.maxMessageSize);
|
||||
throw new IOException("CRLF not found before max message length: " + this.maxMessageSize);
|
||||
}
|
||||
}
|
||||
return n - 1; // trim \r
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.integration.ip.tcp.connection;
|
||||
|
||||
import static org.hamcrest.Matchers.anyOf;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
@@ -431,7 +432,7 @@ 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);
|
||||
|
||||
Reference in New Issue
Block a user