INT-3909: Upgrade to Tomcat-8.0.33

JIRA: https://jira.spring.io/browse/INT-3909

Un`@Ignore` the `ClientWebSocketContainerTests` to ensure that `Tomcat-8.0.33` has the fix for the closed WebSocket session race condition.

Fix `StompIntegrationTests` test data

Clean up queue channels before each test, because of some remained extra messages during the web-socket protocol interactions,
like socket close events or similar

Fix `RedisStoreInboundChannelAdapterIntegrationTests` race conditions

Since Jedis driver is async, we not always receive a reply from the `TX-sync` component immediately.
And loop checking the Redis for the `key` after some `Thread.sleep()`
This commit is contained in:
Artem Bilan
2016-04-11 11:12:24 -04:00
committed by Gary Russell
parent 993549111c
commit f48d019970
4 changed files with 25 additions and 5 deletions

View File

@@ -141,7 +141,7 @@ subprojects { subproject ->
saajImplVersion = '1.3.23'
servletApiVersion = '3.1.0'
slf4jVersion = "1.7.21"
tomcatVersion = "8.0.30"
tomcatVersion = "8.0.33"
smackVersion = '4.1.6'
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '1.6.0.BUILD-SNAPSHOT'
// springCloudClusterVersion = '1.0.0.BUILD-SNAPSHOT'

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -94,6 +94,13 @@ public class RedisStoreInboundChannelAdapterIntegrationTests extends RedisAvaila
//poll again, should get nothing since the collection was removed during synchronization
message = (Message<Integer>) redisChannel.receive(100);
assertNull(message);
int n = 0;
while (n++ < 100 && template.keys("bar").size() == 0) {
Thread.sleep(100);
}
assertTrue("Rename didn't occur", n < 100);
assertEquals(Long.valueOf(13), template.boundListOps("bar").size());
template.delete("bar");
@@ -161,6 +168,13 @@ public class RedisStoreInboundChannelAdapterIntegrationTests extends RedisAvaila
//poll again, should get nothing since the collection was removed during synchronization
message = (Message<Integer>) redisChannel.receive(100);
assertNull(message);
int n = 0;
while (n++ < 100 && template.keys("bar").size() == 0) {
Thread.sleep(100);
}
assertTrue("Rename didn't occur", n < 100);
assertEquals(Long.valueOf(13), template.boundListOps("bar").size());
template.delete("bar");

View File

@@ -35,7 +35,6 @@ import java.util.concurrent.TimeUnit;
import org.apache.tomcat.websocket.WsWebSocketContainer;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.web.socket.CloseStatus;
@@ -64,7 +63,6 @@ public class ClientWebSocketContainerTests {
}
@Test
@Ignore("Ignored until fix for https://bz.apache.org/bugzilla/show_bug.cgi?id=58624")
public void testClientWebSocketContainer() throws Exception {
StandardWebSocketClient webSocketClient = new StandardWebSocketClient();
Map<String, Object> userProperties = new HashMap<String, Object>();

View File

@@ -31,6 +31,7 @@ import java.util.Collections;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -125,7 +126,14 @@ public class StompIntegrationTests {
@Autowired
@Qualifier("webSocketEvents")
private PollableChannel webSocketEvents;
private QueueChannel webSocketEvents;
@Before
public void setup() {
this.webSocketInputChannel.clear();
this.webSocketEvents.clear();
}
@Test
public void sendMessageToController() throws Exception {