Upgrade to Undertow 1.4 CR3 (and Jackson 2.8 GA)
This commit also renames WebSocketIntegrationTests to WebSocketHandshakeTests. Issue: SPR-14328
This commit is contained in:
@@ -64,7 +64,7 @@ import org.springframework.web.socket.sockjs.frame.SockJsFrame;
|
||||
|
||||
/**
|
||||
* An XHR transport based on Undertow's {@link io.undertow.client.UndertowClient}.
|
||||
* Requires Undertow 1.3 or higher, as of Spring Framework 5.0.
|
||||
* Requires Undertow 1.3 or 1.4, including XNIO, as of Spring Framework 5.0.
|
||||
*
|
||||
* <p>When used for testing purposes (e.g. load testing) or for specific use cases
|
||||
* (like HTTPS configuration), a custom OptionMap should be provided:
|
||||
@@ -461,7 +461,7 @@ public class UndertowXhrTransport extends AbstractXhrTransport {
|
||||
|
||||
public void onFailure(Throwable failure) {
|
||||
IoUtils.safeClose(this.connection);
|
||||
if (connectFuture.setException(failure)) {
|
||||
if (this.connectFuture.setException(failure)) {
|
||||
return;
|
||||
}
|
||||
if (this.session.isDisconnected()) {
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.util.Map;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
@@ -48,8 +47,6 @@ import org.springframework.web.socket.server.support.DefaultHandshakeHandler;
|
||||
*/
|
||||
public abstract class AbstractWebSocketIntegrationTests {
|
||||
|
||||
protected Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private static Map<Class<?>, Class<?>> upgradeStrategyConfigTypes = new HashMap<>();
|
||||
|
||||
static {
|
||||
@@ -58,6 +55,7 @@ public abstract class AbstractWebSocketIntegrationTests {
|
||||
upgradeStrategyConfigTypes.put(UndertowTestServer.class, UndertowUpgradeStrategyConfig.class);
|
||||
}
|
||||
|
||||
|
||||
@Rule
|
||||
public final TestName testName = new TestName();
|
||||
|
||||
@@ -67,12 +65,13 @@ public abstract class AbstractWebSocketIntegrationTests {
|
||||
@Parameter(1)
|
||||
public WebSocketClient webSocketClient;
|
||||
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
protected AnnotationConfigWebApplicationContext wac;
|
||||
|
||||
|
||||
@Before
|
||||
public void setup() throws Exception {
|
||||
|
||||
logger.debug("Setting up '" + this.testName.getMethodName() + "', client=" +
|
||||
this.webSocketClient.getClass().getSimpleName() + ", server=" +
|
||||
this.server.getClass().getSimpleName());
|
||||
@@ -155,6 +154,7 @@ public abstract class AbstractWebSocketIntegrationTests {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
static class TomcatUpgradeStrategyConfig extends AbstractRequestUpgradeStrategyConfig {
|
||||
|
||||
@@ -164,6 +164,7 @@ public abstract class AbstractWebSocketIntegrationTests {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
static class UndertowUpgradeStrategyConfig extends AbstractRequestUpgradeStrategyConfig {
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -46,9 +46,10 @@ import static org.junit.Assert.*;
|
||||
* Client and server-side WebSocket integration tests.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Juergen Hoeller
|
||||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
public class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests {
|
||||
public class WebSocketHandshakeTests extends AbstractWebSocketIntegrationTests {
|
||||
|
||||
@Parameters(name = "server [{0}], client [{1}]")
|
||||
public static Iterable<Object[]> arguments() {
|
||||
@@ -62,7 +63,7 @@ public class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTest
|
||||
|
||||
@Override
|
||||
protected Class<?>[] getAnnotatedConfigClasses() {
|
||||
return new Class<?>[] { TestConfig.class };
|
||||
return new Class<?>[] {TestConfig.class};
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -75,11 +76,8 @@ public class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTest
|
||||
session.close();
|
||||
}
|
||||
|
||||
// SPR-12727
|
||||
|
||||
@Test
|
||||
@Test // SPR-12727
|
||||
public void unsolicitedPongWithEmptyPayload() throws Exception {
|
||||
|
||||
String url = getWsBaseUrl() + "/ws";
|
||||
WebSocketSession session = this.webSocketClient.doHandshake(new AbstractWebSocketHandler() {}, url).get();
|
||||
|
||||
@@ -126,7 +124,6 @@ public class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTest
|
||||
|
||||
private Throwable transportError;
|
||||
|
||||
|
||||
public void setWaitMessageCount(int waitMessageCount) {
|
||||
this.waitMessageCount = waitMessageCount;
|
||||
}
|
||||
@@ -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.
|
||||
@@ -61,7 +61,7 @@ public class WebSocketConfigurationTests extends AbstractWebSocketIntegrationTes
|
||||
|
||||
@Override
|
||||
protected Class<?>[] getAnnotatedConfigClasses() {
|
||||
return new Class<?>[] { TestConfig.class };
|
||||
return new Class<?>[] {TestConfig.class};
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user