Commit Graph

556 Commits

Author SHA1 Message Date
康智冬 0d742cf3d0 Fix typos related to indefinite articles for SQL acronym
Closes gh-23603
2019-09-07 16:04:47 +02:00
Phillip Webb deba2ed1b3 Add blank line between java and javax imports
See gh-23539
2019-09-04 22:05:46 -07:00
Brian Clozel d4089747b8 Use dependency management in Framework build
Prior to this commit, the Spring Framework build would partially use the
dependency management plugin to import and enforce BOMs.

This commit applies the dependency management plugin to all Java
projects and regroups all version management declaration in the root
`build.gradle` file (versions and exclusions).

Some versions are overridden in specific modules for
backwards-compatibility reasons or extended support.

This commit also adds the Gradle versions plugin that checks for
dependency upgrades in artifact repositories and produces a report; you
can use the following:

    ./gradlew dependencyUpdates
2019-09-02 18:01:09 +02:00
Sebastien Deleuze ca02cc1194 Migrate to AssertJ in Kotlin tests
Closes gh-23475
2019-09-02 15:59:26 +02:00
Sam Brannen ad6231ad29 Add missing @Override annotations 2019-08-23 13:50:58 +02:00
Brian Clozel e9523161f0 Revert "Revert "Refactor Gradle tasks in Spring Framework build""
This reverts commit fb0d618751.
2019-08-20 20:26:43 +02:00
Stephane Nicoll fb0d618751 Revert "Refactor Gradle tasks in Spring Framework build"
This reverts commit 1539ba8991.
2019-08-20 20:07:11 +02:00
Brian Clozel 1539ba8991 Refactor Gradle tasks in Spring Framework build
This commit reorganizes tasks and scripts in the build to only apply
them where they're needed. We're considering here 3 "types" of projects
in our build:
* the root project, handling documentation, publishing, etc
* framework modules (a project that's published as a spring artifact)
* internal modules, such as the BOM, our coroutines support and our
integration-tests

With this change, we're strealining the project configuration for all
spring modules and only applying plugins when needed (typically our
kotlin support).

See gh-23282
2019-08-20 18:17:02 +02:00
Sam Brannen 288461a541 Introduce @EnabledForTestGroups in Spring's test suite
Closes gh-23476
2019-08-17 14:47:24 +02:00
Sam Brannen 979508a7f3 Remove JUnit 4 dependency from all modules except spring-test
This commit removes the JUnit 4 dependency from all modules except
spring-test which provides explicit JUnit 4 support.

This commit also includes the following.

- migration from JUnit 4 assertions to JUnit Jupiter assertions in all
  Kotlin tests
- migration from JUnit 4 assumptions in Spring's TestGroup support to
  JUnit Jupiter assumptions, based on org.opentest4j.TestAbortedException
- introduction of a new TestGroups utility class than can be used from
  existing JUnit 4 tests in the spring-test module in order to perform
  assumptions using JUnit 4's Assume class

See gh-23451
2019-08-17 11:37:21 +02:00
Sam Brannen 3f3e41923f Migrate rest of test suite from JUnit 4 to JUnit Jupiter
This commit migrates the rest of Spring's test suite to JUnit Jupiter,
except spring-test which will be migrated in a separate commit.

See gh-23451
2019-08-17 11:36:58 +02:00
Sam Brannen 6c0e550b86 Polish contribution
See gh-23445
2019-08-10 14:07:15 +02:00
zhuzhuman978 849bbf00b5 Simplify if statements and replace try-finally with try-with-resources
Closes gh-23445
2019-08-10 14:03:18 +02:00
Juergen Hoeller 53d067399d Merge branch '5.1.x' 2019-08-02 01:46:26 +02:00
Juergen Hoeller 7c2e2d40af Polishing 2019-08-02 01:39:02 +02:00
Juergen Hoeller d8e624e97e Consistent suppression of get/clearWarnings without target connection
See gh-23346
2019-08-02 01:19:16 +02:00
Juergen Hoeller fd86f34057 Merge branch '5.1.x' 2019-08-01 15:27:06 +02:00
Juergen Hoeller 871bb57e02 TransactionAwareDataSourceProxy locally handles get/clearWarnings call
Closes gh-23346
2019-08-01 15:26:00 +02:00
Sebastien Deleuze 095fd5bcb3 Use Kotlin BOM
Close gh-23316
2019-07-19 10:43:54 +02:00
Sam Brannen c788be30fe Polish contribution
See gh-23289
2019-07-15 19:08:20 +02:00
Phillip Webb b5e4e02337 Polish ScriptUtilsUnitTests 2019-07-15 14:43:03 +02:00
Phillip Webb 17914fc44b Add multi-prefix comment support for SQL scripts
Update `ResourceDatabasePopulator` and `ScriptUtils` so that more than
one comment prefix can be used when processing SQL scripts. This
feature is particularly useful when dealing with scripts provided by
Quartz since they often use a mix `--` and `#`.

Closes gh-23289
2019-07-15 14:43:03 +02:00
Juergen Hoeller 42c0d8ec7f Merge branch '5.1.x' 2019-06-12 14:14:40 +02:00
Juergen Hoeller 1ccd99ebe7 Polishing 2019-06-12 14:11:39 +02:00
Juergen Hoeller 98a49b46b7 NamedParameterJdbcTemplate only treats Iterables like Collections
Closes gh-22981
2019-06-12 13:29:07 +02:00
Juergen Hoeller 7dc92aa05d Polishing 2019-06-11 20:57:27 +02:00
Juergen Hoeller eeb79c8dde NamedParameterJdbcTemplate treats arrays/Iterables like Collections
Closes gh-22981
2019-06-11 18:26:40 +02:00
Sam Brannen 141ef9082f Clean up Mockito usage
This commit migrates to the MockitoJUnitRunner where sensible, which
will later allow for an easier migration to Mockito's extension for
JUnit Jupiter.

In addition, this commit deletes unnecessary stubbing for various mocks
and polishes test fixture setup in various test classes.
2019-05-28 13:59:43 +02:00
Sam Brannen 4b9f5a35a6 Polish contribution 2019-05-27 11:22:11 +02:00
Сергей Цыпанов 6964ed33bf Allocate objects only when it's necessary
Closes gh-23036
2019-05-27 11:14:25 +02:00
stsypanov 4cc7b9b9fc tiny simplifications regarding usage of Iterator 2019-05-25 20:32:43 +02:00
Sam Brannen f47481749b Fix Checkstyle violation 2019-05-24 18:33:29 +02:00
Sam Brannen a4cd547b7e Fix ScriptUtilsUnitTests 2019-05-24 10:46:50 +02:00
Sam Brannen 303216f4eb Merge branch '5.1.x' 2019-05-24 10:18:25 +02:00
chrunchyjesus 771a05e878 Fix ScriptUtils for MS Windows line ending
Prior to this commit, ScriptUtils did not properly split SQL
scripts that contained line endings for MS Windows.

Closes gh-23019
2019-05-24 10:15:43 +02:00
Phillip Webb 9d74da006c Migrate JUnit 4 assertions to AssertJ
Migrate all existing JUnit 4 `assert...` based assertions to AssertJ
and add a checkstyle rule to ensure they don't return.

See gh-23022
2019-05-23 15:52:49 -07:00
Phillip Webb 95a9d46a87 Migrate Hamcrest assertions to AssertJ
Migrate all existing `assertThat(..., Matcher)` assertions to AssertJ
and add checkstyle rules to ensure they don't return.

See gh-23022
2019-05-23 15:49:59 -07:00
Phillip Webb 02850f357f Migrate exception checking tests to use AssertJ
Migrate tests that use `@Test(expectedException=...)` or
`try...fail...catch` to use AssertJ's `assertThatException`
instead.
2019-05-20 10:47:53 -07:00
Sam Brannen 73dbd06361 Enforces static imports for JUnit 4 assertions and assumptions
This commit configures Checkstyle to enforces static imports for JUnit 4
assertions and assumptions.

See gh-22932
2019-05-12 15:13:07 +02:00
Phillip Webb 816bbee8de Remove '.*' imports from tests
Organize test imports to expand all '.*' static imports into
fully qualified imports.

This update will allow us to use additional checkstyle rules in
the future, and will also help if we migrate fully to AssertJ.
2019-05-08 09:55:09 -07:00
Phil Webb d7320de871 Migrate away from ExpectedException (#22922)
* Add limited checkstyles to test code

Add a limited set of checkstyle rules to the test codebase to improve
code consistency.

* Fix checksyle violations in test code

* Organize imports to fix checkstyle for test code

* Migrate to assertThatExceptionOfType

Migrate aware from ExpectedException rules to AssertJ exception
assertions. Also include a checkstyle rules to ensure that the
the ExpectedException is not accidentally used in the future.

See gh-22894
2019-05-08 16:25:52 +02:00
Sam Brannen ccb01e663a Merge branch '5.1.x' 2019-05-07 13:03:45 +02:00
Sam Brannen 4aaec942c4 Introduce HTTPS mappings in spring.schemas files
Closes gh-22903
2019-05-07 12:56:42 +02:00
Sam Brannen 47c39304af Use assertThat from Hamcrest instead of JUnit 4
org.junit.Assert.assertThat() is deprecated as of JUnit 4.13.

See gh-22894
2019-05-05 18:27:38 +02:00
Juergen Hoeller f0f6af2926 Merge branch '5.1.x' 2019-05-03 18:13:12 +02:00
Juergen Hoeller a7949ac84a Consistent use of StringUtils.hasLength(String) vs isEmpty(Object) 2019-05-03 17:29:14 +02:00
Juergen Hoeller eaa9a78d5d Merge branch '5.1.x' 2019-05-03 00:23:57 +02:00
Juergen Hoeller 5b1b1bae37 Consistent use of try-with-resources for local resource closing 2019-05-03 00:11:47 +02:00
Juergen Hoeller 31c3b8a291 Avoid unguarded String concatenation for debug/trace logging
Closes gh-22874
2019-05-03 00:10:56 +02:00
Juergen Hoeller 0babc1fb64 Polishing 2019-04-02 20:04:07 +02:00