Commit Graph

7850 Commits

Author SHA1 Message Date
Rossen Stoyanchev ab5f1256bf Allow consolidating config in root context with Java
This change makes it possible to provide no configuration for the
DispatcherServlet when extending
AbstractAnnotationConfigDispatcherServletInitializer, and therefore
provide all config through the "root" context.

Issue: SPR-11357
2014-01-24 11:09:12 -05:00
Juergen Hoeller b6073d9ac4 Polishing 2014-01-24 16:22:29 +01:00
Juergen Hoeller 8543b91c50 Introduced SpringProperties class and optional "spring.properties" file
This in particular allows for specifying "spring.getenv.ignore" and "spring.beaninfo.ignore" in a local way within the application, in case that JVM-level system properties are locked.

Issue: SPR-9014
Issue: SPR-11297
2014-01-24 16:22:02 +01:00
Sam Brannen 6151e6d12a Merge pull request #451 from hupfis/patch-1
Fix code example in Javadoc for ResultActions
2014-01-24 04:37:57 -08:00
Juergen Hoeller eeae5fba95 Fixed regression with constructing TypeDescriptor from null Class
Issue: SPR-11354
2014-01-24 13:16:35 +01:00
hupfis 0013a43237 Fixed code example in JavaDoc
equalTo is not a valid method on JsonPathResultMatchers

I have signed and agree to the terms of the SpringSource Individual Contributor License Agreement.
2014-01-24 09:26:09 +01:00
Juergen Hoeller 42db41e007 Polishing 2014-01-23 20:59:53 +01:00
Juergen Hoeller 86fc2dd556 Fixed regression in SpEL's constructor resolution
Issue: SPR-11348
2014-01-23 20:52:21 +01:00
Sam Brannen 8faf01f56d Fix "coercion" spelling mistakes in Javadoc 2014-01-23 17:47:35 +01:00
Juergen Hoeller 9c3a972dac Polishing
Issue: SPR-11297
(cherry picked from commit fc36184)
2014-01-23 00:16:29 +01:00
Juergen Hoeller 6793765b0a Factored out "suppressGetenvAccess()" method
Issue: SPR-11297
(cherry picked from commit 52d050d)
2014-01-23 00:12:09 +01:00
Juergen Hoeller 8d304efad1 Preserve visitBeanDefinition stacktrace in BeanDefinitionStoreException
Issue: SPR-11346
(cherry picked from commit fdd31c0)
2014-01-23 00:10:07 +01:00
Juergen Hoeller 3310ab55e0 Polishing
Issue: SPR-11344
(cherry picked from commit d434ef9)
2014-01-23 00:10:02 +01:00
Juergen Hoeller 6a6a23f0a3 Avoid class loading during AspectJ expression evaluation
Fixed through downcasting to AspectJ's ReflectionType and ReflectionBasedReferenceTypeDelegate, obtaining the myClass field there. We only fall back to regular class loading if we encounter any other kind of type.

Issue: SPR-11344
(cherry picked from commit c406c56)
2014-01-23 00:06:43 +01:00
Sam Brannen fb12e234fc Handle NoClassDefFoundError consistently for TELs
Prior to this commit, a NoClassDefFoundError caught in
TestContextManager's retrieveTestExecutionListeners() method would be
handled differently for implicit default listeners (i.e., listeners not
declared via @TestExecutionListeners) and listeners explicitly declared
via @TestExecutionListeners. Specifically, a NoClassDefFoundError would
cause a test to fail for an explicitly declared TestExecutionListener
but not for an implicitly declared one.

This commit addresses this issue by:

 - Always swallowing a NoClassDefFoundError for both implicitly and
   explicitly declared TestExecutionListeners.
 - Changing the log level from DEBUG to INFO to make such situations
   more visible to the average end user.

Issue: SPR-11347
2014-01-22 23:28:36 +01:00
Rossen Stoyanchev 09251dfad1 Fix typo 2014-01-22 16:49:00 -05:00
Rossen Stoyanchev a106e06a89 Expose failing test in GenericMessagingTemplateTests
Assertions made in callbacks invoked on separate thread were not
reaching the test framework. This fix ensures failures are detected
and cause tests to fail.
2014-01-22 16:43:21 -05:00
Rossen Stoyanchev 3ffc3d442d Document use of Jetty's WebSocketServerFactory
Issue: SPR-11023
2014-01-22 16:23:22 -05:00
Sam Brannen 3cb5828e21 Suppress warnings in MappingJacksonMsgConvTests 2014-01-22 21:09:06 +01:00
Sam Brannen 227320dc81 Suppress warnings in HibernateTransactionManagerTests 2014-01-22 20:53:55 +01:00
Rossen Stoyanchev 1c4530f251 Re-enable Undertow tests in WebSocketConfigurationIT 2014-01-22 14:50:25 -05:00
Gary Russell 0e7b94f9e9 Add constructors to MessageHandlingException
Issue: SPR-11345
2014-01-22 14:43:35 -05:00
Rossen Stoyanchev 74fe1aea31 Fix typo in documentation 2014-01-22 13:31:36 -05:00
Rossen Stoyanchev 8ee2a2d18c Remove unused constructor arg from UserDestinationMH 2014-01-22 11:55:44 -05:00
Sam Brannen 499c858cd4 Suppress resource/deprecation warnings in integration tests 2014-01-22 17:45:45 +01:00
Sam Brannen 8105011368 Delete unnecessary redeclaration of test methods
This commit deletes methods in RollbackForRequiredEjbTxDaoTestNGTests
that were unnecessarily redeclared. The redeclaration is required for
JUnit's @FixMethodOrder support but not for TestNG's built-in support
for dependent methods.

Issue: SPR-6132
2014-01-22 17:44:13 +01:00
Rossen Stoyanchev 0db2f79bdb Polish message method handling tests 2014-01-22 11:29:38 -05:00
Brian Clozel db9b6fa28e Split tests for MethodMessageHandlers impl.
Prior to this commit, all MethodMessageHandlers tests were
implemented in a single class. Since SimpAnnotationMsgHandler
has been refactored with an abstract class, tests also
needed such a refactoring.

This commit creates test fixtures for AbstractMethodMessageHandler.

Issue: SPR-11191
2014-01-22 10:42:24 -05:00
Rossen Stoyanchev 175aa86d79 Merge pull request #447 from snicoll/SPR-11331 2014-01-22 10:30:09 -05:00
Stephane Nicoll 98174e101f Improve documentation of matrix variables.
Prior to this commit, it was not clear how to enable the support of matrix
variables in the mvc namespace. As the feature is disabled by default, added
something to highlight the part that explains how to configure it

Issue: SPR-11331
2014-01-22 10:28:07 -05:00
Juergen Hoeller a599b57a74 Revised RootBeanDefinition's externallyManaged* Sets to rely on postProcessingLock
This allows us to avoid early initialization of footprint-heavy ConcurrentHashMaps, and reuses the existing postProcessingLock which will typically be active already when registerExternallyManaged* calls come in from the bean factory's post-processing phase.

Issue: SPR-11343
2014-01-22 14:20:33 +01:00
Sam Brannen e20c927c5e Merge pull request #449 from sbrannen/SPR-6132
Introduce EJB-based transactional tests in the TCF
2014-01-22 04:02:37 -08:00
Sam Brannen c0eafa9ea1 Introduce EJB-based transactional tests in the TCF
This commit introduces transactional integration tests executing
against both JUnit and TestNG in the TestContext framework (TCF) using
@TransactionAttribute in EJBs instead of Spring’s @Transactional
annotation.

These tests disprove the claims raised in SPR-6132 by demonstrating that
transaction support in the TCF works as expected when a transactional
EJB method that is configured with TransactionAttribute.REQUIRES_NEW is
invoked. Specifically:

 - The transaction managed by the TCF is suspended while such an EJB
   method is invoked.
 - Any work performed within the new transaction for the EJB method is
   committed after the method invocation completes.
 - The transaction managed by the TCF is resumed and subsequently
   either rolled back or committed as necessary based on the
   configuration of @Rollback and @TransactionConfiguration.

The configuration for the JUnit-based tests is straightforward and self
explanatory; however, the configuration for the TestNG tests is less
intuitive.

In order for the TCF to function properly, the developer must ensure
that test methods within a given TestNG test (whether defined locally,
in a superclass, or somewhere else in the suite) are executed in the
proper order. In a stand-alone test class this is straightforward;
however, in a test class hierarchy (or test suite) with dependent
methods, it is necessary to configure TestNG so that all methods within
an individual test are executed in isolation from test methods in other
tests. This can be achieved by configuring a test class to run in its
own uniquely identified suite (e.g., by annotating each concrete
TestNG-based test class with @Test(suiteName = "< Some Unique Suite
Name >")).

For example, without specifying a unique suite name for the TestNG
tests introduced in this commit, test methods will be executed in the
following (incorrect) order:

 - CommitForRequiredEjbTxDaoTestNGTests.test1InitialState()
 - CommitForRequiresNewEjbTxDaoTestNGTests.test1InitialState()
 - RollbackForRequiresNewEjbTxDaoTestNGTests.test1InitialState()
 - RollbackForRequiredEjbTxDaoTestNGTests.test1InitialState()
 - CommitForRequiredEjbTxDaoTestNGTests.test2IncrementCount1()

The reason for this ordering is that test2IncrementCount1() depends on
test1InitialState(); however, the intention of the developer is that
the tests for an individual test class are independent of those in
other test classes. So by specifying unique suite names for each test
class, the following (correct) ordering is achieved:

 - RollbackForRequiresNewEjbTxDaoTestNGTests.test1InitialState()
 - RollbackForRequiresNewEjbTxDaoTestNGTests.test2IncrementCount1()
 - RollbackForRequiresNewEjbTxDaoTestNGTests.test3IncrementCount2()
 - CommitForRequiredEjbTxDaoTestNGTests.test1InitialState()
 - CommitForRequiredEjbTxDaoTestNGTests.test2IncrementCount1()
 - CommitForRequiredEjbTxDaoTestNGTests.test3IncrementCount2()
 - RollbackForRequiredEjbTxDaoTestNGTests.test1InitialState()
 - RollbackForRequiredEjbTxDaoTestNGTests.test2IncrementCount1()
 - RollbackForRequiredEjbTxDaoTestNGTests.test3IncrementCount2()
 - CommitForRequiresNewEjbTxDaoTestNGTests.test1InitialState()
 - CommitForRequiresNewEjbTxDaoTestNGTests.test2IncrementCount1()
 - CommitForRequiresNewEjbTxDaoTestNGTests.test3IncrementCount2()

See the JIRA issue for more detailed log output.

Furthermore, @DirtiesContext(classMode = ClassMode.AFTER_CLASS) has
been used in both the JUnit and TestNG tests introduced in this commit
in order to ensure that the in-memory database is reinitialized between
each test class.

Issue: SPR-6132
2014-01-22 12:56:07 +01:00
Sam Brannen 597ef099d0 Suppress warnings and remove unused imports 2014-01-22 12:23:32 +01:00
Brian Clozel 845a6b0b7d Remove serialVersionUIDs in spring-messaging Exc.
Prior to this commit, several spring-messaging exceptions
had defined serialVersionUIDs. Those exception aren't
supposed to leave the system via Java serialization; also,
their deserialization is supported only against the same
version of Spring.

Issue: SPR-11339
2014-01-22 11:37:04 +01:00
Juergen Hoeller 12c393eb6d Switched 'order' attributes across namespaces to 'xsd:token'
Issue: SPR-10886
Issue: SPR-7342
2014-01-22 11:35:21 +01:00
Juergen Hoeller 3969467851 Temporarily deactivated Undertow integration tests
Undertow tests fail against OpenJDK 8 build 124 with a BindException.
2014-01-22 11:34:27 +01:00
Phillip Webb 59604b1cd5 Unwrap TypeVariables before calling .equals()
Update ResolvableType to unwrap Serialization wrapped TypeVariables
before calling the equals method.

This protects against the recent change in OpenJDK 8 (build 124)
which changed the TypeVariableImpl equals method such that it only
matches against other TypeVariableImpl instances.

Issue: SPR-11342
2014-01-21 16:10:02 -08:00
Rossen Stoyanchev d03fb8954b Encode user names in user destanations
Issue: SPR-11302
2014-01-21 14:57:51 -05:00
Phillip Webb d96b91a57b Fix SerializableTypeWrapper equals() performance
Change SerializableTypeWrapper proxies to directly call equals() methods
on the underlying Type, rather than possibly generating more wrappers.

This should help to improve performance, especially as the equals()
method is called many times when the ResolvableType cache is checked.

Issue: SPR-11335
2014-01-21 10:59:25 -08:00
Rossen Stoyanchev ae06c3a6ab Use DestinationUserNameProvider with @SendTo
Issue: SPR-11327
2014-01-21 12:32:35 -05:00
Rossen Stoyanchev e4ad2b352e Add DestinationUserNameProvider interface
The interface is to be implemented in addition to
java.security.Principal when Principal.getName() is not globally unique
enough for use in user destinations.

Issue: SPR-11327
2014-01-21 12:12:05 -05:00
Rossen Stoyanchev 2cafe9d73a Polish 2014-01-21 12:12:05 -05:00
Juergen Hoeller 3514242486 SourceHttpMessageConverter's supports implementation needs to check for StAXSource
Issue: SPR-11341
2014-01-21 16:35:47 +01:00
Juergen Hoeller 9cc86a3c80 Fixed setDeliveryPersistent javadoc
Issue: SPR-3983
2014-01-21 16:28:44 +01:00
Juergen Hoeller 4ae893e110 DefaultPersistenceUnitManager detects META-INF/orm.xml for scanned default unit
Note: A default orm.xml file is only being used when not co-located with a persistence.xml file, since we assume it is intended for use with that persistence.xml file only then.

Issue: SPR-11234
Issue: SPR-11260
2014-01-21 15:04:36 +01:00
Sam Brannen 3370f8b1b1 Include ServletTEL in abstract base test classes
The ServletTestExecutionListener is now prepended to the set of default
listeners in AbstractJUnit4SpringContextTests and
AbstractTestNGSpringContextTests.

Issue: SPR-11340
2014-01-21 15:01:29 +01:00
Sam Brannen 098d7c7465 Ensure all tests in spring-test are executed
Prior to this commit TestNG tests would only be executed by the Gradle
build if they were located in the “testng” package. Tests in subpackages
would therefore be omitted from the build.

This commit ensures that all TestNG classes in the “testng” package and
any of its subpackages are executed in the Gradle build.

Furthermore, this commit ensures that the JUnit-based
FailingBeforeAndAfterMethodsTests test class is executed along with the
other JUnit tests even though it resides under the “testng” package.

Issue: SPR-11338
2014-01-21 14:47:37 +01:00
Sam Brannen 4a569e6b1a Introduce hibernate3Version constant in Gradle build 2014-01-21 14:09:31 +01:00
Juergen Hoeller 84310c8a11 RemoteInvocation(Result) explicitly designed for JavaBean-style deserialization
Issue: SPR-11337
2014-01-21 12:49:16 +01:00