use of cn.taketoday.web.context.async.StandardServletAsyncWebRequest in project today-infrastructure by TAKETODAY.
the class ErrorPageFilterTests method setUpAsyncDispatch.
private void setUpAsyncDispatch() throws Exception {
this.request.setAsyncSupported(true);
this.request.setAsyncStarted(true);
DeferredResult<String> result = new DeferredResult<>();
ServletRequestContext context = new ServletRequestContext(null, request, response);
WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(context);
asyncManager.setAsyncRequest(new StandardServletAsyncWebRequest(context));
asyncManager.startDeferredResultProcessing(result);
}
use of cn.taketoday.web.context.async.StandardServletAsyncWebRequest in project today-infrastructure by TAKETODAY.
the class ReactiveTypeHandlerTests method resetRequest.
private void resetRequest() {
this.servletRequest = new MockHttpServletRequest();
this.servletResponse = new MockHttpServletResponse();
this.webRequest = new ServletRequestContext(null, this.servletRequest, this.servletResponse);
AsyncWebRequest webRequest = new StandardServletAsyncWebRequest(this.webRequest);
WebAsyncUtils.getAsyncManager(this.webRequest).setAsyncRequest(webRequest);
this.servletRequest.setAsyncSupported(true);
}
use of cn.taketoday.web.context.async.StandardServletAsyncWebRequest in project today-framework by TAKETODAY.
the class ResponseBodyEmitterReturnValueHandlerTests method setup.
@BeforeEach
public void setup() throws Exception {
List<HttpMessageConverter<?>> converters = Collections.singletonList(new MappingJackson2HttpMessageConverter());
this.handler = new ResponseBodyEmitterReturnValueHandler(converters);
this.request = new MockHttpServletRequest();
this.response = new MockHttpServletResponse();
this.webRequest = new ServletRequestContext(null, this.request, this.response);
AsyncWebRequest asyncWebRequest = new StandardServletAsyncWebRequest(this.request, this.response);
WebAsyncUtils.getAsyncManager(this.webRequest).setAsyncRequest(asyncWebRequest);
this.request.setAsyncSupported(true);
}
use of cn.taketoday.web.context.async.StandardServletAsyncWebRequest in project today-framework by TAKETODAY.
the class ReactiveTypeHandlerTests method resetRequest.
private void resetRequest() {
this.servletRequest = new MockHttpServletRequest();
this.servletResponse = new MockHttpServletResponse();
this.webRequest = new ServletRequestContext(null, this.servletRequest, this.servletResponse);
AsyncWebRequest webRequest = new StandardServletAsyncWebRequest(this.servletRequest, this.servletResponse);
WebAsyncUtils.getAsyncManager(this.webRequest).setAsyncRequest(webRequest);
this.servletRequest.setAsyncSupported(true);
}
use of cn.taketoday.web.context.async.StandardServletAsyncWebRequest in project today-framework by TAKETODAY.
the class ErrorPageFilterTests method setUpAsyncDispatch.
private void setUpAsyncDispatch() throws Exception {
this.request.setAsyncSupported(true);
this.request.setAsyncStarted(true);
DeferredResult<String> result = new DeferredResult<>();
ServletRequestContext context = new ServletRequestContext(null, request, response);
WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(context);
asyncManager.setAsyncRequest(new StandardServletAsyncWebRequest(request, response));
asyncManager.startDeferredResultProcessing(result);
}
Aggregations