Commit Graph

6636 Commits

Author SHA1 Message Date
Juergen Hoeller fffeaee647 Minor refinements along the way of researching static CGLIB callbacks
Specifically, our CallbackFilter doesn't hold an implicit reference to the containing ConfigurationClassEnhancer class anymore.

Issue: SPR-10307
2013-03-13 16:57:59 +01:00
Phillip Webb b00f90f346 Merge pull request #252 from dharkness/patch-1
# By David Harkness
* patch-1:
  Compare Kind references before checking log levels
2013-03-13 08:52:49 -07:00
David Harkness 801f196de0 Compare Kind references before checking log levels
Assuming reference comparisons are much quicker than checking
likely-nested logger levels, perform the former first.

Also, since the reference can match only one of the instances,
use "else if" to short-circuit the search.
2013-03-13 08:52:21 -07:00
Sam Brannen 12db873002 Polish Javadoc in RequestAttributes 2013-03-13 14:11:08 +01:00
Sam Brannen bf6ee1631c Fix copy-n-paste errors in NativeWebRequest 2013-03-13 13:00:57 +01:00
Rossen Stoyanchev 0fb4b747c2 Fix issue with restoring included attributes
Before this change the DispatcherServlet restored modified and also
removed added attributes but did not restore removed attributes.

Issue: SPR-10360
2013-03-11 10:34:05 -04:00
Sam Brannen e9f74450ad Merge pull request #251 from dsyer/feature/crontest
# By Dave Syer
* dsyer-feature/crontest:
  Add additional test for daylight savings glitch
2013-03-11 02:40:08 +01:00
Dave Syer 6914aff825 Add additional test for daylight savings glitch
The problem was that clocks go forward *at* 2am, so
2am doesn't exist once a year. Users might be surprised
that their cron trigger doesn't go off one night, but that
is arguably correct (and what happens now). The test can be
modified if we decide to change the trigger behaviour.
2013-03-11 02:36:41 +01:00
Sam Brannen 4171646491 Document context hierarchy support in the TCF
This commit updates the reference manual regarding the new support for
@ContextHierarchy and hierarchy modes in @DirtiesContext.

Issue: SPR-10357
2013-03-11 02:26:33 +01:00
Chris Beams 88b9bea049 Merge pull request #250 from dsyer/feature/crontest
Fix test for daylight savings glitch
2013-03-10 10:09:54 -07:00
Dave Syer 5b6f149bf8 Fix test for daylight savings glitch 2013-03-10 10:03:15 -07:00
Rossen Stoyanchev 8ab8e4f7c2 Make the methodParameter field of HandlerMethod final
Previously the methodParameter array field was initialized lazily since
it requires reflection. However, in practice the field is always used
and there is not much benefit from the lazy initialization.

In Spring Framework 3.2, the methodParameter field was copied when a
new HandlerMethod instance (with the resolved bean) is created for
performance reasons. That introduced a synchronization issue since
the lazy initialization was not synchronized.

Issue: SPR-10365
2013-03-10 12:54:03 -04:00
Rossen Stoyanchev 3654a620fb Disable AsyncTests in spring-test-mvc 2013-03-10 10:00:01 -04:00
Sam Brannen 2b24e99d44 Reformat the testing chapter
This commit reformats the testing chapter (and adds minor polishing
changes) in order to avoid massive merge diffs in upcoming commits.

Issue: SPR-10357
2013-03-10 14:49:10 +01:00
Sam Brannen ccdb48210a Document context hierarchy support in the TCF
This commit polishes the Javadoc for @ContextHierarchy and
@ContextConfiguration.

Issue: SPR-10357
2013-03-10 14:26:19 +01:00
Sam Brannen 4e7098dc63 Document context hierarchy support in the TCF
This commit adds examples to the Javadoc for @ContextHierarchy and
updates the Javadoc for @ContextConfiguration accordingly.

Issue: SPR-10357
2013-03-10 01:39:14 +01:00
Oliver Gierke 3eb3610660 UriComponentsBuilder parse of empty fragments
Check for an empty fragment in UriComponentsBuilder.fromUriString(...)
to prevent the invocation of fragment(...).

Previously, UriComponentsBuilder.fromUriString(...) threw an exception
in the case of an empty fragment being provided (e.g. /example#).

Issue: SPR-10363
2013-03-08 22:15:26 -08:00
Rossen Stoyanchev 8e4e0f3531 Use null in MockServletContext for unknown mime types
MockServletContext.getMimeTypes now returns null if the Java Activation
Framework returns "application/octet-stream", which is the default
media type it returns if the mime type is unknown. This enforces the
contract for ServletContext.getMimeTypes (return null for uknown mime
types) but does mean "application/octet-stream" cannot be returned.

Issue: SPR-10334
2013-03-07 12:33:44 -05:00
Rossen Stoyanchev eefd1c4ca6 Add context hierarchy tests to Spring MVC Test
Issue: SPR-5613
2013-03-07 11:20:19 -05:00
Sam Brannen 4c5d771764 Merge pull request #247 from sbrannen/SPR-5613
* SPR-5613:
  Provide support for context hierarchies in the TCF
2013-03-07 02:12:33 +01:00
Sam Brannen 98074e7762 Provide support for context hierarchies in the TCF
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
2013-03-07 02:11:11 +01:00
Phillip Webb 7bc5353e07 Do not sort the mvc:resources location attribute
Update ResourcesBeanDefinitionParser to use ensure that location
attribute values remain in the order that they are specified. The
order was inadvertently changed in commit 3838d159f3 due to the use
of StringUtils.commaDelimitedListToSet which sorts items.

Issue: SPR-10355
2013-03-06 11:18:49 -08:00
Phillip Webb 85f8d6f695 Merge branch 'cleanup-3.2.x' into 3.2.x
* cleanup-3.2.x:
  Replace EasyMock with Mockito
2013-03-06 11:08:17 -08:00
Phillip Webb 05765d7520 Replace EasyMock with Mockito
Issue: SPR-10126
2013-03-06 11:06:15 -08:00
Juergen Hoeller 2302b9b48b Added locale-independent "commonMessages" property to AbstractMessageSource
Issue: SPR-10291
2013-03-06 09:53:12 +01:00
Phillip Webb a399b13354 Merge branch '3.2.x' into cleanup-3.2.x
* 3.2.x: (111 commits)
  Fix FreeMarker form checbox macro generated names
  Fix DefaultMockMvcBuilder fluent API generic type
  Catch IAE when parsing content type
  Update @RequestParam javadoc
  Fix AntPathMatcher rule for combining with extensions
  DefaultLobHandler etc
  Minor javadoc updates
  Deprecated OracleLobHandler in favor of DefaultLobHandler for the Oracle 10g driver and higher
  Added "createTemporaryLob" flag to DefaultLobHandler, using JDBC 4.0's createBlob/Clob mechanism
  Add Castor XSD information to reference docs
  Do not use Servlet 3.0 API in doOptions()
  Cache target type per bean definition and allow for specifying it in advance
  Mentioning JDBC 4's unwrap method for obtaining the native connection now
  LazyConnectionDataSourceProxy catches setReadOnly exception analogous to DataSourceUtils
  Refined predictBeanType's typesToMatch check for FactoryBeans
  Fix minor javadoc typos
  Fix incorrect closing <web-app> tag in MVC docs
  Fixed minor typo
  Suppress warnings for resource leaks
  Update spring-test re: deprecated queryForInt()
  ...
2013-03-04 11:01:14 -08:00
Juergen Hoeller db823ba1e4 DefaultListableBeanFactory clears by-type matching cache on runtime register/destroySingleton calls
Issue: SPR-10326
2013-03-04 12:29:26 +01:00
Stevo Slavic ba03d5b0c7 Fix FreeMarker form checbox macro generated names
In Spring 3.2 a fix was implemented for all Spring Freemarker form
macros so that generated form input fields have valid bracketless IDs.
In the fix a regression was introduced manifesting in formCheckbox
macro no longer generating appropriate names for checkbox and hidden
input field.

This change fixes mentioned regression issue.

Issue: SPR-8732
2013-03-01 16:30:02 -05:00
Wesley Hall fbac428e23 Fix DefaultMockMvcBuilder fluent API generic type
Changed upper bound of generic parameter for DefaultMockMvcBuilder from
MockMvcBuilder to DefaultMockMvcBuilder to allow for ongoing method
chaining in the fluent API style.

Issue: SPR-10277
2013-03-01 16:30:02 -05:00
Rossen Stoyanchev c611083415 Catch IAE when parsing content type
Issue: SPR-10308
2013-03-01 16:30:02 -05:00
Rossen Stoyanchev 3abe05c65e Update @RequestParam javadoc
Issue: SPR-10180
2013-03-01 16:30:02 -05:00
Rossen Stoyanchev 33e723b4a8 Fix AntPathMatcher rule for combining with extensions
Before this fix AntPathMatcher had a special rule for combining
patterns with wildcards and extensions as follows:

"/*.*"  + "/*.html" => "/*.html"

This change ensures this rule never applies if the first pattern
contains URI variables.

Issue: SPR-10062
2013-03-01 16:30:02 -05:00
Juergen Hoeller 4cc30fe541 DefaultLobHandler etc 2013-03-01 21:55:01 +01:00
Juergen Hoeller d3c0dd1c7e Minor javadoc updates 2013-03-01 21:55:01 +01:00
Juergen Hoeller 99c7f25b05 Deprecated OracleLobHandler in favor of DefaultLobHandler for the Oracle 10g driver and higher
Issue: SPR-10339
2013-03-01 21:55:00 +01:00
Juergen Hoeller 2bd584ca75 Added "createTemporaryLob" flag to DefaultLobHandler, using JDBC 4.0's createBlob/Clob mechanism
Issue: SPR-10339
2013-03-01 21:54:59 +01:00
Phillip Webb 7ce0406fbc Merge pull request #243 from jmnarloch/SPR-8509
# By Jakub Narloch
* SPR-8509:
  Add Castor XSD information to reference docs
2013-03-01 11:41:07 -08:00
Jakub Narloch 5d727b2d8e Add Castor XSD information to reference docs
Update the Spring OXM reference documentation to include changes
introduced in CastorMarshaller, specifically around CastorMarshaller
XSD configuration.

Issue: SPR-8509
2013-03-01 11:40:32 -08:00
Phillip Webb b27fc0ef30 Do not use Servlet 3.0 API in doOptions()
Refactor FrameworkServlet.doOptions() to capture the "Allow" header
by using a HttpServletResponseWrapper.

Prior to this commit the HttpServletResponse.getHeader() method was
used which is only available in Servlet 3.0 environments.

Issue: SPR-10341
2013-03-01 10:31:08 -08:00
Juergen Hoeller c986a1efc1 Cache target type per bean definition and allow for specifying it in advance
Issue: SPR-10335
2013-03-01 16:43:24 +01:00
Juergen Hoeller 6a043e3ea1 Mentioning JDBC 4's unwrap method for obtaining the native connection now 2013-03-01 16:05:27 +01:00
Juergen Hoeller 1716c171d8 LazyConnectionDataSourceProxy catches setReadOnly exception analogous to DataSourceUtils
Also mentioning JDBC 4's unwrap method for obtaining the native connection now.

Issue: SPR-10312
2013-03-01 16:04:10 +01:00
Juergen Hoeller e0c7571a41 Refined predictBeanType's typesToMatch check for FactoryBeans
GroovyScriptFactoryTests passes again now.

Issue: SPR-10304
2013-03-01 15:52:24 +01:00
Phillip Webb 9929182e30 Merge pull request #242 from carsonmcdonald/fix-typos-3
# By Carson McDonald
* fix-typos-3:
  Fix minor javadoc typos
2013-02-28 16:02:45 -08:00
Carson McDonald 39c236baa8 Fix minor javadoc typos 2013-02-28 15:56:58 -08:00
Phillip Webb d9e6f2ad09 Merge pull request #241 from nurkiewicz/patch-1
# By Tomasz Nurkiewicz
* patch-1:
  Fix incorrect closing <web-app> tag in MVC docs
2013-02-28 15:50:53 -08:00
Tomasz Nurkiewicz c4ba8ce124 Fix incorrect closing <web-app> tag in MVC docs 2013-02-28 15:49:44 -08:00
Phillip Webb 18df9fed92 Fixed minor typo
Issue: SPR-10210
2013-02-28 15:37:10 -08:00
Sam Brannen 381f7fe6df Suppress warnings for resource leaks 2013-02-28 13:48:15 +01:00
Sam Brannen 4bdf382714 Update spring-test re: deprecated queryForInt()
Now invoking JdbcTemplate's queryForObject() method instead
of the deprecated queryForInt() method within the test suite.

Issue: SPR-10257
2013-02-28 13:46:56 +01:00