Commit Graph

9075 Commits

Author SHA1 Message Date
Rossen Stoyanchev
bb8be509cd Remove return statements in finally blocks 2014-08-19 15:27:59 -04:00
Rossen Stoyanchev
0e49040707 Fix hashcode/equals issue in HeadersRequestCondition 2014-08-19 15:16:41 -04:00
Juergen Hoeller
5cd1e6aff4 Upgrade to Apache HttpComponents HttpClient 4.3.5 and HttpAsyncClient 4.0.2
Issue: SPR-12100
2014-08-19 20:54:22 +02:00
Juergen Hoeller
759f430ba5 StatementCreatorUtils avoids direct calls with SQL type argument in case of Types.OTHER
Issue: SPR-8571
2014-08-19 20:52:54 +02:00
Juergen Hoeller
8c76381d95 PathMatchingResourcePatternResolver supports "classpath*" searches in jar file roots as well
Issue: SPR-12095
2014-08-19 20:34:45 +02:00
Juergen Hoeller
0c32d66cbd ShallowEtagHeaderFilter supports Servlet 3.1's setContentLengthLong as well
Issue: SPR-12097
2014-08-19 20:17:42 +02:00
Sam Brannen
110be33337 Honor Host header for server name/port in MckHtSrvRq
Prior to this commit, the getServerName() and getServerPort() methods
in MockHttpServletRequest simply returned the 'mocked' serverName and
serverPort but ignored the 'Host' header entirely. Per the Servlet
specification, however, these methods must parse the server name or
port from the 'Host' header if it is present and otherwise fall back to
the resolved server name or port.

This commit fixes this by ensuring that getServerName() and
getServerPort() properly parse the server's name or port from the
'Host' header if it is present in the request. If the 'Host' header is
not present, MockHttpServletRequest falls back to returning the
'mocked' serverName and serverPort.

Issue: SPR-12088
2014-08-19 00:08:09 +02:00
Juergen Hoeller
51e4b07856 JamonPerformanceMonitorInterceptor tracks exceptions as well (consistent with JAMon's other interceptors)
Issue: SPR-12068
2014-08-18 21:50:24 +02:00
Juergen Hoeller
c65a82a32d Polishing 2014-08-18 21:25:38 +02:00
Juergen Hoeller
a2e6b56dd0 SchedulerAccessorBean falls back to finding a default Scheduler bean by type
Issue: SPR-12094
2014-08-18 21:23:29 +02:00
Juergen Hoeller
2ef3d66c89 Polishing 2014-08-18 19:27:08 +02:00
Juergen Hoeller
0d0d7139ee Convenient EhCache CacheManager bootstrapping within @Bean methods
Also introducing default CacheManager setup for EhCacheCacheManager, analogous to JCacheCacheManager.

Issue: SPR-12093
2014-08-18 19:25:40 +02:00
Stephane Nicoll
b910ff34e6 Exclude infra modules from public distributions
Prior to this commit, spring-build-src and spring-framework-bom
internal artifacts were published as part of the distribution bundle.

This commit excludes those project so that those unnecessary artifacts
are no longer shipped.

Issue: SPR-12087
2014-08-18 11:51:20 +02:00
Juergen Hoeller
dd66ca0c93 Latest dependency updates (AspectJ 1.8.2, Jackson 2.4.2) 2014-08-18 11:34:01 +02:00
Stephane Nicoll
2553fb8ba1 Apply ListenableFuture support to AspectJ
Prior to this commit, only @Async annotated methods with proxy style
had an explicit support for ListenableFuture. This commit brings that
support to AspectJ as well.

Issue: SPR-12092
2014-08-18 11:12:07 +02:00
Stephane Nicoll
bccb3bb70b polishing 2014-08-18 11:03:58 +02:00
Stephane Nicoll
8fc191c95e Apply AsyncUncaughtExceptionHandler to AspectJ
Prior to this commit, only @Async annotated methods with proxy style
had their custom uncaught exception handler applied. This commit
harmonizes the configuration so that AspectJ applies that behaviour as
well.

Issue: SPR-12090
2014-08-18 10:51:21 +02:00
Sam Brannen
0dba70fe15 Merge pull request #625 from eujungkim/spr-warning
Clean up warnings in CompoundComparator
2014-08-18 10:16:26 +02:00
eujung kim
c315adf72d Remove unnecessary @SupressWarnings. 2014-08-18 17:03:03 +09:00
Sam Brannen
1a88007688 Improve documentation of SpringFactoriesLoader 2014-08-16 17:07:30 +02:00
Sam Brannen
e1d7f08d7b Relax XML content type expectations in tests
Requests in XmlContentAssertionTests and XpathAssertionTests now accept
"application/xml;charset=UTF-8" in addition to "application/xml".
2014-08-15 20:56:38 +02:00
Sam Brannen
85e52e59e3 Remove duplicate test dependency on mockito-core 2014-08-15 20:51:07 +02:00
Sam Brannen
042cfeed5c Include Groovy source code in published sources jars
In our Gradle build script, we are now assembling 'sources' jars from
'sourceSets.main.allSource' in order to include Java, Groovy, and
AspectJ source code as well all other appropriate classpath resources.

Issue: SPR-12086
2014-08-15 17:27:19 +02:00
Sam Brannen
9ea646e508 Include all source artifacts in published sources jars
This commit updates the Gradle build to ensure that the following are
including in published 'sources' jars.

 - Java source code (previously supported)
 - AspectJ source code (previously supported)
 - META-INF/spring.factories
 - META-INF/services/*
 - Java Properties files
 - XML files
 - MIME types files (mime.types)

Issue: SPR-12085
2014-08-15 14:39:22 +02:00
Sam Brannen
a91ab34866 Polish Javadoc and formatting in @TestExecutionListeners 2014-08-15 13:38:13 +02:00
Sam Brannen
8b86519b94 Polishing 2014-08-15 02:50:03 +02:00
Sam Brannen
66250b1f8e Support merging custom TELs with default TELs
Prior to this commit, if a custom TestExecutionListener was registered
via @TestExecutionListeners the defaults would not be registered. Thus,
if a user wanted to declare a custom listener and use the default
listeners, the user was forced to manually declare all default
listeners in addition to any custom listeners. This unfortunately
required that the user know exactly which listeners were registered by
default. Moreover, the set of default listeners can change from release
to release, and with the support for automatic discovery of default
listeners introduced in SPR-11466 it is no longer even possible to know
what the set of default TestExecutionListeners is before runtime.

This commit addresses this issue by introducing a mechanism for merging
custom declared listeners with the defaults for the current
environment. Specifically, @TestExecutionListeners supports a new
MergeMode that is used to control whether or not explicitly declared
listeners are merged with the default listeners when
@TestExecutionListeners is declared on a class that does not inherit
listeners from a superclass.

Issue: SPR-8854
2014-08-15 02:21:42 +02:00
Juergen Hoeller
b3add794d7 Polishing 2014-08-15 00:55:40 +02:00
Juergen Hoeller
d2e269e697 Fixed fragile tests for @Bean method overloading 2014-08-15 00:55:14 +02:00
Juergen Hoeller
69587f3fa4 Polishing 2014-08-14 23:49:29 +02:00
Juergen Hoeller
eb0ab8431b Lookup methods can support arguments, find a target bean based on the return type, and be identified by an @Lookup annotation
Issue: SPR-7431
Issue: SPR-5192
2014-08-14 23:49:05 +02:00
Sam Brannen
e753f23110 Merge from sbrannen/SPR-11466
* SPR-11466:
  Support automatic discovery of default TELs
2014-08-14 22:30:16 +02:00
Sam Brannen
e6d16148e5 Support automatic discovery of default TELs
Prior to this commit, there was no declarative mechanism for a custom
TestExecutionListener to be registered as a default
TestExecutionListener.

This commit introduces support for discovering default
TestExecutionListener implementations via the SpringFactoriesLoader
mechanism. Specifically, the spring-test module declares all core
default TestExecutionListeners under the
org.springframework.test.context.TestExecutionListener key in its
META-INF/spring.factories properties file, and third-party frameworks
and developers can contribute to the list of default
TestExecutionListeners in the same manner.

 - AbstractTestContextBootstrapper uses the SpringFactoriesLoader to
   look up the class names of all registered default
   TestExecutionListeners and sorts the instantiated listeners using
   AnnotationAwareOrderComparator.

 - DefaultTestContextBootstrapper and WebTestContextBootstrapper now
   rely on the SpringFactoriesLoader mechanism for finding default
   TestExecutionListeners instead of hard coding fully qualified class
   names.

 - To ensure that default TestExecutionListeners are registered in the
   correct order, each can implement Ordered or declare @Order.

 - AbstractTestExecutionListener and all default TestExecutionListeners
   provided by Spring now implement Ordered with appropriate values.

 - Introduced "copy constructors" in MergedContextConfiguration and
   WebMergedContextConfiguration

 - SpringFactoriesLoader now uses AnnotationAwareOrderComparator
   instead of OrderComparator.

Issue: SPR-11466
2014-08-14 22:29:21 +02:00
Phillip Webb
e142fd11e0 Add tests for ImportSelector meta-data
Issue: SPR-12059
2014-08-14 07:35:16 -07:00
Sebastien Deleuze
ebc726a915 Allow null ObjectMapper in Jackson2ObjectMapperFactoryBean.getObjectType()
Issue: SPR-11785
2014-08-14 13:40:47 +02:00
Sam Brannen
181299cc6c Improve ex msg when locations & classes are declared in test hierarchy
Prior to this commit, if both locations and classes were declared via
@ContextConfiguration at differing levels in a test class hierarchy,
the exception message stated that neither of the default context
loaders was able to load an ApplicationContext from the merged context
configuration, but the message didn't explain why.

This commit adds an explicit check for such scenarios and provides a
more informative exception message similar to the following:

"Neither X nor Y supports loading an ApplicationContext from
[MergedContextConfiguration ...]: declare either 'locations' or
'classes' but not both."

Issue: SPR-12060
2014-08-14 01:23:11 +02:00
Sam Brannen
f4c23d8715 Delete trailing white space in spring-test 2014-08-14 00:30:50 +02:00
Sam Brannen
2cbd5ba993 Clean up regarding deprecated HttpStatus.MOVED_TEMPORARILY 2014-08-14 00:29:09 +02:00
Sam Brannen
3e2138855a Add @Deprecated to WebMergedContextConfiguration constructor 2014-08-14 00:22:12 +02:00
Sam Brannen
f2ac02566c Merge from sbrannen/SPR-12051
* SPR-12051:
  Introduce @TestPropertySource support in the TCF
2014-08-14 00:05:03 +02:00
Sam Brannen
2cf4147ba8 Introduce @TestPropertySource support in the TCF
Spring Framework 3.1 introduced an Environment abstraction with support
for hierarchical PropertySources that can be configured
programmatically as well as declaratively via the @PropertySource
annotation. However, prior to this commit, there was no way to
declaratively configure PropertySources in integration tests in the
Spring TestContext Framework (TCF).

This commit introduces declarative support for PropertySources in the
TCF via a new class-level @TestPropertySource annotation. This
annotation provides two options for declaring test property sources:

 - The 'locations' attribute allows developers to declare external
   resource locations for test properties files.

 - The 'properties' attribute allows developers to declare inlined
   properties in the form of key-value pairs.

Test properties files are added to the Environment before all other
property sources and can therefore override system and application
property sources. Similarly, inlined properties are added to the
Environment before all other property sources and can therefore
override system property sources, application property sources, and
test properties files.

Specifically, this commit introduces the following major changes:

 - Introduced @TestPropertySource annotation along with internal
   TestPropertySourceAttributes, MergedTestPropertySources, and
   TestPropertySourceUtils for working with test property sources
   within the TCF.

 - All TestContextBootstrappers have been modified to support the
   merged property resource locations and inlined properties from
   @TestPropertySource.

 - MergedContextConfiguration (and consequently the context caching
   key) is now additionally based on the merged property resource
   locations and inlined properties from @TestPropertySource. The same
   applies to WebMergedContextConfiguration.

 - AbstractContextLoader's prepareContext() method now adds
   PropertySources for all resource locations and inlined properties
   from the supplied MergedContextConfiguration to the Environment of
   the supplied ApplicationContext. All subclasses of
   AbstractGenericContextLoader and AbstractGenericWebContextLoader
   therefore automatically provide support for @TestPropertySource.

Issue: SPR-12051
2014-08-14 00:01:38 +02:00
Sebastien Deleuze
6665634675 Support Jackson based XML serialization/deserialization
This commit adds support for XML serialization/deserialization based on
the jackson-dataformat-xml extension. When using @EnableWebMvc or
<mvc:annotation-driven/>, Jackson will be used  by default instead of JAXB2
if jackson-dataformat-xml classes are found in the classpath.

This commit introduces MappingJackson2XmlHttpMessageConverter and
MappingJackson2XmlView classes, and common parts between JSON
and XML processing have been moved to AbstractJackson2HttpMessageConverter
and AbstractJackson2View classes.

MappingJackson2XmlView supports serialization of a single object. If the model
contains multiple entries, MappingJackson2XmlView.setModelKey() should be
used to specify the entry to serialize.

Pretty print works in XML, but tests are not included since a Woodstox dependency
is needed, and it is better to continue testing spring-web and spring-webmvc
against JAXB2.

Issue: SPR-11785
2014-08-13 16:22:58 +02:00
Juergen Hoeller
92bd240474 Polishing
Issue: SPR-12079
2014-08-13 15:04:58 +02:00
Juergen Hoeller
626a5fe4eb BeanNameViewResolver ignores non-View beans
Issue: SPR-12079
2014-08-13 14:57:40 +02:00
Phillip Webb
887815f4fa Update docbook dependency and generate epub
Issue: SPR-11167
2014-08-12 13:19:21 -07:00
Juergen Hoeller
fd5dbddac4 BeanFactory supports bean creation arguments for by-type lookup as well
Issue: SPR-11235
2014-08-12 22:07:12 +02:00
Juergen Hoeller
8dbfa80b13 Unit test for circular reference in default profile property, plus related polishing
Issue: SPR-12078
2014-08-12 19:23:36 +02:00
Juergen Hoeller
71c6eb2bb5 Additional configuration classes get detected when imported through XML or registrars
Issue: SPR-11430
Issue: SPR-11723
2014-08-12 17:23:21 +02:00
Juergen Hoeller
f1f1c4c980 Remove outdated IDE, JIRA and Tomcat references
Issue: SPR-7521
2014-08-12 16:32:20 +02:00
Sebastien Deleuze
f56000b825 Replace http by https for spring.io links in the reference documentation 2014-08-12 11:15:55 +02:00