|
Generated by JDiff |
||||||||
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |
This file contains all the changes in documentation in the packageorg.springframework.test.context.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.
Class ServletTestExecutionListener, void afterTestClass(TestContext)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
The default implementation is empty. Can be overridden by subclasses as necessary.Class ServletTestExecutionListener, void afterTestMethod(TestContext)@see TestExecutionListener#afterTestClass(TestContext)
Class ServletTestExecutionListener, void beforeTestClass(TestContext)TODOCleans[SPRup thread-9864]localDocument overriddenstate afterafterTestMethodeach test method by RequestContextHolder#resetRequestAttributes() resetting Spring Web's {@code RequestContextHolder}. @see TestExecutionListener#afterTestMethod(TestContext)
The default implementation is empty. Can be overridden by subclasses as necessary.Class ServletTestExecutionListener, void beforeTestMethod(TestContext)@see TestExecutionListener#beforeTestClass(TestContext)
Class ServletTestExecutionListener, void prepareTestInstance(TestContext)TODOSets[SPRup thread-9864]localDocument overriddenstate beforebeforeTestMethod()each test method via Spring Web's RequestContextHolder. @see TestExecutionListener#beforeTestMethod(TestContext) @see #setUpRequestContextIfNecessary(TestContext)
TODOSets[SPRup thread-9864]localDocument overriddenstate duringprepareTestInstance()the test instance preparation callback phase via Spring Web's RequestContextHolder. @see TestExecutionListener#prepareTestInstance(TestContext) @see #setUpRequestContextIfNecessary(TestContext)
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, constructor WebMergedContextConfiguration(Class<?>, String[], Class[], Set<Class<ApplicationContextInitializer<ConfigurableApplicationContext>>>, String[], String, ContextLoader)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]ThisDocumentallows 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, String getResourceBasePath()TODOCreate[SPR-9864]aDocumentnew {@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 forlocations
,classes
, oractiveProfiles
an empty array will be stored instead. If anull
value is supplied for thecontextInitializerClasses
an empty set will be stored instead. If an empty value is supplied for theresourceBasePath
an empty string willconstructorbe 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 resolvedContextLoader
TODOGet[SPR-9864]theDocumentresourcegetResourceBasePathpath to the root directory of the web application for the #getTestClass() test class, configured via {@code @WebAppConfiguration}. @see WebAppConfiguration