This commit deletes the deprecated @ExpectedException and
@NotTransactional annotations, supporting code, and related Javadoc and
reference documentation.
Issue: SPR-10499
In particular, avoid accidental usage of ASM for core JDK types - which will fail in case of a new bytecode version in the JDK, even if the application itself has been compiled with an earlier bytecode target.
Issue: SPR-10292
Rework the reference documentation to better distinguish the differences
between @Bean methods used in @Comonent vs @Configuration classes. The
'Using the @Bean annotation' section now only covers concepts applicable
when using @Bean methods in @Configuration _or_ @Component classes.
Information only applicable to @Configuration classes has been moved to
a new 'Using the @Configuration annotation' section.
An additional sidebar section attempts to explain the differences
between the two approaches.
Issue: SPR-9425
This commit reformats the testing chapter (and adds minor polishing
changes) in order to avoid massive merge diffs in upcoming commits.
Issue: SPR-10357
Prior to this commit the Spring TestContext Framework supported creating
only flat, non-hierarchical contexts. There was no easy way to create
contexts with parent-child relationships.
This commit addresses this issue by introducing a new @ContextHierarchy
annotation that can be used in conjunction with @ContextConfiguration
for declaring hierarchies of application contexts, either within a
single test class or within a test class hierarchy. In addition,
@DirtiesContext now supports a new 'hierarchyMode' attribute for
controlling context cache clearing for context hierarchies.
- Introduced a new @ContextHierarchy annotation.
- Introduced 'name' attribute in @ContextConfiguration.
- Introduced 'name' property in ContextConfigurationAttributes.
- TestContext is now aware of @ContextHierarchy in addition to
@ContextConfiguration.
- Introduced findAnnotationDeclaringClassForTypes() in AnnotationUtils.
- Introduced resolveContextHierarchyAttributes() in ContextLoaderUtils.
- Introduced buildContextHierarchyMap() in ContextLoaderUtils.
- @ContextConfiguration and @ContextHierarchy may not be used as
top-level, class-level annotations simultaneously.
- Introduced reference to the parent configuration in
MergedContextConfiguration and WebMergedContextConfiguration.
- Introduced overloaded buildMergedContextConfiguration() methods in
ContextLoaderUtils in order to handle context hierarchies separately
from conventional, non-hierarchical contexts.
- Introduced hashCode() and equals() in ContextConfigurationAttributes.
- ContextLoaderUtils ensures uniqueness of @ContextConfiguration
elements within a single @ContextHierarchy declaration.
- Introduced CacheAwareContextLoaderDelegate that can be used for
loading contexts with transparent support for interacting with the
context cache -- for example, for retrieving the parent application
context in a context hierarchy.
- TestContext now delegates to CacheAwareContextLoaderDelegate for
loading contexts.
- Introduced getParentApplicationContext() in MergedContextConfiguration
- The loadContext(MergedContextConfiguration) methods in
AbstractGenericContextLoader and AbstractGenericWebContextLoader now
set the parent context as appropriate.
- Introduced 'hierarchyMode' attribute in @DirtiesContext with a
corresponding HierarchyMode enum that defines EXHAUSTIVE and
CURRENT_LEVEL cache removal modes.
- ContextCache now internally tracks the relationships between contexts
that make up a context hierarchy. Furthermore, when a context is
removed, if it is part of a context hierarchy all corresponding
contexts will be removed from the cache according to the supplied
HierarchyMode.
- AbstractGenericWebContextLoader will set a loaded context as the
ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE in the MockServletContext when
context hierarchies are used if the context has no parent or if the
context has a parent that is not a WAC.
- Where appropriate, updated Javadoc to refer to the
ServletTestExecutionListener, which was introduced in 3.2.0.
- Updated Javadoc to avoid and/or suppress warnings in spring-test.
- Suppressed remaining warnings in code in spring-test.
Issue: SPR-5613, SPR-9863
Update the Spring OXM reference documentation to include changes
introduced in CastorMarshaller, specifically around CastorMarshaller
XSD configuration.
Issue: SPR-8509
Inner beans are not prototype beans as, in contrast to what is
documented in the section for prototype beans, the inner bean does
get destruction callbacks applied.
Issue: SPR-10311
The following changes have been made to the JDT UI prefs to conform to
existing conventions throughout the codebase:
- always favor .* syntax for static imports
- always list static imports last
Re-run `gradle eclipse` and refresh projects within Eclipse to make
this change take effect.
Update reference guide to include a note about the use of
HttpPutFormContentFilter in combination with @RequestBody
MultiValueMap and HttpEntity.
Issue: SPR-8415
Update examples for Quartz scheduling to use SimpleTriggerFactoryBean
and CronTriggerFactoryBean instead of SimpleTriggerBean and
CronTriggerBean.
Issue: SPR-10209
Allow @Cachable, @CachePut and equivalent XML configuration to provide
a SpEL expression that can be used to veto putting an item into the
cache. Unlike 'condition' the 'unless' parameter is evaluated after
the method has been called and can therefore reference the #result.
For example:
@Cacheable(value="book",
condition="#name.length < 32",
unless="#result.hardback")
This commit also allows #result to be referenced from @CacheEvict
expressions as long as 'beforeInvocation' is false.
Issue: SPR-8871
This commit improves the "Spring Test Dependencies" section of the 3.2
migration guide by correctly explaining that Hamcrest Core is now a
required transitive dependency of JUnit.
Issue: SPR-10251
This commit fixes a typo in the "New Features and Enhancements in Spring
Framework 3.2" chapter of the reference manual. Specifically,
ContentNegotiationStrategy is now spelled correctly.