Commit Graph

5996 Commits

Author SHA1 Message Date
Juergen Hoeller 9b6ec5bfab DeprecatedBeanWarner detects deprecated FactoryBean classes and always logs user-specified bean type 2012-12-12 03:29:46 +01:00
Juergen Hoeller 9deaefe74d AbstractCachingViewResolver uses a cache limit of 1024 by default, avoiding overflow for redirect URLs
Issue: SPR-10065
2012-12-12 03:29:45 +01:00
Juergen Hoeller 1cb6e3dbb6 Several enhancements with respect to CachingMetadataReaderFactory handling.
Added "clearCache()" method to CachingMetadataReaderFactory, for clearing the metadata cache once not needed anymore - in particular when the MetadataReaderFactory instance is long-lived. Also added "setMetadataReaderFactory" method to ClassPathScanningCandidateComponentProvider, analogous to ConfigurationClassPostProcessor.
2012-12-12 03:29:44 +01:00
Juergen Hoeller e298658ef0 Polishing 2012-12-12 03:29:44 +01:00
Juergen Hoeller 801d4714b1 Fixed CGLIB proxy class leaks through further equals/hashCode implementations in Spring AOP pointcuts
Issue: SPR-8008
2012-12-12 03:29:43 +01:00
Juergen Hoeller 7af92b483a Fixed HierarchicalUriComponents equals implementation
Issue: SPR-10088
2012-12-12 03:29:42 +01:00
Sam Brannen d4c55838ad Document testing in "New in Spring 3.2" sect.
This commit adds documentation to the "New Features and Enhancements in
Spring 3.2" section of the reference manual regarding new testing
features.

Issue: SPR-9941
2012-12-12 01:38:23 +01:00
Sam Brannen a1053d4364 Document WebApplicationContext support in the TCF
This commit adds documentation for the following new features in the
Spring TestContext Framework within the Testing chapter of the reference
manual.

 - @WebAppConfiguration and context caching
 - WebDelegatingSmartContextLoader
 - AnnotationConfigWebContextLoader
 - GenericXmlWebContextLoader
 - Loading a WebApplicationContext in integration tests
 - ServletTestExecutionListener
 - Testing request and session scoped beans

Issue: SPR-9864
2012-12-12 00:56:26 +01:00
Sam Brannen 7f1b990ee9 Reformat the Testing chapter
Reformatted the Testing chapter in preparation for upcoming changes.
2012-12-11 22:47:44 +01:00
Rossen Stoyanchev acf32726d7 Add documentation for Spring MVC Test
Issue: SPR-9860, SPR-9886
2012-12-11 16:11:47 -05:00
Sam Brannen 4be2d15950 Reformat the Testing chapter
Reformatted the Testing chapter in preparation for upcoming changes.
2012-12-11 22:03:18 +01:00
Phillip Webb 6fed79cb10 Ensure buildSrc is only added once to eclipse 2012-12-10 20:54:56 -08:00
Sam Brannen a6387dc725 Document WebApplicationContext support in the TCF
This commit adds Javadoc documentation for the WebApplicationContext
testing support that was recently introduced in the Spring TestContext
Framework.

Issue: SPR-9864
2012-12-11 01:58:10 +01:00
Phillip Webb c8a3562933 Update test tiles.xml files to use v3 DTD
Update tiles.xml files used with tests to reference tiles-config_3_0
instead of tiles-config_2_1 DTD.

Prior to this commit tiles based tests would fail when building
offline or behind a proxy server.
2012-12-10 15:39:47 -08:00
Phillip Webb 25a7136a96 Merge pull request #199 from rwinch/SPR-10059
* SPR-10059:
  Make DeferredResult extensible
2012-12-10 13:47:12 -08:00
Rob Winch be7b07f832 Make DeferredResult extensible
Previously it was cumbersome to associate data or behavior to a
DeferredResult because it was marked as final and had no extension
points.

Now DeferredResult is non-final which allows subclasses to associate
additional data and behavior to it.

Issue: SPR-10059
2012-12-10 13:41:14 -08:00
Rob Winch 455701d2ee Merge plugin copies exclude rules
Previously the 'merge from' project's configurations exclude rules were
not used in the dynamically created 'merge into' project configurations.
This meant that the pom generation for 'merge into' project did not
exclude the dependencies from the 'merge from' project's configuration
excludes.

Now the exclude rules are copied into the dynamically created
'merge into' project's configurations.
2012-12-10 13:29:10 -08:00
Phillip Webb 809d62e318 Add buildSrc to generated eclipse project
Post process the generated 'spring' eclipse project to include the
buildSrc/src/main/groovy folder.
2012-12-10 13:09:23 -08:00
Phillip Webb 42bbcc3220 Move Merge plugin into a build package structure 2012-12-10 00:32:00 -08:00
Phillip Webb b206e6891f Renamed buildsrc to buildSrc
Rename buildsrc folder to buildSrc to follow Gradle conventions.
2012-12-09 23:13:23 -08:00
Phillip Webb 9e790829d9 Upgrade reference plugin to version 0.2.3
Upgrade to the latest reference plugin, providing slightly refined
titlepage and admon graphics.
2012-12-09 21:33:35 -08:00
Phillip Webb 87f7ecf907 Refactor merge-artifacts script to a plugin
Refactor the existing merge-artifacts script to a full Gradle plugin.
The new plugin uses a 'merge' extension in favor of Gradle 'ext'
configuration and can be applied to all projects in a multi-module
build.

Any project that defines a 'merge.into' project will now implicitly
receive a dependency to that project. Furthermore other projects
with a dependency on 'merge.into' will receive a direct project
link within the IDE. For example: 'spring-webmvc-tiles3'
is merged into 'spring-webmvc' and 'spring-test-mvc' depends
on 'spring-webmvc'. Within the IDE 'spring-test-mvc' will show
dependencies to both 'spring-webmvc' and 'spring-webmvc-tiles'.

Issue: SPR-10042
2012-12-09 21:33:35 -08:00
Phillip Webb 4551cfcdfc Remove superfluous exclusions from Gradle build
Remove several dependency exclusions from the Gradle build that are
no longer required and were not present in Spring 3.1.
2012-12-09 21:33:34 -08:00
Phillip Webb 0751b2cbeb Convert Gradle build to use new propdeps-plugin
Replace existing 'optional' and 'provided' Spring specific build
extensions with a new Gradle propdeps-plugin. Optional and Provided
dependencies are now defined use dependency configurations.

The new plugin does not currently support the notion of optional
runtime dependencies. All optional dependencies are implicitly
part of the 'compile' scope. This is an intentional design decision
that aims to keep both the plugin and the build simple. Since optional
dependencies are non-transitive this restriction should not cause
any real problems for existing users. The only existing dependency
affected is 'commons-io' in the 'spring-beans' project, however, this
was an optional compile scope dependency in the previous Spring 3.1
release.

Both provided and optional dependencies are no longer exported from
generated eclipse .classpath files. This fixes several tests that
would previously fail when running within eclipse. The servlet-api
specific elements of ide.gradle are also no longer required.

Issue: SPR-9656, SPR-10070
2012-12-09 21:33:34 -08:00
Phillip Webb 7cc406ffc7 Depend on javax.servlet for version 3.0 API
Replace tomcat servlet-api 3.0 dependencies with the javax.servlet
versions that are now available in the Maven central repository.
2012-12-09 21:33:34 -08:00
Phillip Webb 6103a7f1c1 Upgrade log4j dependency to version 1.2.17
Upgrade to the latest stable release of log4j. The previous 'jms'
and 'jmx' exclusions are not longer required since these have now
been marked as optional dependencies in the upstream POM.
2012-12-09 21:33:34 -08:00
Phillip Webb dc708c5baa Removed unused gradle import
Remove the unused ProjectDependency import from the Gradle build file.
2012-12-09 21:33:17 -08:00
Phillip Webb 22741b1fdc Use consistent Gradle dependency style
Update all Gradle files to use a consistent style when specifying
dependencies. All dependencies are now specified using parentheses,
for example:

   scope("group:artifat:version")
or scope(project(":projectname"))
2012-12-09 21:32:28 -08:00
Phillip Webb 90cfdbb040 Polish quote styles in gradle files
Replace singe quote-marks with double quote-marks when possible for a
more consistent style.
2012-12-09 21:32:27 -08:00
Phillip Webb a268528726 Polish .gradle file formatting to use tabs
Replace spaces with tabs for consistency with Java source code
2012-12-09 21:32:27 -08:00
Sam Brannen 756bff8e0a Improve Javadoc in SpringServletContainerInitializer 2012-12-08 17:30:50 +01:00
Sam Brannen a436a57503 Move tests to spring-test module
When Spr9799XmlConfigTests and Spr9799AnnotationConfigTests were
created, there were issues with the classpath related to slf4j
dependencies that made it impossible for these classes to reside in the
spring-test module. Consequently, these tests were added to the
spring-test-mvc module. However, the issues with slf4j have since been
resolved in the Gradle build, and this commit therefore moves these test
classes to the spring-test module where they belong.

Issue: SPR-9799
2012-12-08 14:26:47 +01:00
Rossen Stoyanchev 85a552daed Fix package cycle among http message converters
This change introduces a new AllEncompassingFormHttpMessageConverter
class that adds JSON and XML converters for individual mime parts of
a multi-part request. The new converter is used in place of the
previously used XmlAwareFormHttpMessageConverter.

Issue: SPR-10055
2012-12-07 18:12:11 -05:00
Rossen Stoyanchev d309bb4bbb Add web-fragment.xml to spring-web
The servlet spec treats any jar in WEB-INF/lib as a web fragment:
"A plain old jar file in the WEB-INF/lib directory with no web-
fragment.xml is also considered a fragment" (section 8.2.1)

This change adds a web-fragment.xml giving the web fragment an
explicit name, "spring_web", and indicating there is no need
to scan for Servlet annotations in the spring-web.jar itself
through metadata-complete=true.

This allows applications that choose to include only specific
web fragments, through the <absolute-ordering> element in web.xml
to also include the "spring_web" fragment, in order to enable scanning
for WebApplicationInitializer types.
2012-12-07 17:30:44 -05:00
Rossen Stoyanchev 6e7df513f1 Exclude jcl-over-slf4j from tiles-core dependency
tiles-core-3 brings in a dependency on jcl-overl-slf4 which causes
an slf4j delegation loop as explained at [1] when tests run inside
Eclipse. Other modules that depend on tiles-core like
(tiles-servlet, tiles-jsp) have also had the exclusion added since
they seem to bring it in as well.

[1] http://www.slf4j.org/codes.html#jclDelegationLoop
2012-12-07 16:10:38 -05:00
Rossen Stoyanchev 3643d92cb8 Fix issue with creating ServletRequestAttributes
Prevously the FrameworkServlet created a new ServletRequestAttributes
instance for every request, unless the RequestContextHolder already
contained an instance whose type is not ServletRequestAttributes.
The main intent was that if RequestContextHolder contains a
PortletRequestAttributes, it should be left in place.

This change does an "instanceof" check against the request in
RequestContextHolder instead of an "equals" check on the type.
It still leaves PortletRequestAttributes in place but also allows
the previous request to be any sub-class of ServletRequestAttributes.

Issue: SPR-10025
2012-12-07 15:19:38 -05:00
Sam Brannen 69ace01640 Clean up warnings in spring-test
- Deleted unused imports.

 - Switched from junit.framework.Assert to org.junit.Assert, since the
   former is deprecated as of JUnit 4.11.

 - Suppressed warnings for continued deprecated usage of
   junit.framework.Assert.
2012-12-07 12:26:27 +01:00
Sam Brannen 2233949a0f Fix typo 2012-12-07 12:06:21 +01:00
Rossen Stoyanchev 9cc4bd892a Fix issue with suffix pattern match
Spring Framework 3.2 M2 added the ability to map requests using only
file extensions registered through the configured through a
ContentNeotiationManager, as opposed to allowing any file extension
(i.e. ".*"). The MVC namespace the MVC Java config automatically
register extensions such as ".json" and ".xml" depending on libraries
found on the classpath. That in turn causes issues in cases where
additional extensions are in use but not registered (e.g. ".html").

This change ensures that matching with registered file extensions only
works only if explicitly enabled through a property on
RequestMappingHandlerMapping.

Issue: SPR-10061, SPR-8474
2012-12-06 18:31:32 -05:00
Phillip Webb fb05c7b33c Replace SLF4J with ACL TilesConfigurer for Tiles 3
Replace the use of SLF4J LoggerFactory and Logger classes with Apache
commons-logging LogFactory and Log.

Issue: SPR-10077
2012-12-06 10:12:14 -08:00
Rossen Stoyanchev 31cb14e03a Remove Spring Security sample tests in spring-test-mvc
Those tests as well as Spring Hateoas tests will be added to respective
projects instead.
2012-12-05 19:10:13 -05:00
Juergen Hoeller d6b9c6a475 Removed coverage of deprecated java.util.Timer support
Issue: SPR-10050
2012-12-05 19:19:24 +01:00
Juergen Hoeller a92f7dd474 ConfigurationClassPostProcessor consistently uses ClassLoader, not loading core JDK classes via ASM
Issue: SPR-10058
2012-12-05 19:12:05 +01:00
Sam Brannen 8a422f48c6 Update changelog re: comments in SQL statements
Issue: SPR-9982, SPR-10075
2012-12-05 17:49:47 +01:00
Sam Brannen aa16caa2ac Support comments in statements in RDbPopulator
Prior to this commit, executing an SQL script via
ResourceDatabasePopulator would fail if a statement in the script
contained a line comment within the statement.

This commit ensures that standard SQL comments (i.e., any text beginning
with two hyphens and extending to the end of the line) are properly
omitted from the statement before executing it.

In addition, multiple adjacent whitespace characters within a statement,
but outside a literal, are now collapsed into a single space.

Issue: SPR-10075
2012-12-05 17:41:24 +01:00
Sam Brannen d0f687f028 Support comments in statements in JdbcTestUtils
Prior to this commit, executing an SQL script with JdbcTestUtils would
fail if a statement in the script contained a line comment within the
statement.

This commit ensures that standard SQL comments (i.e., any text beginning
with two hyphens and extending to the end of the line) are properly
omitted from the statement before executing it.

In addition, multiple adjacent whitespace characters within a statement
but outside a literal are now collapsed into a single space.

Issue: SPR-9982
2012-12-05 16:58:26 +01:00
Rossen Stoyanchev d1a6ceecc2 Update @ModelAttribute javadoc
The @ModelAttribute javadoc now explicitly mentions that model content
is not available after an Exception is raised. This is a very common
question given that @ExceptionHandler methods are co-located with
@ModelAttribute and @RequestMapping methods.

Issue: SPR-10071
2012-12-05 09:42:01 -05:00
Sam Brannen 2b4ecfad12 Upgrade to JUnit 4.11
This commit upgrades the compile dependency on JUnit in the spring-test
module as well as the global test dependency on JUnit for the entire
test suite to 4.11 GA.

In addition, the spring-test module now depends on junit:junit instead
of junit:junit-dep since, as of JUnit 4.11, the "junit" Maven artifact
no longer inlines hamcrest-core.

Issue: SPR-10044
2012-12-05 11:29:50 +01:00
Sam Brannen 31dfffde52 Update TODOs with new JIRA issue
Issue: SPR-8116, SPR-10074
2012-12-05 10:45:40 +01:00
Sam Brannen 025d111efc Re-enable and document @Ignore'd tests
Documented why static nested test cases in the spring-test module are
ignored, explaining that such "TestCase classes are run manually by the
enclosing test class". Prior to the migration to Gradle (i.e., with
Spring Build), these tests would not have been picked up by the test
suite since they end with a "TestCase" suffix instead of "Test" or
"Tests".

Re-enabled HibernateMultiEntityManagerFactoryIntegrationTests.

For the remaining tests that were disabled as a result of the migration
to Gradle, comments have been added to the @Ignore declarations.

Issue: SPR-8116, SPR-9398
2012-12-05 10:31:31 +01:00