Remove unintended dependency on Servlet API in SockJS

Add a factory method in ServerHttpRequest for creating a
ServerHttpAsyncRequestControl.
This commit is contained in:
Rossen Stoyanchev
2013-08-03 11:21:02 -04:00
parent 15a2f03459
commit 123c01908a
7 changed files with 42 additions and 30 deletions

View File

@@ -17,10 +17,9 @@
package org.springframework.web.socket;
import org.junit.Before;
import org.springframework.http.server.ServerHttpAsyncResponseControl;
import org.springframework.http.server.ServerHttpAsyncRequestControl;
import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.http.server.ServletServerHttpAsyncRequestControl;
import org.springframework.http.server.ServletServerHttpRequest;
import org.springframework.http.server.ServletServerHttpResponse;
import org.springframework.mock.web.test.MockHttpServletRequest;
@@ -41,7 +40,7 @@ public class AbstractHttpRequestTests {
protected MockHttpServletResponse servletResponse;
protected ServerHttpAsyncResponseControl asyncControl;
protected ServerHttpAsyncRequestControl asyncControl;
@Before
@@ -57,7 +56,7 @@ public class AbstractHttpRequestTests {
protected void resetRequestAndResponse() {
resetRequest();
resetResponse();
this.asyncControl = new ServletServerHttpAsyncRequestControl(this.request, this.response);
this.asyncControl = this.request.getAsyncRequestControl(this.response);
}
protected void resetRequest() {

View File

@@ -246,7 +246,7 @@ public class AbstractSockJsServiceTests extends AbstractHttpRequestTests {
@Override
protected void handleTransportRequest(ServerHttpRequest req, ServerHttpResponse res, WebSocketHandler handler,
String sessionId, String transport) throws IOException, SockJsException {
String sessionId, String transport) throws SockJsException {
this.sessionId = sessionId;
this.transport = transport;