Commit Graph

7921 Commits

Author SHA1 Message Date
Sam Brannen
67142dcb0a Polish Javadoc in @*ExceptionHandler 2014-02-05 20:15:50 +01:00
Sam Brannen
9fe9e27189 Explain after advice behavior in static method mock aspect
This commit makes it clear that mock verification will not occur if an
advised test method throws an exception.
2014-02-05 15:57:52 +01:00
Sam Brannen
76f3d6e501 Improve test coverage for AbstractMethodMockingControl
This commit improves the test coverage for AbstractMethodMockingControl
by introducing tests that verify expected behavior for:

 - reentrant method invocations via public methods
 - reentrant method invocations via private methods
 - test methods that do not set expectations or invoke playback()
 - test methods that throw exceptions

For a more complete discussion of "after" vs. "after returning" advice
within AbstractMethodMockingControl, see the Javadoc in the tests.
2014-02-05 15:41:47 +01:00
Sam Brannen
3a89bc4b26 Fix merge error in previous commit
Issue: SPR-11385
2014-02-04 23:27:55 +01:00
Sam Brannen
69a89b1bb0 Fix off-by-one regression in AbstractMethodMockingControl
This commit fixes the off-by-one regression accidentally introduced in
commit 55961544a7.

Specifically, this fix ensures that the correct recorded call is
indexed in the 'calls' list in the implementation of
AbstractMethodMockingControl.Expectations.nextCall().

In addition, this commit improves the Javadoc for
AbstractMethodMockingControl, @MockStaticEntityMethods, and
AnnotationDrivenStaticEntityMockingControl and introduces a proper
toString() implementation for the internal Expectations.Call class in
AbstractMethodMockingControl. Furthermore, code from the obsolete
Delegate test class has been inlined in
AnnotationDrivenStaticEntityMockingControlTests.

Issue: SPR-11385, SPR-10885
2014-02-04 23:14:39 +01:00
Juergen Hoeller
1cd5071e6a Use AtomicInteger instead of local synchronization around int field
Issue: SPR-11103
2014-02-04 17:45:03 +01:00
Juergen Hoeller
8a6b095204 Polishing
Issue: SPR-11386
2014-02-04 17:41:42 +01:00
Juergen Hoeller
6634c19e6a Related polishing
Issue: SPR-11386
2014-02-04 16:45:14 +01:00
Juergen Hoeller
60c1905cdd Introduced "spring.jdbc.getParameterType.ignore" property
Issue: SPR-11386
2014-02-04 16:44:08 +01:00
Rossen Stoyanchev
1a8629d408 Fix failing test 2014-02-03 21:44:13 -05:00
Sam Brannen
d90a36170a Polish Javadoc for @MockStaticEntityMethods & its aspect 2014-02-03 23:47:02 +01:00
Sam Brannen
b8ed2f4967 Ensure all tests are executed in the Gradle build
Prior to this commit several test classes named "*Test" were not
recognized as tests by the Gradle build. This is due to the configured
inclusion of '**/*Tests.*' which follows Spring's naming convention for
test classes.

This commit addresses this issue by:

 - Renaming real test classes consistently to "*Tests".
 - Renaming internal test classes to "*TestCase".
 - Renaming @WebTest to @WebTestStereotype.
 - Disabling broken tests in AnnoDrivenStaticEntityMockingControlTest.
 - Modifying the Gradle build configuration so that classes ending in
   either "*Tests" or "*Test" are considered test classes.

Issue: SPR-11384
2014-02-03 23:16:47 +01:00
Rossen Stoyanchev
1c5cab2a40 Add external entity test
Issue: SPR-11376
2014-02-03 16:57:03 -05:00
Juergen Hoeller
f053f60630 Revised javadoc and related polishing
Issue: SPR-11383
2014-02-03 16:05:00 +01:00
Juergen Hoeller
d55c22ec85 Upgraded to Apache HttpComponents HttpClient 4.3.2
Issue: SPR-11383
2014-02-03 16:02:05 +01:00
Juergen Hoeller
f27304d785 Avoid repeated assignability check for raw class on fallback match, since AutowireCandidateResolver is only being called for basic type matches to begin with
Issue: SPR-9965
2014-02-01 19:28:40 +01:00
Juergen Hoeller
874a2a9ca2 Backwards-compatible handling of generic and raw collection converters
Issue: SPR-11369
2014-02-01 19:24:40 +01:00
Rossen Stoyanchev
e6f4796779 Fix failing test 2014-02-01 10:46:51 -05:00
Juergen Hoeller
46b24dbd33 Polishing
Issue: SPR-11369
2014-02-01 12:15:01 +01:00
Juergen Hoeller
5f2429429f Defensively handle ServletRequestAttributes casting in requestDestroyed callback
Issue: SPR-11378
2014-02-01 11:04:36 +01:00
Juergen Hoeller
d52f584322 GenericConversionService matches converters by full generic target type, allowing for the registration of multiple converters from the same source type to different collection types
Issue: SPR-11369
2014-02-01 10:53:01 +01:00
Rossen Stoyanchev
da369aa826 Add null check after message conversion
AbstractMessageSendingTemplate now checks if MessageConverter.toMessage
returns null and raises an exception.

Issue: SPR-11370
2014-01-31 21:34:18 -05:00
Rossen Stoyanchev
f0a53ae54e Fine-tune default mime type in message broker config
Issue: SPR-11370
2014-01-31 20:55:07 -05:00
Rossen Stoyanchev
b6da7e2795 Fix test in Jaxb2RootElementHttpMessageConverterTests 2014-01-31 20:17:44 -05:00
Sam Brannen
a521ef5cee Verify ServletCtxAware beans are processed in WAC tests
SPR-11145 claims that ServletContextAware beans declared in an
ApplicationContext loaded for an integration test by the TestContext
framework (TCF) do not have their setServletContext() methods invoked
if the tests are executed manually using JUnit 4.11.

This commit verifies that such ServletContextAware beans are processed
properly regardless of how the test was launched. Specifically:

 - A ServletContextAwareBean has been introduced.

 - BasicAnnotationConfigWacTests has been retrofitted with a
   ServletContextAwareBean in its context.

 - ServletContextAwareBeanWacTests has been introduced to execute
   BasicAnnotationConfigWacTests manually via JUnitCore.

Issue: SPR-11145
2014-02-01 02:08:21 +01:00
Juergen Hoeller
4f60b98bca Consistent iteration over actualValue in Velocity and FreeMarker macros
This requires consistent exposure of an actualValue in BindStatus, even if no BindingResult available.

Issue: SPR-10837
2014-01-31 22:39:20 +01:00
Rossen Stoyanchev
e680e34620 Fix test class name 2014-01-31 16:26:28 -05:00
Sam Brannen
474f1b03cd Fix grammar in Javadoc for @ResponseBody 2014-01-31 17:02:40 +01:00
Sam Brannen
8c3868a8dd Polish Javadoc for EmbeddedDatabaseFactory 2014-01-31 13:33:55 +01:00
Juergen Hoeller
c2303854d1 Polishing
Issue: SPR-11372
2014-01-31 13:17:55 +01:00
Juergen Hoeller
5be8301128 Fixed isMatchingFieldError to properly handle empty field name
Also avoided unnecessary substring creation for field error access with wildcard.

Issue: SPR-11374
2014-01-31 12:47:08 +01:00
Juergen Hoeller
a537eb3a6a Polishing 2014-01-30 12:26:41 +01:00
Juergen Hoeller
c1eac209c3 Fixed LiveBeansView to not produce invalid JSON if last bean is not eligible
Also introducing overridable isBeanEligible template method.

Issue: SPR-11366
2014-01-30 12:26:22 +01:00
Spring Buildmaster
1af61ef1d5 Next development version 2014-01-28 12:16:35 -08:00
Juergen Hoeller
47395f6b0a Dropped explicit paragraph on web.xml version declaration
Issue: SPR-11364
(cherry picked from commit 36ab65a)
2014-01-28 17:34:27 +01:00
Juergen Hoeller
8570f607a7 Fixed regression with fallback for non-resolvable property type 2014-01-28 17:16:50 +01:00
Juergen Hoeller
786e217991 Minor polishing after previous polish step ;-) 2014-01-28 17:16:01 +01:00
Sam Brannen
63e023173b Polish Hibernate support and tests
- Fix Javadoc in HibernateTemplate so that it compiles in Eclipse.
 - Suppress generics warnings in HibernateTemplateTests.
 - Remove unnecessary deprecation warning suppression in constructor for
   LocalSessionFactoryBuilder.
2014-01-28 15:41:42 +01:00
Sam Brannen
5f8275a305 Merge pull request #453 from kryger/master
Fix typos and grammar in Cache Abstraction reference doc
2014-01-28 06:19:12 -08:00
Juergen Hoeller
1e303ac1af Polishing 2014-01-28 14:44:44 +01:00
Lukasz Kryger
14d3525a28 Minor corrections/typos to "27. Cache Abstraction" docs section 2014-01-28 12:30:04 +00:00
Juergen Hoeller
c5f908b174 Consistent use of headersExtractor() template method 2014-01-28 12:56:53 +01:00
Juergen Hoeller
c719c70ea9 Fixed 'globalJobListeners'/'globalTriggerListeners' to work with Quartz 2.0 & 2.1 as well
Issue: SPR-11362
2014-01-28 12:25:24 +01:00
Brian Clozel
425e5a066e Add RestTemplate constructor with custom converters
Prior to this commit, RestTemplate's constructors were all initializing
default HTTPMessageConverters. Its API provides a way to replace
those converters with custom ones, but default converters are already
defined and initialized at that point, which can be an issue in some
cases (performance, classpath...).

This commits adds a new constructor for RestTemplate with a list
of message converters as argument. With this new constructor,
default message converters are never initialized.

Issue: SPR-11351
2014-01-28 11:33:45 +01:00
Juergen Hoeller
fcbd3b121b Added test for inconsistency between read and write method
Issue: SPR-11361
2014-01-28 01:25:59 +01:00
Juergen Hoeller
d004b634a5 Fixed type resolution in case of inconsistencies between read and write method
Issue: SPR-11361
2014-01-28 00:46:15 +01:00
Juergen Hoeller
500d0da67d Polishing 2014-01-27 22:41:35 +01:00
Juergen Hoeller
1b0ce200e0 Consistent use of ${hibernate4Version} in build.gradle 2014-01-27 21:41:31 +01:00
Juergen Hoeller
bf9702294d Polishing
Issue: SPR-11291
2014-01-27 21:38:20 +01:00
Juergen Hoeller
79e17dbfa0 Introduced HibernateTemplate for Hibernate 4 as a migration helper
Note that this variant of HibernateTemplate is stripped down in terms of Session management options and just provides a current-session style with a fallback to a temporary session-per-operation.  Furthermore, in the latter fallback mode, only read operations are supported, just like with a JPA EntityManager.

Issue: SPR-11291
2014-01-27 21:37:52 +01:00