|
Generated by JDiff |
||||||||
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |
This file contains all the changes in documentation in the packageorg.springframework.mock.web
as colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
Mock implementation of the javax.servlet.Class MockFilterChain, void doFilter(ServletRequest, ServletResponse)FilterConfigFilterChain interface.Used for testing the web framework; also useful for testing custom javax.servlet.Filter implementations. @author Juergen Hoeller @author Rob Winch @since 2.0.3 @see MockFilterConfig @see PassThroughFilterChain
Records theInvoke registered Filters and/or Servlet also saving the request and response.
The default implementation delegates to .encodeURL, returning the given URL String as-is.Class MockHttpServletResponse, String getHeader(String)Can be overridden in subclasses, appending a session id or the like in a redirect-specific fashion. For general URL encoding rules, override the common .encodeURL method instead,
appylingapplying to redirect URLs as well as to general URLs.
Return the primary value for the given header as a String, if any. Will return the first value in case of multiple values.Class MockHttpServletResponse, List<String> getHeaders(String)As of Servlet 3.0, this method is also defined in HttpServletResponse. As of Spring 3.1, it returns a stringified value for Servlet 3.0 compatibility. Consider using .getHeaderValue(String) for raw Object access. @param name the name of the header @return the associated header value, or
null
if none
Return all values for the given header as a List of Strings.As of Servlet 3.0, this method is also defined in HttpServletResponse. As of Spring 3.1, it returns a List of stringified values for Servlet 3.0 compatibility. Consider using .getHeaderValues(String) for raw Object access. @param name the name of the header @return the associated header values, or an empty List if none
Mock implementation of the javax.servlet.http.HttpSession interface.Compatible with Servlet 2.5 as well as Servlet 3.0.
Used for testing the web framework; also useful for testing application controllers. @author Juergen Hoeller @author Rod Johnson @author Mark Fisher @author Sam Brannen @since 1.0.2
Mock implementation of the javax.servlet.RequestDispatcher interface.Class MockRequestDispatcher, constructor MockRequestDispatcher(String)Used for testing the web framework; typically not necessary for testing application controllers. @author Rod Johnson @author Juergen Hoeller @author Sam Brannen @since 1.0.2
Create a new MockRequestDispatcher for the givenClass MockRequestDispatcher, MockHttpServletResponse getMockHttpServletResponse(ServletResponse)URLresource. @paramurlresource theURLserver resource to dispatch to., located at a particular path or given by a particular name
Obtain the underlying MockHttpServletResponse,unwrappingunwrapping HttpServletResponseWrapper decorators if necessary.
Mock implementation of the javax.servlet.ServletContext interface.Class MockServletContext, constructor MockServletContext(String)Compatible with Servlet 2.5 and partially with Servlet 3.0. Can be configured to expose a specific version through .setMajorVersion/.setMinorVersion; default is 2.5. Note that Servlet 3.0 support is limited: servlet, filter and listener registration methods are not supported; neither is cookie or JSP configuration. We generally do not recommend to unit-test your ServletContainerInitializers and WebApplicationInitializers which is where those registration methods would be used.
Used for testing the Spring web framework; only rarely necessary for testing application controllers. As long as application components don't explicitly access the {@code ServletContext}, {@code ClassPathXmlApplicationContext} or {@code FileSystemXmlApplicationContext} can be used to load the context
filesfiles for testing,even for {@code DispatcherServlet} context definitions.For setting up a full {@code WebApplicationContext} in a test environment, you
cancan use {@code AnnotationConfigWebApplicationContext}, {@code XmlWebApplicationContext},(or {@code GenericWebApplicationContext)}, passing inanan appropriate {@code MockServletContext} instance. You mightwantwant to configureyouryour {@code MockServletContext} with a {@code FileSystemResourceLoader} in that case,tomake yourensure that resource paths are interpreted as relativefilefilesystemsystemlocations.A common setup is to point your JVM working directory to the root of your web application directory, in combination with filesystem-based resource loading. This allows to load the context files as used in the web application, with relative paths getting interpreted correctly. Such a setup will work with both {@code FileSystemXmlApplicationContext} (which will load straight from
the filethesystemfilesystem)and {@code XmlWebApplicationContext} with anunderlyingunderlying {@code MockServletContext} (as longasas the {@code MockServletContext} hasbeenbeen configured with a {@code FileSystemResourceLoader}). @author Rod Johnson @author Juergen Hoeller @author Sam Brannen @since 1.0.2 @see #MockServletContext(org.springframework.core.io.ResourceLoader) @see org.springframework.web.context.support.AnnotationConfigWebApplicationContext @see org.springframework.web.context.support.XmlWebApplicationContext @see org.springframework.web.context.support.GenericWebApplicationContext @see org.springframework.context.support.ClassPathXmlApplicationContext @see org.springframework.context.support.FileSystemXmlApplicationContext
Create a new MockServletContext, using a DefaultResourceLoader. @param resourceBasePath theClass MockServletContext, constructor MockServletContext(String, ResourceLoader)WARroot directory of the WAR (should not end with a slash) @see org.springframework.core.io.DefaultResourceLoader
Create a new MockServletContext using the supplied resource base path and resource loader.Registers a MockRequestDispatcher for the Servlet named {@value #COMMON_DEFAULT_SERVLET_NAME}
. @param resourceBasePath theWARroot directory of the WAR (should not end with a slash) @param resourceLoader the ResourceLoader to use (or null for the default) @see #registerNamedDispatcher