Fix timing issue in test for STOMP Server

https://build.spring.io/browse/INT-MASTER-733

The Netty tries to load `netty-transport-native-epoll` too long, more
then 10 seconds we expect in the `AbstractStompSessionManager`, therefore
 we end up having `StompConnectionFailedEvent` as a first event in the
queue channel for STOMP events.

* Increase connection wait timeout to `30 secs`, like it is in many other
places in Spring
* Provide some Java 8 style refactoring for the `AbstractStompSessionManager`
* Fix `StompServerIntegrationTests` to poll events from queue until
`StompSessionConnectedEvent` any way
* Upgrade to Gradle 4.0 and `spring-io-plugin-0.0.8`
* Bump `org.sonarqube` version to `2.5` - `2.1` isn't compatible with Gradle 4.0
This commit is contained in:
Artem Bilan
2017-06-23 15:41:37 -04:00
parent 0903df9676
commit a1c42f65d0
6 changed files with 42 additions and 42 deletions

View File

@@ -118,9 +118,13 @@ public class StompServerIntegrationTests extends LogAdjustingTestSupport {
MessageChannel stompOutputChannel1 = context1.getBean("stompOutputChannel", MessageChannel.class);
MessageChannel stompOutputChannel2 = context2.getBean("stompOutputChannel", MessageChannel.class);
Message<?> eventMessage = stompEvents1.receive(10000);
Message<?> eventMessage;
do {
eventMessage = stompEvents1.receive(10000);
}
while (eventMessage != null && !(eventMessage.getPayload() instanceof StompSessionConnectedEvent));
assertNotNull(eventMessage);
assertThat(eventMessage.getPayload(), instanceOf(StompSessionConnectedEvent.class));
eventMessage = stompEvents1.receive(10000);
assertNotNull(eventMessage);