Commit Graph

10730 Commits

Author SHA1 Message Date
Sam Brannen d67d8ddf2d Fix formatting 2015-07-21 18:24:52 +02:00
Sam Brannen 2dfa1804f4 Document AopTestUtils in the reference manual
Issue: SPR-13006
2015-07-21 17:32:30 +02:00
Sam Brannen 420e8ca833 Sync Javadoc and reference manual regarding ReflectionTestUtils 2015-07-21 17:10:00 +02:00
Sam Brannen 6b84c332fd Polishing 2015-07-21 15:13:21 +02:00
Brian Clozel 088a50c1fb Improve setDateHeader impl in MockServletResponse
Prior to this change, calling the `setDateHeader` method on a
MockHttpServletResponse instance (internal implementation for testing
the spring-web module) would just store the given long value in a Map,
not writing it as a formatted date String.

This can be problematic when testing features related to date headers
such as "Expires", "If-Modified-Since", "Last-Modified", etc.

This commit formats long dates into date Strings using the date format
recommended by the RFC and the GMT time zone.
2015-07-21 14:28:44 +02:00
Brian Clozel eef937e4f2 Rename <mvc:cachecontrol/> to <mvc:cache-control/> 2015-07-21 12:09:25 +02:00
Brian Clozel 9149bf7ad4 Polish 2015-07-21 11:57:02 +02:00
Brian Clozel 327785d19e Fix typo in resource handling reference doc 2015-07-21 10:36:14 +02:00
Felix 09e3fc40e5 Reset Pragma header in WebContentGenerator
As filter-based libraries and projects (such as Spring Security) may
use the "Pragma" header in HTTP responses, WebContentGenerator should
make sure that such headers are overwritten to avoid clashes with
the HTTP caching headers set by the HTTP caching configuration.

Issue: SPR-13252
2015-07-21 10:08:04 +02:00
Sam Brannen d8fb6c557d Delete unused imports in HeaderAssertionTests 2015-07-20 23:57:46 +02:00
Brian Clozel dba46c1358 Partial revert of SPR-13090
Use ServletHttpResponse.setDateHeader whenever possible and avoid using
SimpleDateFormat.
2015-07-20 22:48:20 +02:00
Sam Brannen 19fcb72d70 Polish Javadoc in the Spring MVC Test Framework 2015-07-20 22:41:30 +02:00
Sam Brannen bf06bf33ab Reuse mock request from the TCF in Spring MVC Test
Prior to this commit, the Spring MVC Test Framework always created a
new MockHttpServletRequest, disregarding any mock request already
present in Spring Web's RequestContextHolder -- for example, one
created by the ServletTestExecutionListener in the Spring TestContext
Framework (TCF).

This commit modifies MockHttpServletRequestBuilder so that it reuses a
mock request created by the TCF. However,
MockMultipartHttpServletRequestBuilder continues to always create a new
MockMultipartHttpServletRequest since a MockHttpServletRequest created
by the TCF is not directly compatible with a
MockMultipartHttpServletRequest. Furthermore, in order to avoid
unforeseen side effects, MockHttpServletRequestBuilder will always
create a new MockHttpServletRequest if a mock request is present in the
RequestContextHolder but not created by the TCF.

Issue: SPR-13211
2015-07-20 22:41:29 +02:00
Sam Brannen 24ff4f56e1 Introduce logging in TomcatWebSocketTestServer
This commit replaces calls to System.out.println() with explicit logging.
2015-07-20 17:03:44 +02:00
Sam Brannen 0153913ef4 Polish and simplify EnableSchedulingTests 2015-07-20 14:55:48 +02:00
Sam Brannen c3e36ad960 Polish further resources section in Testing chapter 2015-07-20 14:39:35 +02:00
Juergen Hoeller 34a81b605a PropertyOrFieldReference defensively catches Exception instead of just AccessException
Issue: SPR-13247
2015-07-20 13:04:34 +02:00
Juergen Hoeller cad0665187 Fixed exception message expectation plus formatting
Issue: SPR-13236
2015-07-20 13:01:14 +02:00
Sebastien Deleuze 57d55ddd56 Polish CorsFilter Javadoc 2015-07-20 11:14:37 +02:00
Sebastien Deleuze 70a03ee2a4 Rename CorsConfigurationMapping to UrlBasedCorsConfigurationSource
Issue: SPR-13192
2015-07-20 10:47:24 +02:00
Sam Brannen e9f64cf9ae Sync Servlet mocks between spring-test & spring-web 2015-07-19 20:23:51 +02:00
Sam Brannen 6950d977c2 Polish and simplify DispatcherServletInitializerTests 2015-07-19 19:52:38 +02:00
Sam Brannen 9124907b29 Polish and simplify Jackson2ObjectMapperFactoryBeanTests 2015-07-19 19:29:12 +02:00
Sam Brannen 5f3506ae8f Suppress build warnings in tests 2015-07-19 19:28:16 +02:00
Sam Brannen 0d0e879ed0 Upgrade to TestNG 6.9.6 2015-07-17 23:17:07 +03:00
Juergen Hoeller c3e57dd245 AsyncAnnotationBeanPostProcessor tries to find TaskExecutor by type/name
Issue: SPR-13248
2015-07-17 18:55:46 +02:00
Juergen Hoeller fca33f53e3 Ported test adaptations to JPA 2.1 variant
Issue: SPR-13243
2015-07-17 18:52:02 +02:00
Juergen Hoeller 8e55ad1c08 Polishing 2015-07-17 16:33:15 +02:00
Juergen Hoeller 66d8c2819f ScheduledAnnotationBeanPostProcessor falls back to "taskScheduler" bean by name
Issue: SPR-13236
2015-07-17 16:29:48 +02:00
Juergen Hoeller 0cce41eb94 Fixed exception message expectation plus formatting
Issue: SPR-13067
2015-07-17 16:19:11 +02:00
Juergen Hoeller cc0a4c1ea0 Upgrade to Jetty 9.3.1 and Undertow 1.2.9 2015-07-17 15:25:51 +02:00
Juergen Hoeller 203f1225c3 Polishing 2015-07-17 15:25:43 +02:00
Juergen Hoeller 7e2a662f63 Enforce TransactionRequiredException for pre-bound EntityManager without actual transaction active
Issue: SPR-13243
2015-07-17 15:25:29 +02:00
Juergen Hoeller 2f8ac91872 Only attempt to call joinTransaction in case of actual transaction active
Issue: SPR-13242
2015-07-17 15:24:52 +02:00
Juergen Hoeller a8fb551b1c Allow for overriding of computeTransactionAttribute
Issue: SPR-13246
2015-07-17 15:24:24 +02:00
Juergen Hoeller 9de824b73d AllEncompassingFormHttpMessageConverter registers MappingJackson2XmlHttpMessageConverter and GsonHttpMessageConverter (for consistency with RestTemplate and WebMvcConfigurationSupport)
Issue: SPR-13240
2015-07-17 15:24:12 +02:00
Juergen Hoeller aedef43a9a Exception fine-tuning and general polishing
Issue: SPR-13067
2015-07-17 15:24:04 +02:00
Juergen Hoeller 9f15f347bf Renamed 'name' attribute to 'scopeName' (in order to avoid common override conflicts)
Issue: SPR-13239
2015-07-17 15:23:47 +02:00
Brian Clozel 106cce58cc Fix tests
Issue: SPR-13241
2015-07-17 13:32:38 +02:00
Brian Clozel ec5019dbae Upgrade to groovy 2.4.4 2015-07-17 11:09:56 +02:00
Brian Clozel 064abad9d8 PathResourceResolver should not resolve root path
When resolving resources, the PathResourceResolver creates a Resource
instance and checks whether this resource `exists()` and `isReadable()`.
While that last call returns false for folders on the file system, both
calls return true for folders located inside JARs.

If a JAR location is configured as a resource location, then
PathResourceResolver can resolve folders in JARs as valid locations and
candidates for paths resolution.

Prior to this change, the PathResourceResolver would resolve "" as a
valid resource path (here, the "/META-INF/resources/webjars" if
configured, for example) and return a "" path for this resource,
effectively turning all "/" URLs into empty ones "".

This commit fixes the resolveUrlPathInternal implementation by not
allowing empty paths as valid resource paths.

Issue: SPR-13241
2015-07-17 10:31:37 +02:00
Stephane Nicoll 8e479e28ce Merge pull request #839 from michalkarolik/ResultActionsJavadocFix
* pr/839:
  Fix package references
2015-07-16 11:28:38 +02:00
Michal Karolik 95fe5f9033 Fix package references
Closes gh-839
2015-07-16 11:28:12 +02:00
Stephane Nicoll f120f22d51 Merge pull request #838 from mdeinum/SPR-13238
* pr/838:
  Update book reference
2015-07-16 09:26:48 +02:00
Marten Deinum 92663ec27b Update book reference
Closes gh-838

There is a new version of AspectJ in Action which is now mentioned in the
Further Resources section of the AOP chapter.
2015-07-16 09:25:39 +02:00
Juergen Hoeller d183bbb667 Javadoc refinements, exception fine-tuning, general polishing
Issue: SPR-13034
2015-07-15 15:42:17 +02:00
Juergen Hoeller 2577ac300b Refined spring-oxm test execution check for compatibility with the recently announced JDK 9 version scheme
Issue: SPR-13012
2015-07-15 15:21:37 +02:00
Sebastien Deleuze 34de167e59 Support non thread-safe ScriptEngine in ScriptTemplateView
This commit adds a new sharedEngine property to ScriptTemplateConfigurer
and ScriptTemplateView in order to support non thread-safe ScriptEngine
implementations like Nashorn.

When this flag is set to false, the engine is retrieved from a
ThreadLocal<ScriptEngine> field instead of a ScriptEngine one.

Also as part of this commit, all the initialization logic has been moved from
ScriptTemplateConfigurer to ScriptTemplateView since the script engine can
now be lazily initialized multiple time in the view when sharedEngine is
set to false.

Issue: SPR-13034
2015-07-15 13:39:33 +02:00
Juergen Hoeller 0783a1c667 SpEL selection/projection works with Iterable as well
Issue: SPR-13231
2015-07-15 11:22:52 +02:00
Juergen Hoeller ea2a1d33d9 Javadoc fixes plus additional polishing 2015-07-15 02:19:46 +02:00