Sam Brannen

Polish ResourceDatabasePopulatorTests

Add script after setting scripts in RsrcDbPopultr

Prior to this commit it was impossible to add additional scripts to a

ResourceDatabasePopulator after setScripts() had been invoked.

This commit fixes this by ensuring that the internal scripts list

continues to be modifiable when setScripts() is invoked.

Issue: SPR-11691

Assert preconditions in ResourceDatabasePopulator

Prior to this commit ResourceDatabasePopulator did not assert any

preconditions for constructor and method arguments. Consequently,

errors would not be encountered until the populator was executed.

This commit addresses this issue by ensuring that preconditions for

constructor and method arguments are asserted immediately, throwing

IllegalArgumentExceptions where appropriate.

Issue: SPR-11690

Improve Javadoc in SQL script support classes

Polish AbstractDatabasePopulatorTests

Make EOF_STATEMENT_SEPARATOR XML friendly

Changed the value of ScriptUtils.EOF_STATEMENT_SEPARATOR from

"<<< END OF SCRIPT >>>" to "^^^ END OF SCRIPT ^^^" so that the angle

brackets do not have to be escaped in XML configuration files.

Issue: SPR-11687

Make EOF_STATEMENT_SEPARATOR XML friendly

Changed the value of ScriptUtils.EOF_STATEMENT_SEPARATOR from

"<<< END OF SCRIPT >>>" to "^^^ END OF SCRIPT ^^^" so that the angle

brackets do not have to be escaped in XML configuration files.

Issue: SPR-11687

(cherry picked from commit 1753f5d1cab1b6b7226f3b655482dd43c111e94f)

Support EOF as statement separator in SQL scripts

Prior to Spring Framework 4.0.3, it was possible to supply a bogus

statement separator (i.e., a separator string that does not exist in

the configured SQL scripts) to ResourceDatabasePopulator with the side

effect that the entire contents of a script file would be interpreted

as a single SQL statement.

This undocumented feature was never intentional; however, some

developers came to rely on it. Unfortunately, changes made in

conjunction with SPR-9531 and SPR-11560 caused such scenarios to no

longer work.

This commit introduces first-class support for executing scripts which

contain a single statement that spans multiple lines but is not

followed by an explicit statement separator.

Specifically, ScriptUtils.EOF_STATEMENT_SEPARATOR may now be specified

as a 'virtual' statement separator to denote that a script contains a

single statement and no actual separator.

Issue: SPR-11687

Support EOF as statement separator in SQL scripts

Prior to Spring Framework 4.0.3, it was possible to supply a bogus

statement separator (i.e., a separator string that does not exist in

the configured SQL scripts) to ResourceDatabasePopulator with the side

effect that the entire contents of a script file would be interpreted

as a single SQL statement.

This undocumented feature was never intentional; however, some

developers came to rely on it. Unfortunately, changes made in

conjunction with SPR-9531 and SPR-11560 caused such scenarios to no

longer work.

This commit introduces first-class support for executing scripts which

contain a single statement that spans multiple lines but is not

followed by an explicit statement separator.

Specifically, ScriptUtils.EOF_STATEMENT_SEPARATOR may now be specified

as a 'virtual' statement separator to denote that a script contains a

single statement and no actual separator.

Issue: SPR-11687

(cherry picked from commit cc0ae3a881dde5910ecc340fa20c2365dd7474fa)

Polish Javadoc in SimpleApplicationEventMulticaster

Polish Javadoc for SpringJUnit4ClassRunner

Deprecate custom/default CtxLdr class name in TCF

Once the new bootstrap strategy for the TestContext framework (TCF) is

introduced in Spring Framework 4.1, a TestContextBootstrapper will

assume full responsibility for determining what ContextLoader to use as

the default. Consequently, the previous support for supplying the class

name for a custom, default ContextLoader will no longer be applicable.

This commit therefore officially deprecates support for custom, default

ContextLoader class names via the following mechanisms:

  • The TestContextManager(Class, String) constructor

  • The getDefaultContextLoaderClassName(Class) method in

    SpringJUnit4ClassRunner

Issue: SPR-11682

Ensure Gradle does not execute inner classes as tests

Polish Javadoc for TestContextBootstrapper

Update ContextLoaderUtils Javadoc due to recent refactoring

Simplify DefaultBootstrapContext.toString()

Merge from sbrannen/SPR-9955

  • SPR-9955:

    Introduce context bootstrap strategy in the TCF

Deprecate getDefTELClasses in TestContextMgr

Since a dedicated bootstrap strategy will be introduced for the

TestContext framework in Spring Framework 4.1, this commit officially

deprecates TestContextManager.getDefaultTestExecutionListenerClasses()

as a forewarning to developers or frameworks that may be using this

obscure feature.

Issue: SPR-11679

Don't encode '@' in

{@code}

tags

Don't encode '@' in

{@code}

tags

Introduce test for PropertySource + ACI in the TCF

This commit introduces an explicit integration test to verify that a

PropertySource can be set via a custom ApplicationContextInitializer in

the Spring TestContext Framework.

Issue: SPR-11666

Clean up warnings due to removal of legacy Jackson support

Clean up warnings that show up in Gradle build

Use unconstrained quotes in reference manual

Prior to this commit, there were numerous places in the reference

manual, where we see output similar to the following:

BeanDefinition`s with the `ApplicationContext

This commit addresses this issue by using unconstrained quotes

(e.g., +XYZ+s) instead of backticks (e.g., `XYZ`s) when the formatted

text is immediately followed by an "s".

This commit also corrects a few typos and corrects natural English

pluralization of Java code elements in the reference manual where

appropriate – for example, "@Controllers" becomes "@Controller classes,

etc.

Issue: SPR-11650

(cherry picked from commit 0eba1f818f2553c4f55f3b18cc5b2ad1c2d62a92)

Use unconstrained quotes in reference manual

Prior to this commit, there were numerous places in the reference

manual, where we would see output similar to the following:

BeanDefinition`s with the `ApplicationContext

This commit addresses this issue by using unconstrained quotes

(e.g., +XYZ+s) instead of backticks (e.g., `XYZ`s) when the formatted

text is immediately followed by an "s".

This commit also corrects a few typos and corrects natural English

pluralization of Java code elements in the reference manual where

appropriate – for example, "@Controllers" becomes "@Controller classes,

etc.

Issue: SPR-11650

Remove trailing whitespace

Merge from sbrannen/SPR-11634

  • SPR-11634:

    Support classes AND locations in @ContextConfiguration

Support classes AND locations in @ContextConfiguration

Prior to this commit, the Spring TestContext Framework did not support

the declaration of both 'locations' and 'classes' within

@ContextConfiguration at the same time.

This commit addresses this in the following manner:

  • ContextConfigurationAttributes no longer throws an

    IllegalArgumentException if both 'locations' and 'classes' are

    supplied to its constructor.

  • Concrete SmartContextLoader implementations now validate the

    supplied MergedContextConfiguration before attempting to load the

    ApplicationContext. See validateMergedContextConfiguration().

  • Introduced tests for hybrid context loaders like the one used in

    Spring Boot. See HybridContextLoaderTests.

  • Updated the Testing chapter of the reference manual so that it no

    longer states that locations and classes cannot be used

    simultaneously, mentioning Spring Boot as well.

  • The Javadoc for @ContextConfiguration has been updated accordingly.

  • Added hasLocations(), hasClasses(), and hasResources() convenience

    methods to MergedContextConfiguration.

Issue: SPR-11634

(cherry picked from commit 1f017c4acb3a4b4acdf088bda966e8593349ba5b)

  1. … 7 more files in changeset.

Support classes AND locations in @ContextConfiguration

Prior to this commit, the Spring TestContext Framework did not support

the declaration of both 'locations' and 'classes' within

@ContextConfiguration at the same time.

This commit addresses this in the following manner:

  • ContextConfigurationAttributes no longer throws an

    IllegalArgumentException if both 'locations' and 'classes' are

    supplied to its constructor.

  • Concrete SmartContextLoader implementations now validate the

    supplied MergedContextConfiguration before attempting to load the

    ApplicationContext. See validateMergedContextConfiguration().

  • Introduced tests for hybrid context loaders like the one used in

    Spring Boot. See HybridContextLoaderTests.

  • Updated the Testing chapter of the reference manual so that it no

    longer states that locations and classes cannot be used

    simultaneously, mentioning Spring Boot as well.

  • The Javadoc for @ContextConfiguration has been updated accordingly.

  • Added hasLocations(), hasClasses(), and hasResources() convenience

    methods to MergedContextConfiguration.

Issue: SPR-11634

  1. … 7 more files in changeset.

Fix broken tests in QuartzSupportTests

This commit ensures that QuartzSupportTests and its related

configuration are compatible with Quartz 2.1.7.

  • Test jobs are now durable where required.

  • Deleted legacy tests that attempted to use a Runnable instead of a

    Job as a jobClass for a JobDetail.

  • Replaced quartz-hsql.sql with current version for Quartz 2.1.7.

Issue: SPR-11630