resolve intermittent failure - if broker closes socket on security excepiton before client gets response

This commit is contained in:
gtully 2016-05-25 12:51:56 +01:00
parent e467f34cc1
commit 3b626c9edc
1 changed files with 9 additions and 8 deletions

View File

@ -23,6 +23,7 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.IOException;
import java.io.StringReader;
import java.net.SocketTimeoutException;
import java.util.Arrays;
@ -891,10 +892,10 @@ public class StompTest extends StompTestSupport {
String frame = "CONNECT\n" + "login: dejanb\n" + "passcode:manager\n\n" + Stomp.NULL;
stompConnection.sendFrame(frame);
String f = stompConnection.receiveFrame();
assertTrue(f.startsWith("ERROR"));
assertClients(1);
try {
String f = stompConnection.receiveFrame();
assertTrue(f.startsWith("ERROR"));
} catch (IOException socketMayBeClosedFirstByBroker) {}
}
@Test(timeout = 60000)
@ -903,10 +904,10 @@ public class StompTest extends StompTestSupport {
String frame = "CONNECT\n" + "login:system\n" + "passcode: dejanb\n\n" + Stomp.NULL;
stompConnection.sendFrame(frame);
String f = stompConnection.receiveFrame();
assertTrue(f.startsWith("ERROR"));
assertClients(1);
try {
String f = stompConnection.receiveFrame();
assertTrue(f.startsWith("ERROR"));
} catch (IOException socketMayBeClosedFirstByBroker) {}
}
@Test(timeout = 60000)