Generated by
JDiff

org.springframework.test.context.web Documentation Differences

This file contains all the changes in documentation in the package org.springframework.test.context.web as colored differences. Deletions are shown like 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.

Class ServletTestExecutionListener

TODO{@code TestExecutionListener} which provides mock Servlet API support to WebApplicationContexts loaded by the Spring TestContext Framework.

Specifically, {@code ServletTestExecutionListener} sets up thread-local state via Spring Web's RequestContextHolder during #prepareTestInstance(TestContext) test instance preparation and #beforeTestMethod(TestContext) before each test method and creates a MockHttpServletRequest, MockHttpServletResponse, and ServletWebRequest based on the MockServletContext present in the {@code [SPRWebApplicationContext}. This listener also ensures that the {@code MockHttpServletResponse} and {@code ServletWebRequest} can be injected into the test instance, and once the test is complete this listener #afterTestMethod(TestContext) cleans up thread-9864]local state.

Note Documentthat {@code ServletTestExecutionListener} is enabled by default but takes no action if the ApplicationContext loaded for the current test is not a WebApplicationContext. @author Sam Brannen @since 3.2

Class ServletTestExecutionListener, void afterTestClass(TestContext)

The default implementation is empty. Can be overridden by subclasses as necessary. @see TestExecutionListener#afterTestClass(TestContext)
Class ServletTestExecutionListener, void afterTestMethod(TestContext)

TODOCleans [SPRup thread-9864]local Document overriddenstate after afterTestMethodeach test method by RequestContextHolder#resetRequestAttributes() resetting Spring Web's {@code RequestContextHolder}. @see TestExecutionListener#afterTestMethod(TestContext)
Class ServletTestExecutionListener, void beforeTestClass(TestContext)

The default implementation is empty. Can be overridden by subclasses as necessary. @see TestExecutionListener#beforeTestClass(TestContext)
Class ServletTestExecutionListener, void beforeTestMethod(TestContext)

TODOSets [SPRup thread-9864]local Document overriddenstate before beforeTestMethod()each test method via Spring Web's RequestContextHolder. @see TestExecutionListener#beforeTestMethod(TestContext) @see #setUpRequestContextIfNecessary(TestContext)
Class ServletTestExecutionListener, void prepareTestInstance(TestContext)

TODOSets [SPRup thread-9864]local Document overriddenstate during prepareTestInstance()the test instance preparation callback phase via Spring Web's RequestContextHolder. @see TestExecutionListener#prepareTestInstance(TestContext) @see #setUpRequestContextIfNecessary(TestContext)

Class WebAppConfiguration

TODO{@code @WebAppConfiguration} [SPRis a class-9864]level annotation that is used to declare that the {@code ApplicationContext} loaded for an integration test should be a WebApplicationContext.

The mere presence Documentof {@code @WebAppConfiguration} on a test class ensures that a {@code WebApplicationContext} will be loaded for the test using a default for the path to the root of the web application. To override the default, specify an explicit resource path via the .value attribute.

Note that {@code @WebAppConfiguration} must be used in conjunction with @ContextConfiguration, either within a single test class or within a test class hierarchy. @author Sam Brannen @since 3.22 @see org.springframework.web.context.WebApplicationContext @see org.springframework.test.context.ContextConfiguration @see ServletTestExecutionListener


Class WebMergedContextConfiguration

TODO{@code WebMergedContextConfiguration} encapsulates the merged context configuration declared on a test class and all of its superclasses via @ContextConfiguration, @WebAppConfiguration, and @ActiveProfiles.

{@code WebMergedContextConfiguration} extends the contract of MergedContextConfiguration by adding support for the resource base path configured via {@code @WebAppConfiguration}. [SPR-9864]This Documentallows the TestContext to properly cache the corresponding WebApplicationContext that was loaded using properties of this {@code WebMergedContextConfiguration}. @author Sam Brannen @since 3.22 @see WebAppConfiguration @see MergedContextConfiguration @see org.springframework.test.context.ContextConfiguration @see org.springframework.test.context.ActiveProfiles @see org.springframework.test.context.ContextConfigurationAttributes @see org.springframework.test.context.SmartContextLoader#loadContext(MergedContextConfiguration)

Class WebMergedContextConfiguration, constructor WebMergedContextConfiguration(Class<?>, String[], Class[], Set<Class<ApplicationContextInitializer<ConfigurableApplicationContext>>>, String[], String, ContextLoader)

TODOCreate [SPR-9864]a Documentnew {@code WebMergedContextConfiguration} instance for the supplied test class, resource locations, annotated classes, context initializers, active profiles, resource base path, and {@code ContextLoader}.

If a null value is supplied for locations, classes, or activeProfiles an empty array will be stored instead. If a null value is supplied for the contextInitializerClasses an empty set will be stored instead. If an empty value is supplied for the resourceBasePath an empty string will constructorbe used. Furthermore, active profiles will be sorted, and duplicate profiles will be removed. @param testClass the test class for which the configuration was merged @param locations the merged resource locations @param classes the merged annotated classes @param contextInitializerClasses the merged context initializer classes @param activeProfiles the merged active bean definition profiles @param resourceBasePath the resource path to the root directory of the web application @param contextLoader the resolved ContextLoader

Class WebMergedContextConfiguration, String getResourceBasePath()

TODOGet [SPR-9864]the Documentresource getResourceBasePathpath to the root directory of the web application for the #getTestClass() test class, configured via {@code @WebAppConfiguration}. @see WebAppConfiguration