类 DefaultMvcResult
java.lang.Object
cn.taketoday.test.web.servlet.DefaultMvcResult
- 所有已实现的接口:
MvcResult
A simple implementation of
MvcResult with setters.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev, Rob Winch
-
字段概要
字段修饰符和类型字段说明private CountDownLatchprivate final AtomicReference<Object>private Objectprivate cn.taketoday.web.HandlerInterceptor[]private final MockHttpServletRequestprivate final MockHttpServletResponseprivate cn.taketoday.web.view.ModelAndView(专用程序包) static final Stringprivate cn.taketoday.web.RequestContextprivate Throwableprivate static final Object从接口继承的字段 cn.taketoday.test.web.servlet.MvcResult
MODEL_AND_VIEW_ATTRIBUTE, VIEW_ATTRIBUTE, VIEW_NAME_ATTRIBUTE -
构造器概要
构造器构造器说明DefaultMvcResult(MockHttpServletRequest request, MockHttpServletResponse response, cn.taketoday.web.RequestContext requestContext) Create a new instance with the given request and response. -
方法概要
修饰符和类型方法说明private booleanawaitAsyncDispatch(long timeout) True if the latch count reached 0 within the specified timeout.(专用程序包) static DefaultMvcResultforContext(cn.taketoday.web.RequestContext request) Get the result of async execution.getAsyncResult(long timeToWait) Get the result of async execution and wait if necessary.cn.taketoday.web.view.RedirectModelReturn the "output" flash attributes saved during request processing.Return the executed handler.cn.taketoday.web.HandlerInterceptor[]Return interceptors around the handler.cn.taketoday.web.view.ModelAndViewReturn theModelAndViewprepared by the handler.Return the performed request.cn.taketoday.web.RequestContextReturn any exception raised by a handler and successfully resolved through aHandlerExceptionHandler.Return the resulting response.(专用程序包) voidsetAsyncDispatchLatch(CountDownLatch asyncDispatchLatch) voidsetAsyncResult(Object asyncResult) voidsetHandler(Object handler) voidsetInterceptors(cn.taketoday.web.HandlerInterceptor... interceptors) voidsetModelAndView(cn.taketoday.web.view.ModelAndView mav) (专用程序包) voidsetRequestContext(cn.taketoday.web.RequestContext maybeNew) voidsetResolvedException(Throwable resolvedException)
-
字段详细资料
-
MVC_RESULT_ATTRIBUTE
-
RESULT_NONE
-
mockRequest
-
mockResponse
-
requestContext
private cn.taketoday.web.RequestContext requestContext -
handler
-
interceptors
@Nullable private cn.taketoday.web.HandlerInterceptor[] interceptors -
modelAndView
@Nullable private cn.taketoday.web.view.ModelAndView modelAndView -
resolvedException
-
asyncResult
-
asyncDispatchLatch
-
-
构造器详细资料
-
DefaultMvcResult
public DefaultMvcResult(MockHttpServletRequest request, MockHttpServletResponse response, cn.taketoday.web.RequestContext requestContext) Create a new instance with the given request and response.
-
-
方法详细资料
-
getRequest
从接口复制的说明:MvcResultReturn the performed request.- 指定者:
getRequest在接口中MvcResult- 返回:
- the request, never
null
-
getResponse
从接口复制的说明:MvcResultReturn the resulting response.- 指定者:
getResponse在接口中MvcResult- 返回:
- the response, never
null
-
getRequestContext
public cn.taketoday.web.RequestContext getRequestContext()- 指定者:
getRequestContext在接口中MvcResult
-
setHandler
-
getHandler
从接口复制的说明:MvcResultReturn the executed handler.- 指定者:
getHandler在接口中MvcResult- 返回:
- the handler, possibly
nullif none were executed
-
setInterceptors
public void setInterceptors(@Nullable cn.taketoday.web.HandlerInterceptor... interceptors) -
getInterceptors
@Nullable public cn.taketoday.web.HandlerInterceptor[] getInterceptors()从接口复制的说明:MvcResultReturn interceptors around the handler.- 指定者:
getInterceptors在接口中MvcResult- 返回:
- interceptors, or
nullif none were selected
-
setResolvedException
-
getResolvedException
从接口复制的说明:MvcResultReturn any exception raised by a handler and successfully resolved through aHandlerExceptionHandler.- 指定者:
getResolvedException在接口中MvcResult- 返回:
- an exception, or
nullif none
-
setModelAndView
public void setModelAndView(@Nullable cn.taketoday.web.view.ModelAndView mav) -
getModelAndView
@Nullable public cn.taketoday.web.view.ModelAndView getModelAndView()从接口复制的说明:MvcResultReturn theModelAndViewprepared by the handler.- 指定者:
getModelAndView在接口中MvcResult- 返回:
- a
ModelAndView, ornullif none
-
getFlashMap
public cn.taketoday.web.view.RedirectModel getFlashMap()从接口复制的说明:MvcResultReturn the "output" flash attributes saved during request processing.- 指定者:
getFlashMap在接口中MvcResult- 返回:
- the
RedirectModel, possibly empty
-
setAsyncResult
-
getAsyncResult
从接口复制的说明:MvcResultGet the result of async execution.This method will wait for the async result to be set within the timeout value associated with the async request, see
MockAsyncContext#setTimeout. Alternatively, useMvcResult.getAsyncResult(long)to specify the amount of time to wait.- 指定者:
getAsyncResult在接口中MvcResult
-
getAsyncResult
从接口复制的说明:MvcResultGet the result of async execution and wait if necessary.- 指定者:
getAsyncResult在接口中MvcResult- 参数:
timeToWait- how long to wait for the async result to be set, in milliseconds; if -1, then fall back on the timeout value associated with the async request, seeMockAsyncContext#setTimeoutfor more details.
-
awaitAsyncDispatch
private boolean awaitAsyncDispatch(long timeout) True if the latch count reached 0 within the specified timeout. -
setAsyncDispatchLatch
-
setRequestContext
void setRequestContext(cn.taketoday.web.RequestContext maybeNew) -
forContext
-