Browse Source

Allow Undertow client in websocket integration tests

It seems to work.
pull/1591/head
Rossen Stoyanchev 8 years ago
parent
commit
8cfa3c632b
  1. 11
      spring-webflux/src/test/java/org/springframework/web/reactive/socket/AbstractWebSocketIntegrationTests.java
  2. 6
      spring-webflux/src/test/java/org/springframework/web/reactive/socket/WebSocketIntegrationTests.java

11
spring-webflux/src/test/java/org/springframework/web/reactive/socket/AbstractWebSocketIntegrationTests.java

@ -62,8 +62,6 @@ import org.springframework.web.reactive.socket.server.upgrade.TomcatRequestUpgra @@ -62,8 +62,6 @@ import org.springframework.web.reactive.socket.server.upgrade.TomcatRequestUpgra
import org.springframework.web.reactive.socket.server.upgrade.UndertowRequestUpgradeStrategy;
import org.springframework.web.server.adapter.WebHttpHandlerBuilder;
import static org.junit.Assume.assumeFalse;
/**
* Base class for WebSocket integration tests. Sub-classes must implement
* {@link #getWebConfigClass()} to return Spring config class with (server-side)
@ -117,15 +115,6 @@ public abstract class AbstractWebSocketIntegrationTests { @@ -117,15 +115,6 @@ public abstract class AbstractWebSocketIntegrationTests {
@Before
public void setup() throws Exception {
// TODO
// Caused by: java.io.IOException: Upgrade responses cannot have a transfer coding
// at org.xnio.http.HttpUpgrade$HttpUpgradeState.handleUpgrade(HttpUpgrade.java:490)
// at org.xnio.http.HttpUpgrade$HttpUpgradeState.access$1200(HttpUpgrade.java:165)
// at org.xnio.http.HttpUpgrade$HttpUpgradeState$UpgradeResultListener.handleEvent(HttpUpgrade.java:461)
// at org.xnio.http.HttpUpgrade$HttpUpgradeState$UpgradeResultListener.handleEvent(HttpUpgrade.java:400)
// at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
assumeFalse(this.client instanceof UndertowWebSocketClient);
this.server.setHandler(createHttpHandler());
this.server.afterPropertiesSet();

6
spring-webflux/src/test/java/org/springframework/web/reactive/socket/WebSocketIntegrationTests.java

@ -63,7 +63,7 @@ public class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests @@ -63,7 +63,7 @@ public class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests
Flux<String> input = Flux.range(1, count).map(index -> "msg-" + index);
ReplayProcessor<Object> output = ReplayProcessor.create(count);
client.execute(getUrl("/echo"),
this.client.execute(getUrl("/echo"),
session -> {
logger.debug("Starting to send messages");
return session
@ -87,7 +87,7 @@ public class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests @@ -87,7 +87,7 @@ public class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests
AtomicReference<HandshakeInfo> infoRef = new AtomicReference<>();
MonoProcessor<Object> output = MonoProcessor.create();
client.execute(getUrl("/sub-protocol"),
this.client.execute(getUrl("/sub-protocol"),
new WebSocketHandler() {
@Override
public List<String> getSubProtocols() {
@ -117,7 +117,7 @@ public class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests @@ -117,7 +117,7 @@ public class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests
headers.add("my-header", "my-value");
MonoProcessor<Object> output = MonoProcessor.create();
client.execute(getUrl("/custom-header"), headers,
this.client.execute(getUrl("/custom-header"), headers,
session -> session.receive()
.map(WebSocketMessage::getPayloadAsText)
.subscribeWith(output)

Loading…
Cancel
Save