Commit Graph

510 Commits

Author SHA1 Message Date
Juergen Hoeller 479d073f1b Adapted orm.hibernate4 and HibernateJpaVendorAdapter to avoid deprecation warnings on Hibernate 4.3 final
Issue: SPR-11240
2013-12-17 16:46:58 +01:00
Juergen Hoeller 92816492ed Established well-defined registration order for Hibernate package scanning
Issue: SPR-7742
2013-12-10 16:47:17 +01:00
Phillip Webb 043a41e382 Consistent whitespace after imports
Update code to have a consistent number of new-line characters after
import statements.
2013-11-26 15:14:43 -08:00
Phillip Webb 59002f2456 Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.

Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.

Issue: SPR-11064
2013-11-25 12:52:42 -08:00
Phillip Webb d9c4470461 Upgrade to HSQLDB 2.3.1
Replace `hsqldb:hsqldb:1.8.0.10` with `org.hsqldb:hsqldb:2.3.1` and
fix breaking tests.

Issue: SPR-10947
2013-11-21 15:48:17 -08:00
Rossen Stoyanchev 5d8fac86d7 Add timeout async request handling to OSIV components
This change adds async web request timeout handling to OSIV filters
and interceptors to ensure the session or entity manager is released.

Issue: SPR-10874
2013-10-30 22:54:21 -04:00
Juergen Hoeller 4675bc4e0c Cache InjectionMetadata per bean name instead of per Class, if possible
Issue: SPR-11027
2013-10-26 14:03:11 +02:00
Juergen Hoeller 393cfcff40 Cache InjectionMetadata per bean name instead of per Class
Issue: SPR-11027
2013-10-26 02:21:38 +02:00
Juergen Hoeller da0128f120 Javadoc cleanup for Hibernate 3.6+ 2013-08-20 19:16:44 +02:00
Juergen Hoeller a65bc3851b Introduced local support for Hibernate 3.6 and 4.x exception translation to HibernateJpaDialect
Since Hibernate 3.6 and 4.x differ in exception handling now, this change makes HibernateJpaDialect independent from orm.hibernate3 now and avoids introducing a conditional dependency on orm.hibernate4.

Issue: SPR-10815
2013-08-20 19:10:39 +02:00
Juergen Hoeller 3b211335c7 Explicit support for Hibernate 3.6's QueryTimeoutException, PessimisticLockException and OptimisticLockException
Issue: SPR-10815
2013-08-20 19:05:23 +02:00
Juergen Hoeller f3b223034d Explicit support for JPA 2.0's QueryTimeoutException, LockTimeoutException and PessimisticLockException
Issue: SPR-10815
2013-08-20 19:02:02 +02:00
Juergen Hoeller 219eeb2369 Added JPA 2.0 compliant "sharedCacheMode" and "validationMode" properties to DefaultPersistenceUnitManager and LocalContainerEntityManagerFactoryBean
Issue: SPR-10764
2013-08-02 17:43:34 +02:00
Juergen Hoeller a841923f12 Scan for JPA 2.1 Converter annotation as well
Issue: SPR-10799
2013-08-02 11:08:30 +02:00
Juergen Hoeller 85c9ed005d Fixed misunderstanding with respect to excludeUnlistedClasses default in JPA 2.0
Issue: SPR-10767
(cherry picked from commit d0948f1)
2013-08-01 00:20:21 +02:00
Juergen Hoeller 2e4eb9fc10 Resource-based PlatformTransactionManager implementations defensively catch Throwable in doBegin in order to reliably close resource in case of OutOfMemoryError
Issue: SPR-10755
2013-07-24 15:29:10 +02:00
Nick Williams 7ad540d97b Parse JPA <exclude-unlisted-classes> correctly
Fix PersistenceUnitReader to correctly read <exclude-unlisted-classes>
in both JPA 1.0 and 2.0 persistence.xml files.

Prior to this commit PersistenceUnitReader would set the value of
excludeUnlistedClasses to true when a <exclude-unlisted-classes> element
was present, regardless of its value.

The following rules are now used when parsing:

- If the <exclude-unlisted-classes> element is missing the appropriate
  default value is set (based on the JPA version).

- If an empty <exclude-unlisted-classes/> element is found the
  excludeUnlistedClasses property is set to true.

- Otherwise the value of the <exclude-unlisted-classes> element is used
  to set the excludeUnlistedClasses property.

Issue: SPR-10767
2013-07-22 12:25:40 -07:00
Oliver Gierke b552c6e1d8 Fixed potential NPE in SharedEntityManagerCreator
Fix SharedEntityManagerCreator.createSharedEntityManager to correctly
forward an empty array in case that EntityManagerFactoryInfo returns
null from getEntityManagerInterface().

Previously the var-args invocation had turned null into an array with
a null value which caused a NullPointerException in the call to
Proxy.newProxyInstance() further down the call stack.

Issue: SPR-10678
2013-07-19 13:44:39 -07:00
Carson McDonald ae74a2158a Fix typo {explictly => explicitly}
- cherry-pick of pull request #257, which originally applied to 3.2.x
2013-05-31 08:22:36 +02:00
Rob Winch 9468548116 Add @Override to remaining source files
Issue: SPR-10130
2013-05-13 17:04:56 -05:00
Juergen Hoeller 2a44228b98 Consistent use of <pre class="code">
Issue: SPR-8108
2013-05-07 21:31:26 +02:00
Juergen Hoeller 942cab4d87 OpenJpaDialect javadoc makes no reference to TopLink anymore 2013-03-30 01:39:10 +01:00
Juergen Hoeller 6e6446cc7c EclipseLinkJpaDialect uses JPA 2.0's EntityManager unwrap method now for retrieving the underlying UnitOfWork/Connection 2013-03-30 01:36:29 +01:00
Juergen Hoeller 184455d630 Upgraded to Hibernate 4.2.0
HibernateJpaDialect's HibernateConnectionHandle does not call close() for Hibernate 4.x anymore, since on 4.2, the exposed Connection handle isn't a "borrowed connection" wrapper but rather the actual underlying Connection - with a close() call immediately returning the Connection to the pool and making the local handle invalid for further use within the transaction.

Also using JPA 2.0's EntityManager unwrap method now for retrieving the underlying Hibernate Session.

Issue: SPR-10395
2013-03-30 01:34:18 +01:00
Juergen Hoeller 9caa514c69 Removed deprecated JpaTemplate and JpaInterceptor classes; dropped unused EntityManager(Factory)Plus mechanism 2013-03-29 13:18:33 +01:00
Juergen Hoeller 7ceb02257e Removed deprecated JdoTemplate and JdoInterceptor classes; formally requiring JDO 3.0+ now 2013-03-29 13:17:13 +01:00
Juergen Hoeller cc0ea4a824 Removed deprecated saveOrUpdateAll method from HibernateOperations 2013-03-29 00:19:43 +01:00
Juergen Hoeller 541f3edd9e Fully upgraded orm.hibernate3 package to require Hibernate 3.6+ now 2013-03-29 00:19:02 +01:00
Juergen Hoeller 9f9dc34b53 No @Override annotations for JPA 2.1 methods since we're building against JPA 2.0
Issue: SPR-8194
2013-03-28 00:05:37 +01:00
Juergen Hoeller ff160f9aeb JPA 2.1 support, in particular for SynchronizationType.UNSYNCHRONIZED
In the course of this effort, our joinTransaction() support has been overhauled to work for shared EntityManagers as well, since an unsynchronized shared EntityManager will nevertheless be scoped for the current transaction but not automatically join it (as per the JPA 2.1 spec). In the JTA case, we'll simply create an unsynchronized target EntityManager and will upgrade it to a synchronized one (later in the same transaction, if necessary) through an implicit joinTransaction() call. In the JpaTransactionManager case, we'll unbind the primary target EntityManager and will expose an unsynchronized EntityManager instead, upgrading it the same way as with JTA, with the primary EntityManager in that case just serving as a vehicle for transaction begin/commit/rollback calls.

For extended EntityManagers, we've just added further combinations to the existing variants: application-managed EntityManagers which may nevertheless auto-join transactions (EntityManagerFactory.createEntityManager with SynchronizationType.SYNCHRONIZED), and container-managed EntityManagers which might opt for not auto-joining transactions (@PersistenceContext with synchronizationType=UNSYNCHRONIZED).

Issue: SPR-8194
2013-03-27 14:46:23 +01:00
Juergen Hoeller ceb9a05ecb General JPA 2.0+ requirement; upgraded build and tests to EclipseLink 2.4, OpenJPA 2.2, Hibernate 3.6 2013-03-19 18:34:04 +01:00
Juergen Hoeller 30a9dad5fe Removed iBATIS SQL Maps support 2013-03-19 15:03:38 +01:00
Phillip Webb 4e1cab28df Merge branch '3.2.x'
* 3.2.x: (28 commits)
  Hide 'doc' changes from jdiff reports
  Document @Bean 'lite' mode vs @Configuration
  Final preparations for 3.2.2
  Remove Tiles 3 configuration method
  Polishing
  Extracted buildRequestAttributes template method from FrameworkServlet
  Added "beforeExistingAdvisors" flag to AbstractAdvisingBeanPostProcessor
  Minor refinements along the way of researching static CGLIB callbacks
  Compare Kind references before checking log levels
  Polish Javadoc in RequestAttributes
  Fix copy-n-paste errors in NativeWebRequest
  Fix issue with restoring included attributes
  Add additional test for daylight savings glitch
  Document context hierarchy support in the TCF
  Fix test for daylight savings glitch
  Make the methodParameter field of HandlerMethod final
  Disable AsyncTests in spring-test-mvc
  Reformat the testing chapter
  Document context hierarchy support in the TCF
  Document context hierarchy support in the TCF
  ...
2013-03-13 14:01:46 -07:00
Phillip Webb 05765d7520 Replace EasyMock with Mockito
Issue: SPR-10126
2013-03-06 11:06:15 -08:00
Chris Beams ce4be3b46b Merge branch '3.2.x' into master
Conflicts:
	gradle.properties
	spring-beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java
	spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheManagerFactoryBean.java
	spring-core/src/main/java/org/springframework/core/convert/support/StringToEnumConverterFactory.java
	spring-core/src/main/java/org/springframework/core/env/ReadOnlySystemAttributesMap.java
	spring-jdbc/src/main/java/org/springframework/jdbc/datasource/LazyConnectionDataSourceProxy.java
	spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/AbstractLobHandler.java
	spring-web/src/main/java/org/springframework/http/client/BufferingClientHttpRequestWrapper.java
	spring-web/src/main/java/org/springframework/http/client/SimpleBufferingClientHttpRequest.java
	spring-web/src/main/java/org/springframework/http/converter/BufferedImageHttpMessageConverter.java
	spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.java
2013-03-04 15:41:15 +01:00
Sam Brannen c0e4387cbc Fix JIRA issue number in @Ignore comments
Issue: SPR-10333
2013-02-28 01:42:04 +01:00
Juergen Hoeller b979d8d548 Polishing along with SPR-10301 2013-02-27 00:22:53 +01:00
Juergen Hoeller 0d69a630ad DefaultJdoDialect supports the JDO 2.2+ isolation level feature out of the box
Issue: SPR-10323
2013-02-26 22:30:48 +01:00
Chris Beams 9c2b5b2406 Update @Ignore'd JPA+AspectJ tests
Issue: SPR-10074, SPR-10333
2013-02-26 14:26:55 +01:00
Juergen Hoeller 5334ac59f6 "packagesToScan" feature for Hibernate 3 and Hibernate 4 detects annotated packages as well
Issue: SPR-7748
Issue: SPR-10288
2013-02-13 17:44:10 +01:00
Sam Brannen 220d2311c7 Polish documentation in Hibernate support classes
This commit fixes some minor typos in Hibernate support classes.
2013-02-01 23:51:07 +01:00
Phillip Webb d89e30b864 Fix unnecessary @SupressWarnings annotations 2013-01-29 15:37:25 -08:00
Phillip Webb 065b1c0e46 Fix unused local variable warnings 2013-01-25 14:35:19 -08:00
Phillip Webb 6a1e841952 Fix unused type compiler warnings 2013-01-25 14:35:07 -08:00
Juergen Hoeller 8f103c2ea1 Introduced NoUniqueBeanDefinitionException as a dedicated subclass of NoSuchBeanDefinitionException
Issue: SPR-10194
2013-01-22 21:12:06 +01:00
Juergen Hoeller 1a929f22e0 EntityManagerFactoryUtils finds default EntityManagerFactory in parent contexts as well
Also introduces consistent use of getBean(Class) for similar use cases across the framework, accepting a locally unique target bean even if further matching beans would be available in parent contexts (in contrast to BeanFactoryUtils.beanOfType's behavior).

Issue: SPR-10160
2013-01-22 21:12:05 +01:00
Juergen Hoeller 10dceb182e Marked LocalCacheProviderProxy as deprecated (following Hibernate 3.3.'s CacheProvider deprecation) 2013-01-10 17:00:40 +01:00
Phillip Webb ee1ddc90ec Replace EasyMock with Mockito in spring-orm
Issue: SPR-10126
2013-01-09 17:42:12 -08:00
Chris Beams 15e9fe638c Remove duplicate test resources
The files deleted in this commit existed in identical form in two places
within a given module; typically in src/test/java and
src/test/resources. The version within src/test/resources has been
favored in all cases.

This change was prompted by associated Eclipse warnings, which have now
been quelled.

Issue: SPR-9431
2013-01-04 11:38:58 +01:00
Phillip Webb 42b5d6dd7e Remove duplicate test classes
Prior to this commit many test utility classes and sample beans were
duplicated across projects. This was previously necessary due to the
fact that dependent test sources were not shared during a gradle
build. Since the introduction of the 'test-source-set-dependencies'
gradle plugin this is no longer the case.

This commit attempts to remove as much duplicate code as possible,
co-locating test utilities and beans in the most suitable project.
For example, test beans are now located in the 'spring-beans'
project.

Some of the duplicated code had started to drift apart when
modifications made in one project where not ported to others. All
changes have now been consolidated and when necessary existing tests
have been refactored to account for the differences.

Conflicts:
	spring-beans/src/test/java/org/springframework/beans/factory/ConcurrentBeanFactoryTests.java
	spring-beans/src/test/java/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java
	spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java
2013-01-04 10:02:29 +01:00
Chris Beams 961dbdb68a Merge branch '3.2.x' into master
* 3.2.x:
  Exclude spring-build-src from maven publish
  Move spring-build-junit into spring-core
  Relocate MergePlugin package
  Develop a gradle plugin to add test dependencies
  Expose Gradle buildSrc for IDE support
  Fix [deprecation] compiler warnings
  Upgrade to xmlunit version 1.3
  Improve 'build' folder ignores
  Fix regression in static setter method support
  Fix SpEL JavaBean compliance for setters

Conflicts:
	spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java
2013-01-02 10:36:57 +01:00
Chris Beams 70eaf02b7f Revert "Merge branch 'SPR-10130' into cleanup-master"
This reverts commit 45fa50821a, reversing
changes made to a312d900f8.
2013-01-02 10:33:59 +01:00
Phillip Webb 6626a38730 Fix [deprecation] compiler warnings
Fix deprecation compiler warnings by refactoring code or applying
@SuppressWarnings("deprecation") annotations. JUnit tests of
internally deprecated classes are now themselves marked as
@Deprecated.

Numerous EasyMock deprecation warnings will remain until the
migration to mockito can be completed.
2013-01-01 13:42:15 -08:00
Chris Beams b2a048b6f3 Update Apache license headers for affected sources 2012-12-28 23:57:33 +01:00
Chris Beams 3b40ce76bf Add @Override annotations to main sources
Issue: SPR-10130
2012-12-28 23:53:24 +01:00
Chris Beams 8472a2b2ab Update Apache license headers for affected sources 2012-12-28 23:09:31 +01:00
Chris Beams 4c8cd7b0bd Add @Override annotations to test sources
Issue: SPR-10129
2012-12-28 23:05:44 +01:00
Chris Beams 4c7cafbde6 Fix "unnecessary @SuppressWarnings" warnings 2012-12-28 22:50:46 +01:00
Chris Beams 4d97ff2479 Fix [dep-ann] warnings with @Deprecated 2012-12-28 22:50:45 +01:00
Phillip Webb 6c14eaad61 Fix [cast] compiler warnings 2012-12-28 22:41:06 +01:00
Phillip Webb b0986049a3 Fix [serial] compiler warnings
Fix serialization warnings by applying @SuppressWarnings("serial")
when appropriate.

In certain cases and for unknown reasons, a correctly-placed
@SuppressWarnings("serial") annotation will fix the warning at the
javac level (i.e. the Gradle command-line), but will produce an
"unnecessary @SuppressWarnings" warning within Eclipse. In these
cases, a private static final serialVersionUID field has been added
with the default value of 1L.
2012-12-28 22:41:06 +01:00
Phillip Webb 731d5be644 Fix warnings due to unused import statements 2012-12-28 22:40:49 +01:00
Chris Beams 9540d2c81b Replace <code> with {@code} throughout Javadoc
Issue: SPR-10128
2012-12-28 22:36:02 +01:00
Phillip Webb 2cf45bad86 Replace space indentation with tabs
Issue: SPR-10127
2012-12-28 20:49:56 +01:00
Phillip Webb 1762157ad1 Remove trailing whitespace in source files
find . -type f -name "*.java" -or -name "*.aj" | \
    xargs perl -p -i -e "s/[ \t]*$//g" {} \;

Issue: SPR-10127
2012-12-28 20:49:45 +01:00
Juergen Hoeller b9df7d68d9 Consistent fine-tuning of synchronized and concurrent data structures
In particular, avoiding synchronized Sets and Maps wherever possible (preferring a ConcurrentHashMap even instead of a synchronized Set) and specifying appropriate ConcurrentHashMap initial capacities (even if we end up choosing 16).
2012-12-12 23:46:26 +01:00
Chris Beams f26534700a Eliminate all Javadoc warnings
- Support external Javadoc links using Gradle's javadoc.options.links

 - Fix all other Javadoc warnings, such as typos, references to
   non-existent (or no longer existent) types and members, etc,
   including changes related to the Quartz 2.0 upgrade (SPR-8275) and
   adding the HTTP PATCH method (SPR-7985).

 - Suppress all output for project-level `javadoc` tasks in order to
   hide false-negative warnings about cross-module @see and @link
   references (e.g. spring-core having a @see reference to spring-web).
   Use the `--info` (-i) flag to gradle at any time to see project-level
   javadoc warnings without running the entire `api` task. e.g.
   `gradle :spring-core:javadoc -i`

 - Favor root project level `api` task for detection of legitimate
   Javadoc warnings. There are now zero Javadoc warnings across the
   entirety of spring-framework. Goal: keep it that way.

 - Remove all @link and @see references to types and members that exist
   only in Servlet <= 2.5 and Hibernate <= 4.0, favoring 3.0+ and 4.0+
   respectively. This is necessary because only one version of each of
   these dependencies can be present on the global `api` javadoc task's
   classpath. To that end, the `api` task classpath has now been
   customized to ensure that the Servlet 3 API and Hibernate Core 4 jars
   have precedence.

 - SPR-8896 replaced our dependency on aspectjrt with a dependency on
   aspectjweaver, which is fine from a POM point of view, but causes
   a spurious warning to be emitted from the ant iajc task that it
   "cannot find aspectjrt on the classpath" - even though aspectjweaver
   is perfectly sufficient. In the name of keeping the console quiet, a
   new `rt` configuration has been added, and aspectjrt added as a
   dependency to it. In turn, configurations.rt.asPath is appended to
   the iajc classpath during both compileJava and compileTestJava for
   spring-aspects.

Issue: SPR-10078, SPR-8275, SPR-7985, SPR-8896
2012-12-12 12:55:10 +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
Juergen Hoeller 4e442471e1 Hibernate 3 support builds against standard Hibernate 3.3.2.GA artifact from Maven 2012-12-04 16:06:07 +01:00
Juergen Hoeller 184361a096 Transaction timeouts for JPA translate to "javax.persistence.query.timeout" only (for EclipseLink compatibility)
Issue: SPR-10068
2012-12-04 15:38:04 +01:00
Rob Winch 149e6f6425 polish web.Mock* classpath
Previously when running the tests for spring-web, spring-webmvc,
spring-test-mvc, and spring-orm there were possible collissions in the
classpath due to the fact that each had its own copy of the web.Mock*
classes in it. This causes uncertainty for which class the code was
running against. Furthermore, the maintance of keeping the copies up to
date was tedious.

Now there are two copies of the web.Mock* classes. The ones that exist
in spring-test main sources and a copy that supports servlet 3 within
spring-web test sources. The copy in spring-web test sources has been
moved to a new package to avoid having the classes exist twice on the
classpath within Eclipse.
2012-11-30 11:15:58 -05:00
Juergen Hoeller 4e443da7ae Officially deprecated Apache iBATIS support in favor of native Spring support in Mybatis (http://code.google.com/p/mybatis/) 2012-11-29 23:21:50 +01:00
Rob Winch d7bf56df49 Remove reflection usage in orm.hibernate4.*
Previously reflection was required when interacting with Hibernate 4 in
order to support both Hibernate 3 and Hibernate 4 since there were
non-passive changes in the APIs. Now that the Spring build uses Gradle
it is trivial to support multiple Hibernate versions.

This commit removes the reflection usage in orm.hibernate4.* by
creating a spring-orm-hibernate4 module that uses
gradle/merge-artifacts.gradle to build a single artifact but keep
distinct classpaths.

Issue: SPR-10039
2012-11-26 22:47:10 +01:00
Juergen Hoeller d6e1a4a26a LocalDataSourceConnectionProvider checks against SmartDataSource before closing a Connection
Issue: SPR-9978
2012-11-08 23:37:14 +01:00
Rossen Stoyanchev d701464517 Add onTimeout/onCompletion callbacks to DeferredResult
Issue: SPR-9914
2012-10-30 21:58:44 -04:00
Juergen Hoeller 4ff765446e Added "jtaDataSource" property to JPA LocalContainerEntityManagerFactoryBean (for default units)
Issue: SPR-9883
2012-10-31 02:53:19 +01:00
Rossen Stoyanchev 5d04ef4c4a Support selective filtering of error dispatches
OncePerRequestFilter now allows sub-classes to choose whether they
should ever get involved in processing an error dispatch.

Issue: SPR-9895
2012-10-28 12:47:00 -04:00
Rossen Stoyanchev d952da2338 Polish (minor) async support in filters
Issue: SPR-9895
2012-10-28 12:10:38 -04:00
Sam Brannen 591aa01741 Configurable locales in MockHttpServletRequest
Prior to this commit the MockHttpServletRequest constructor chain set
the preferred local to Locale.ENGLISH. Furthermore, it was possible to
add additional preferred locales "in front" of ENGLISH; however, it was
not possible to delete ENGLISH from the list of preferred locales.

This commit documents the fact that ENGLISH is the default preferred
locale and makes it possible to set the list of preferred locales via a
new setPreferredLocales(List<Locale> locales) method.

Issue: SPR-9724
2012-10-27 18:13:13 +02:00
Rossen Stoyanchev f036ed639f Polish (major) MVC async processing interceptors
New afterTimeout and afterCompletion callbacks

afterTimeout can provide a concurrent result to be used instead of the
one that could not be set or returned on time

Interceptor exceptions cause async processing to resume treating the
exception as the concurrent result

Adapter classes for convenient implementation of the interfaces

Issue: SPR-9914
2012-10-26 18:04:27 -04:00
Juergen Hoeller d7e2de019f Mention matching bean names in exception message in case of non-unique EntityManagerFactory lookup 2012-10-12 23:34:19 +02:00
Juergen Hoeller 1a6940dd05 Fixed test failure on CI server (classpath search failing for some reason)
Issue: SPR-9797
2012-10-11 00:35:04 +02:00
Juergen Hoeller efd872e35a JPA persistence.xml files may use jar-file entries relative to the unit root (as per the JPA spec)
Issue: SPR-9797
2012-10-10 23:34:24 +02:00
Juergen Hoeller fe16334dd4 Hibernate 4 LocalSessionFactoryBuilder sets thread context ClassLoader (for JBoss 7 compatibility)
Issue: SPR-9846
2012-10-10 14:28:54 +02:00
Rossen Stoyanchev 7513e2124a Sync up MockHttpServletResponse copies in test sources 2012-10-02 15:57:22 -04:00
Rossen Stoyanchev 4566db82f5 Polish MockFilterChain
A reset method now allows it to be invoked more than once each time
storing the request and response with which it was invoked.
2012-09-27 12:06:35 -04:00
Rossen Stoyanchev 57c36dd395 Add interceptors for async processing
This change introduces two new interceptors with callback methods
for concurrent request handling. These interfaces are
CallableProcessingInterceptor and DeferredResultProcessingInterceptor.

Unlike a HandlerInterceptor, and its AsyncHandlerInterceptor sub-type,
which intercepts the invocation of a handler in he main request
processing thread, the two new interfaces are aimed at intercepting the
asynchronous execution of a Callable or a DeferredResult.

This allows for the registration of thread initialization logic in the
case of Callable executed with an AsyncTaskExecutor, or for centralized
tracking of the completion and/or expiration of a DeferredResult.
2012-09-19 09:25:50 -04:00
Rossen Stoyanchev 97f97c4e9f Polish async support
Added handler argument to the signature of
AsyncHandlerInterceptor.afterConcurrentHandlingStarted(..).

Renamed AsyncWebUtils to WebAsyncUtils.
2012-09-17 14:58:56 -04:00
Juergen Hoeller f32e4077fa same-named unit from persistence.xml overrides in case of conflict with default unit
Issue: SPR-9741
2012-09-10 15:14:11 +02:00
Rossen Stoyanchev 6e85dd8917 Polish async request processing
This change fixes a cyclical package dependency.

The change also improves the implementation of
WebAsyncManager.hasConcurrentResult() following the resolution of
Apache issue id=53632 and the release of Apache Tomcat 7.0.30 that
contains the fix.
2012-09-07 21:30:11 -04:00
Rob Winch c92a06f003 Support Filters/Servlet invocation in MockFilterChain
This commit adds the ability to allow the MockFilterChain to invoke
a List of Filter's and/or a Servlet.

Issue: SPR-9745
2012-09-05 01:30:46 -04:00
Rossen Stoyanchev 4f55518290 Update remaining filter with async support
Issue: SPR-9433
2012-08-17 13:09:52 -04:00
Rossen Stoyanchev cdab04a032 Set timeout value and task executor per async request
Methods returning DeferredResult can now specify a timeout value
through constructor arg while methods returning a Callable can wrap it
in an AsyncTask that also accepts a timeout and a specific task
executor.

Issue: SPR-9399
2012-08-17 13:09:51 -04:00
Sam Brannen 3b9833c538 Update MockHttpSession across the test suite 2012-08-16 13:38:51 +02:00
Rossen Stoyanchev 529e62921d Refactor Servlet 3 async support
As a result of the refactoring, the AsyncContext dispatch mechanism is
used much more centrally. Effectively every asynchronously processed
request involves one initial (container) thread, a second thread to
produce the handler return value asynchronously, and a third thread
as a result of a dispatch back to the container to resume processing
of the asynchronous resuilt.

Other updates include the addition of a MockAsyncContext and support
of related request method in the test packages of spring-web and
spring-webmvc. Also an upgrade of a Jetty test dependency required
to make tests pass.

Issue: SPR-9433
2012-08-03 19:15:53 -04:00
Sam Brannen 37dc211f58 Support named dispatchers in MockServletContext
Currently the getNamedDispatcher(String) method of MockServletContext
always returns null. This poses a problem in certain testing scenarios
since one would always expect at least a default Servlet to be present.
This is specifically important for web application tests that involve
the DefaultServletHttpRequestHandler which attempts to forward to the
default Servlet after retrieving it by name. Furthermore, there is no
way to register a named RequestDispatcher with the MockServletContext.

This commit addresses these issues by introducing the following in
MockServletContext.

 - a new defaultServletName property for configuring the name of the
   default Servlet, which defaults to "default"
 - named RequestDispatchers can be registered and unregistered
 - a MockRequestDispatcher is registered for the "default" Servlet
   automatically in the constructor
 - when the defaultServletName property is set to a new value the
   the current default RequestDispatcher is unregistered and replaced
   with a MockRequestDispatcher for the new defaultServletName

Issue: SPR-9587
2012-07-26 03:06:07 +02:00
Sam Brannen 060b37ca8d Fix typo in MockFilterChain 2012-07-25 01:03:33 +02:00
Rossen Stoyanchev 5a365074c2 Fix issue with failing test from previous commit
Issue: SPR-9611
2012-07-20 14:46:52 -04:00
Rossen Stoyanchev 6cc512b51c Ensure async Callables are in sync with the call stack
After this change each call stack level pushes and pops an async
Callable to ensure the AsyncExecutionChain is in sync with the
call stack. Before this change, a controller returning a "forward:"
prefixed string caused the AsyncExecutionChain to contain a
extra Callables that did not match the actual call stack.

Issue: SPR-9611
2012-07-20 12:50:01 -04:00
Juergen Hoeller dda3197c77 added "jtaTransactionManager" property to Hibernate 4 LocalSessionFactoryBean/Builder
Issue: SPR-9480
2012-07-06 22:43:36 +02:00
Rossen Stoyanchev 6cca57afd3 Exception for OSIV deferred close with async requests
OSIV deferred close mode is not supported with async requests and is
unlikely to be what's the desired. This change adds an exception with
a message stating this.

Issue: SPR-8517
2012-05-04 18:58:47 -04:00
Rossen Stoyanchev e7506b50b2 HanderInterceptor and OSIV async request changes
This change updates Open-Session-in-View filters and interceptors for
use in async requests mainly ensuring the open Hibernate session is
unbound from the main request processing thread and bound to the to
async thread.

Issue: SPR-8517
2012-05-04 16:12:14 -04:00
Stevo Slavic effb762558 Fix javadoc warnings
Before this change there were numerous javadoc warnings being reported
while building Spring framework API.

This commit resolves most of the javadoc warnings, reducing the total
number from 265 to 103.

Issue: SPR-9113
2012-04-30 11:31:02 +03:00
Chris Beams e3f544904c Fix warnings in LocalSessionFactoryBean 2012-03-09 11:36:56 +02:00
Chris Beams 045c97f75e Support automatic Hibernate dialect detection
Use the preferred SessionFactoryImplementor#getDialect call as
opposed to the previous Dialect#getDialect approach which required
explicitly setting the 'hibernate.dialect' property.

Issue: SPR-7396
2012-03-09 11:36:49 +02:00
Chris Beams ee36c80ca9 Sync with 3.1.x
* 3.1.x: (61 commits)
  Compensate for changes in JDK 7 Introspector
  Avoid 'type mismatch' errors in ExtendedBeanInfo
  Polish ExtendedBeanInfo and tests
  Infer AnnotationAttributes method return types
  Minor fix in MVC reference doc chapter
  Hibernate 4.1 etc
  TypeDescriptor equals implementation accepts annotations in any order
  "setBasenames" uses varargs now (for programmatic setup; SPR-9106)
  @ActiveProfiles mechanism works with @ImportResource as well (SPR-8992
  polishing
  clarified Resource's "getFilename" method to consistently return null
  substituteNamedParameters detects and unwraps SqlParameterValue object
  Replace spaces with tabs
  Consider security in ClassUtils#getMostSpecificMethod
  Adding null check for username being null.
  Improvements for registering custom SQL exception translators in app c
  SPR-7680 Adding QueryTimeoutException to the DataAccessException hiera
  Minor polish in WebMvcConfigurationSupport
  Detect overridden boolean getters in ExtendedBeanInfo
  Polish ExtendedBeanInfoTests
  ...
2012-02-13 15:17:30 +01:00
Chris Beams ddf8eaf38a Mark remaining @Ignored tests with 'TODO SPR-8116'
Each of these tests began failing during the Gradle build porting
process. None seem severe, many are likely due to classpath issues.

In the case of TestNG support, this needs to be added to the Gradle
build in order to execute these tests. See SPR-8116.txt
2012-01-31 14:37:12 +01:00
Chris Beams 6235a341a7 Remove bundlor support 2012-01-31 14:37:11 +01:00
Chris Beams 02a4473c62 Rename modules {org.springframework.*=>spring-*}
This renaming more intuitively expresses the relationship between
subprojects and the JAR artifacts they produce.

Tracking history across these renames is possible, but it requires
use of the --follow flag to `git log`, for example

    $ git log spring-aop/src/main/java/org/springframework/aop/Advisor.java

will show history up until the renaming event, where

    $ git log --follow spring-aop/src/main/java/org/springframework/aop/Advisor.java

will show history for all changes to the file, before and after the
renaming.

See http://chrisbeams.com/git-diff-across-renamed-directories
2012-01-31 14:37:10 +01:00