Skip to content

Commit 12d3736

Browse files
committed
Upgrade to Undertow 1.4 CR3 (and Jackson 2.8 GA)
This commit also renames WebSocketIntegrationTests to WebSocketHandshakeTests. Issue: SPR-14328
1 parent acdb43f commit 12d3736

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

build.gradle

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ configure(allprojects) { project ->
4949
ext.hsqldbVersion = "2.3.4"
5050
ext.httpasyncVersion = "4.1.2"
5151
ext.httpclientVersion = "4.5.2"
52-
ext.jackson2Version = "2.8.0.rc2"
52+
ext.jackson2Version = "2.8.0"
5353
ext.jasperreportsVersion = "6.2.1" // our tests fail with JR-internal NPEs against 6.2.2 and higher
5454
ext.javamailVersion = "1.5.5"
5555
ext.jettyVersion = "9.3.10.v20160621"
@@ -58,7 +58,7 @@ configure(allprojects) { project ->
5858
ext.junitVersion = "4.12"
5959
ext.junitJupiterVersion = '5.0.0-SNAPSHOT'
6060
ext.junitPlatformVersion = '1.0.0-SNAPSHOT'
61-
ext.log4JVersion = '2.6.1'
61+
ext.log4jVersion = '2.6.1'
6262
ext.nettyVersion = "4.1.1.Final"
6363
ext.okhttpVersion = "2.7.5"
6464
ext.okhttp3Version = "3.3.1"
@@ -72,7 +72,7 @@ configure(allprojects) { project ->
7272
ext.tiles3Version = "3.0.5"
7373
ext.tomcatVersion = "8.5.3"
7474
ext.tyrusVersion = "1.13"
75-
ext.undertowVersion = "1.4.0.CR2"
75+
ext.undertowVersion = "1.4.0.CR3"
7676
ext.xmlunitVersion = "1.6"
7777
ext.xstreamVersion = "1.4.9"
7878

@@ -139,9 +139,8 @@ configure(allprojects) { project ->
139139
exclude group:'org.hamcrest', module:'hamcrest-core'
140140
}
141141
testCompile("org.hamcrest:hamcrest-all:${hamcrestVersion}")
142-
143-
testRuntime("org.apache.logging.log4j:log4j-core:${log4JVersion}")
144-
testRuntime("org.apache.logging.log4j:log4j-jcl:${log4JVersion}")
142+
testRuntime("org.apache.logging.log4j:log4j-core:${log4jVersion}")
143+
testRuntime("org.apache.logging.log4j:log4j-jcl:${log4jVersion}")
145144

146145
sniffer("org.codehaus.mojo:animal-sniffer-ant-tasks:${snifferVersion}")
147146
javaApiSignature("org.codehaus.mojo.signature:java18:1.0@signature")
@@ -840,12 +839,15 @@ project("spring-websocket") {
840839
optional("io.undertow:undertow-websockets-jsr:${undertowVersion}") {
841840
exclude group: "org.jboss.spec.javax.websocket", module: "jboss-websocket-api_1.1_spec"
842841
}
842+
optional("org.jboss.xnio:xnio-api:3.3.7.Final")
843843
optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
844844
testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
845845
testCompile("org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}")
846846
testCompile("io.projectreactor:reactor-net:${reactorVersion}")
847847
testCompile("io.netty:netty-all:${nettyVersion}")
848848
testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
849+
testRuntime("org.jboss.xnio:xnio-nio:3.3.7.Final")
850+
testRuntime("org.jboss.logging:jboss-logging:3.3.0.Final")
849851
}
850852
}
851853

spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/UndertowXhrTransport.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
/**
6666
* An XHR transport based on Undertow's {@link io.undertow.client.UndertowClient}.
67-
* Requires Undertow 1.3 or higher, as of Spring Framework 5.0.
67+
* Requires Undertow 1.3 or 1.4, including XNIO, as of Spring Framework 5.0.
6868
*
6969
* <p>When used for testing purposes (e.g. load testing) or for specific use cases
7070
* (like HTTPS configuration), a custom OptionMap should be provided:
@@ -461,7 +461,7 @@ public void onSuccess() {
461461

462462
public void onFailure(Throwable failure) {
463463
IoUtils.safeClose(this.connection);
464-
if (connectFuture.setException(failure)) {
464+
if (this.connectFuture.setException(failure)) {
465465
return;
466466
}
467467
if (this.session.isDisconnected()) {

spring-websocket/src/test/java/org/springframework/web/socket/AbstractWebSocketIntegrationTests.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
import org.apache.commons.logging.Log;
2323
import org.apache.commons.logging.LogFactory;
24-
2524
import org.junit.After;
2625
import org.junit.Before;
2726
import org.junit.Rule;
@@ -48,8 +47,6 @@
4847
*/
4948
public abstract class AbstractWebSocketIntegrationTests {
5049

51-
protected Log logger = LogFactory.getLog(getClass());
52-
5350
private static Map<Class<?>, Class<?>> upgradeStrategyConfigTypes = new HashMap<>();
5451

5552
static {
@@ -58,6 +55,7 @@ public abstract class AbstractWebSocketIntegrationTests {
5855
upgradeStrategyConfigTypes.put(UndertowTestServer.class, UndertowUpgradeStrategyConfig.class);
5956
}
6057

58+
6159
@Rule
6260
public final TestName testName = new TestName();
6361

@@ -67,12 +65,13 @@ public abstract class AbstractWebSocketIntegrationTests {
6765
@Parameter(1)
6866
public WebSocketClient webSocketClient;
6967

68+
protected final Log logger = LogFactory.getLog(getClass());
69+
7070
protected AnnotationConfigWebApplicationContext wac;
7171

7272

7373
@Before
7474
public void setup() throws Exception {
75-
7675
logger.debug("Setting up '" + this.testName.getMethodName() + "', client=" +
7776
this.webSocketClient.getClass().getSimpleName() + ", server=" +
7877
this.server.getClass().getSimpleName());
@@ -155,6 +154,7 @@ public RequestUpgradeStrategy requestUpgradeStrategy() {
155154
}
156155
}
157156

157+
158158
@Configuration
159159
static class TomcatUpgradeStrategyConfig extends AbstractRequestUpgradeStrategyConfig {
160160

@@ -164,6 +164,7 @@ public RequestUpgradeStrategy requestUpgradeStrategy() {
164164
}
165165
}
166166

167+
167168
@Configuration
168169
static class UndertowUpgradeStrategyConfig extends AbstractRequestUpgradeStrategyConfig {
169170

spring-websocket/src/test/java/org/springframework/web/socket/WebSocketIntegrationTests.java renamed to spring-websocket/src/test/java/org/springframework/web/socket/WebSocketHandshakeTests.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -46,9 +46,10 @@
4646
* Client and server-side WebSocket integration tests.
4747
*
4848
* @author Rossen Stoyanchev
49+
* @author Juergen Hoeller
4950
*/
5051
@RunWith(Parameterized.class)
51-
public class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests {
52+
public class WebSocketHandshakeTests extends AbstractWebSocketIntegrationTests {
5253

5354
@Parameters(name = "server [{0}], client [{1}]")
5455
public static Iterable<Object[]> arguments() {
@@ -62,7 +63,7 @@ public static Iterable<Object[]> arguments() {
6263

6364
@Override
6465
protected Class<?>[] getAnnotatedConfigClasses() {
65-
return new Class<?>[] { TestConfig.class };
66+
return new Class<?>[] {TestConfig.class};
6667
}
6768

6869
@Test
@@ -75,11 +76,8 @@ public void subProtocolNegotiation() throws Exception {
7576
session.close();
7677
}
7778

78-
// SPR-12727
79-
80-
@Test
79+
@Test // SPR-12727
8180
public void unsolicitedPongWithEmptyPayload() throws Exception {
82-
8381
String url = getWsBaseUrl() + "/ws";
8482
WebSocketSession session = this.webSocketClient.doHandshake(new AbstractWebSocketHandler() {}, url).get();
8583

@@ -126,7 +124,6 @@ private static class TestWebSocketHandler extends AbstractWebSocketHandler {
126124

127125
private Throwable transportError;
128126

129-
130127
public void setWaitMessageCount(int waitMessageCount) {
131128
this.waitMessageCount = waitMessageCount;
132129
}

spring-websocket/src/test/java/org/springframework/web/socket/config/annotation/WebSocketConfigurationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -61,7 +61,7 @@ public static Iterable<Object[]> arguments() {
6161

6262
@Override
6363
protected Class<?>[] getAnnotatedConfigClasses() {
64-
return new Class<?>[] { TestConfig.class };
64+
return new Class<?>[] {TestConfig.class};
6565
}
6666

6767
@Test

0 commit comments

Comments
 (0)