类 DefaultMvcResult

java.lang.Object
cn.taketoday.test.web.servlet.DefaultMvcResult
所有已实现的接口:
MvcResult

class DefaultMvcResult extends Object implements MvcResult
A simple implementation of MvcResult with setters.
从以下版本开始:
4.0
作者:
Rossen Stoyanchev, Rob Winch
  • 字段详细资料

    • MVC_RESULT_ATTRIBUTE

      static final String MVC_RESULT_ATTRIBUTE
    • RESULT_NONE

      private static final Object RESULT_NONE
    • mockRequest

      private final MockHttpServletRequest mockRequest
    • mockResponse

      private final MockHttpServletResponse mockResponse
    • requestContext

      private cn.taketoday.web.RequestContext requestContext
    • handler

      @Nullable private Object handler
    • interceptors

      @Nullable private cn.taketoday.web.HandlerInterceptor[] interceptors
    • modelAndView

      @Nullable private cn.taketoday.web.view.ModelAndView modelAndView
    • resolvedException

      @Nullable private Throwable resolvedException
    • asyncResult

      private final AtomicReference<Object> asyncResult
    • asyncDispatchLatch

      @Nullable private CountDownLatch asyncDispatchLatch
  • 构造器详细资料

  • 方法详细资料

    • getRequest

      public MockHttpServletRequest getRequest()
      从接口复制的说明: MvcResult
      Return the performed request.
      指定者:
      getRequest 在接口中 MvcResult
      返回:
      the request, never null
    • getResponse

      public MockHttpServletResponse getResponse()
      从接口复制的说明: MvcResult
      Return the resulting response.
      指定者:
      getResponse 在接口中 MvcResult
      返回:
      the response, never null
    • getRequestContext

      public cn.taketoday.web.RequestContext getRequestContext()
      指定者:
      getRequestContext 在接口中 MvcResult
    • setHandler

      public void setHandler(@Nullable Object handler)
    • getHandler

      @Nullable public Object getHandler()
      从接口复制的说明: MvcResult
      Return the executed handler.
      指定者:
      getHandler 在接口中 MvcResult
      返回:
      the handler, possibly null if none were executed
    • setInterceptors

      public void setInterceptors(@Nullable cn.taketoday.web.HandlerInterceptor... interceptors)
    • getInterceptors

      @Nullable public cn.taketoday.web.HandlerInterceptor[] getInterceptors()
      从接口复制的说明: MvcResult
      Return interceptors around the handler.
      指定者:
      getInterceptors 在接口中 MvcResult
      返回:
      interceptors, or null if none were selected
    • setResolvedException

      public void setResolvedException(Throwable resolvedException)
    • getResolvedException

      @Nullable public Throwable getResolvedException()
      从接口复制的说明: MvcResult
      Return any exception raised by a handler and successfully resolved through a HandlerExceptionHandler.
      指定者:
      getResolvedException 在接口中 MvcResult
      返回:
      an exception, or null if none
    • setModelAndView

      public void setModelAndView(@Nullable cn.taketoday.web.view.ModelAndView mav)
    • getModelAndView

      @Nullable public cn.taketoday.web.view.ModelAndView getModelAndView()
      从接口复制的说明: MvcResult
      Return the ModelAndView prepared by the handler.
      指定者:
      getModelAndView 在接口中 MvcResult
      返回:
      a ModelAndView, or null if none
    • getFlashMap

      public cn.taketoday.web.view.RedirectModel getFlashMap()
      从接口复制的说明: MvcResult
      Return the "output" flash attributes saved during request processing.
      指定者:
      getFlashMap 在接口中 MvcResult
      返回:
      the RedirectModel, possibly empty
    • setAsyncResult

      public void setAsyncResult(Object asyncResult)
    • getAsyncResult

      public Object getAsyncResult()
      从接口复制的说明: MvcResult
      Get 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, use MvcResult.getAsyncResult(long) to specify the amount of time to wait.

      指定者:
      getAsyncResult 在接口中 MvcResult
    • getAsyncResult

      public Object getAsyncResult(long timeToWait)
      从接口复制的说明: MvcResult
      Get 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, see MockAsyncContext#setTimeout for more details.
    • awaitAsyncDispatch

      private boolean awaitAsyncDispatch(long timeout)
      True if the latch count reached 0 within the specified timeout.
    • setAsyncDispatchLatch

      void setAsyncDispatchLatch(CountDownLatch asyncDispatchLatch)
    • setRequestContext

      void setRequestContext(cn.taketoday.web.RequestContext maybeNew)
    • forContext

      static DefaultMvcResult forContext(cn.taketoday.web.RequestContext request)