Spring Framework 4.0 introduced first-class support for a Groovy-based
DSL for defining the beans for an ApplicationContext. However, prior to
this commit, the Spring TestContext Framework (TCF) did not provide any
out-of-the-box support for using Groovy scripts as path-based resource
locations when loading an application context for tests.
This commit addresses this issue by introducing first-class support for
using Groovy scripts to load the ApplicationContext for integration
tests managed by the TCF. Specifically, the following changes have been
made in the TCF to support Groovy scripts.
- Introduced getResourceSuffixes() in AbstractContextLoader in order
to support multiple resource suffixes in the default detection
process. This feature is used by the new Groovy/Xml context loaders.
- Introduced GenericGroovyXmlContextLoader and
GenericGroovyXmlWebContextLoader which support both Groovy scripts
and XML config files for loading bean definitions. Furthermore,
these loaders support "-context.xml" and "Context.groovy" as
resource suffixes when detecting defaults. Note that a default XML
config file will be detected before a default Groovy script.
- DelegatingSmartContextLoader and WebDelegatingSmartContextLoader now
use reflection to choose between using GenericGroovyXmlContextLoader
and GenericGroovyXmlWebContextLoader vs. GenericXmlContextLoader and
GenericXmlWebContextLoader as their XML loaders, depending on
whether Groovy is present in the classpath.
- Groovy scripts can be configured via the 'locations' or 'value'
attributes of @ContextConfiguration and can be mixed seamlessly with
XML config files.
Issue: SPR-11233
This change provides WebSocket support for the upcoming Glassfish 4.0.1
release while at the same dropping support for Glassfish 4.0 due to
incompatible changes.
Issue: SPR-11094
Before this change the DefaultHandshakeHandler by default passed the
list of requested WebSocket extensions as-is relying on the WebSocket
engine to remove those not supported.
This change ensures that WebSocket extensions not supported by the
runtime are proactively removed instead.
This change is preparation for SPR-11094.
This commit fixes a potential NPE when determining the priority of a
bean instance in case multiple candidates exist and no bean was marked
as @Primary
Issue: SPR-12024
This change adds a new HttpMessageConverter supporting
Google protocol buffers (aka Protobuf).
This message converter supports the following media types:
* application/json
* application/xml
* text/plain
* text/html (output only)
* and by default application/x-protobuf
Note, in order to generate Proto Message classes, the protoc binary
must be available on your system.
Issue: SPR-5807/SPR-6259
Before this change if Velocity Spring form macro was bound to a path
which contains square brackets, those brackets would also appear in id
of generated tag, making the id invalid.
As of this fix all Velocity Spring form macros generate tag with id
that does not contain square brackets.
Issue: SPR-5172
This is a follow-up on the commit introducing MockMvcConfigurer:
c2b0fac852
This commit refines the MockMvcConfigurer contract to use (the new)
ConfigurableMockMvcBuilder hence not requiring downcasting to
AbstractMockMvcBuilder.
The same also no longer passes the "default" RequestBuilder which would
also require a downcast, but rather allows a RequestPostProcessor to be
returned so that a 3rd party framework or application can modify any
property of every performed MockHttpServletRequest.
To make this possible the new SmartRequestBuilder interface separates
request building from request post processing while the new
ConfigurableSmartRequestBuilder allows adding a RequestPostProcessor
to a MockMvcBuilder.
Issue: SPR-11497