Refactor WebSocket int. tests to work w/ Jetty 9.3

Recent builds of Jetty 9.3 require that Jetty's own ServletContext
implementation be supplied to WebSocketServerFactory's init() method.
Otherwise, the Jetty server will fail to start with the exception
message: "Not running on Jetty, WebSocket support unavailable".

This commit refactors AbstractWebSocketIntegrationTests,
AbstractSockJsIntegrationTests, and all WebSocketTestServer
implementations in order to support this new requirement.

Specifically:

- WebSocketTestServer defines a new getServletContext() method;
  TomcatWebSocketTestServer, UndertowTestServer, and
  JettyWebSocketTestServer have all been updated to return the
  ServletContext created by the embedded server.

- The setup() methods in AbstractWebSocketIntegrationTests and
  AbstractSockJsIntegrationTests have been updated so that the
  WebApplicationContext is supplied the appropriate ServletContext,
  after deployConfig() has been invoked on the WebSocketTestServer but
  before the WebApplicationContext is refreshed.

Issue: SPR-13162
This commit is contained in:
Sam Brannen
2015-06-24 20:16:25 +02:00
parent 8b50750511
commit e8c8d2a6ad
8 changed files with 93 additions and 47 deletions

View File

@@ -1,9 +1,8 @@
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%c][%t] - %m%n
log4j.appender.console.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%-5p] [%c] - %m%n
log4j.rootCategory=WARN, console
log4j.logger.org.springframework.web=DEBUG
log4j.logger.org.springframework.web.socket=TRACE
log4j.logger.org.springframework.messaging=DEBUG
log4j.logger.org.springframework.web=WARN
log4j.logger.org.springframework.web.socket=WARN
log4j.logger.org.springframework.messaging=WARN