Commit Graph

19596 Commits

Author SHA1 Message Date
douddle
93ddfb9cae Add SVG mapping to mime.types file for JavaMail support
Closes gh-23629
2019-09-12 16:52:59 +02:00
Sam Brannen
d689ef8891 Support disabling cron jobs registered via SchedulingConfigurer
Prior to this commit, support was provided for disabling cron jobs
configured with an explicit "-" cron expression. However, the "-"
expression was only supported when supplied via the @Scheduled
annotation.

This commit adds support for disabling cron jobs configured with the
"-" cron expression when a cron job is registered via the
addCronTask(Runnable, String) method in the ScheduledTaskRegistrar
supplied to a SchedulingConfigurer.

Closes gh-23568
2019-09-12 16:08:26 +02:00
Sebastien Deleuze
fc6480631e Improve Coroutines transaction API
As a follow-up of gh-22915, the purpose of this commit is to improve
Coroutines programmatic transaction API to make it more consistent with
the Java one and more idiomatic.

For suspending functions, this commit changes the
TransactionalOperator.transactional extension with a suspending lambda
parameter to a TransactionalOperator.executeAndAwait one which is
conceptually closer to TransactionalOperator.execute Java API so more
consistent.

For Flow, the TransactionalOperator.transactional extension is correct
but would be more idiomatic as a Flow extension.

This commit also adds code samples to the reference documentation.

Closes gh-23627
2019-09-12 14:45:03 +02:00
Sam Brannen
e62cb6bc56 Merge branch '5.1.x' 2019-09-12 14:03:12 +02:00
GungnirLaevatain
9db4118180 Fix DefaultListableBeanFactory#copyConfigurationFrom
Prior to this commit, the copyConfigurationFrom(ConfigurableBeanFactory)
method in DefaultListableBeanFactory cloned its own AutowireCandidateResolver
type instead of the resolver type from the supplied ConfigurableBeanFactory.

This commit fixes that by cloning the resolver type from the supplied
ConfigurableBeanFactory.

Closes gh-23569
2019-09-12 13:58:24 +02:00
Sam Brannen
2b460854ce Polishing 2019-09-12 13:16:48 +02:00
Sam Brannen
e124cbb310 Fix Checkstyle violation 2019-09-12 13:15:58 +02:00
OLPMO
40fcf876ce Optimize test code with lambdas where feasible
This commit optimizes test code with lambda expressions
and method references where feasible.

Closes gh-23626
2019-09-12 13:09:31 +02:00
Sam Brannen
00c07e3a50 Indent with tabs 2019-09-12 11:51:44 +02:00
Andy Wilkinson
508b6798ff Move jmx.log beneath build/ to avoid UP-TO-DATE pollution
Previously, some tests in spring-context wrote a file named jmx.log
into spring-context/. This led to the file being included in the
sources of the Checkstyle NoHTTP Gradle task, breaking that task's
UP-TO-DATE checks and causing it to execute unnecessarily.

This commit updates the tests to write the jmx.log file beneath
spring-context/build/ so that it is not included in the sources of the
Checkstyle NoHTTP task.

Closes gh-23623
2019-09-12 11:39:43 +02:00
Sam Brannen
8f38f5c17a Polishing 2019-09-12 11:35:30 +02:00
Sam Brannen
30cff46e7f Prevent improper use of testing framework APIs
Prior to this commit, a lot of work had been done to prevent improper
use of testing Framework APIs throughout the codebase; however, there
were still some loopholes.

This commit addresses these loopholes by introducing additional
Checkstyle rules (and modifying existing rules) to prevent improper use
of testing framework APIs in production code as well as in test code.

- Checkstyle rules for banned imports have been refactored into
  multiple rules specific to JUnit 3, JUnit 4, JUnit Jupiter, and
  TestNG.
- Accidental usage of org.junit.Assume has been switched to
  org.junit.jupiter.api.Assumptions.
- All test classes now reside under org.springframework packages.
- All test classes (including abstract test classes) now conform to the
  `*Tests` naming convention.
  - As an added bonus, tests in the renamed
    ScenariosForSpringSecurityExpressionTests are now included in the
    build.
- Dead JUnit 4 parameterized code has been removed from
  DefaultServerWebExchangeCheckNotModifiedTests.

Closes gh-22962
2019-09-12 11:20:56 +02:00
Stephane Nicoll
92d3f7e7d7 Merge pull request #23620 from wilkinsona
* pr/23620:
  Enable parallel builds by default

Closes gh-23620
2019-09-12 09:48:50 +02:00
Andy Wilkinson
9de4c4aefb Enable parallel builds by default
Previously, all tasks in the build were run sequentially. This
commit updates Gradle's properties to build them in parallel where
possible. When using the daemon (recommended) its default max heap is
not sufficient for the demands on a parallel build, therefore this
commit also increases the daemon's max heap.

See gh-23620
2019-09-12 09:48:45 +02:00
Rossen Stoyanchev
cfae20f97d Update advice on creating issue vs pull request
Closes gh-23427
2019-09-11 16:16:41 +01:00
Andy Wilkinson
2b4316cf24 Upgrade to com.gradle.build-scan 2.4.2
Closes gh-23619
2019-09-11 15:36:19 +02:00
Sam Brannen
d759ae772b Rename Spr3896SuiteTests to Spr3896TestSuite
This commit renames Spr3896SuiteTests to comply with our naming
convention for test classes that should be executed via the Gradle
build.

The effect of this commit is that test classes included in that "suite"
are no longer executed twice in the build. Consequently, Gradle and
Bamboo will now report the same number of executed tests for the
spring-test project.
2019-09-11 13:21:19 +02:00
Arjen Poutsma
13ba7ef701 Merge branch '5.1.x' 2019-09-11 10:43:43 +02:00
Arjen Poutsma
b159ef6019 Make MockClientHttpResponse uses raw status code
This commit make sure that MockClientHttpResponse does not use
HttpStatus, but the raw status code.

Closes gh-23599
2019-09-11 10:41:01 +02:00
Andy Wilkinson
b730597c87 Disable caching of changing modules and dynamic versions
Previously, changing modules (snapshots) and dynamic versions were
cached for Gradle's default period of 24 hours and
--refresh-dependencies was used to pick up the latest artifacts. This
approach has a notable downside. --refresh-dependencies causes all
dependencies to be refreshed, irrespective of whether they are
expected to change. At a minimum, this results in a HEAD request for
every dependency in the build. Running an up-to-date build without
--refresh-dependencies takes in the region of 6 seconds:

$ ./gradlew build

BUILD SUCCESSFUL in 6s
203 actionable tasks: 203 up-to-date

The same build with --refresh-dependencies takes almost ten times as
long:

$ ./gradlew build --refresh-dependencies

BUILD SUCCESSFUL in 58s
203 actionable tasks: 203 up-to-date

This commit replaces the manual usage of --refresh-dependencies on
the command line with a 0 second caching period for changing modules
and dynamic versions. This should remove the need to use
--refresh-dependencies both locally and on CI, saving almost 1 minute
per full build.
2019-09-11 10:00:01 +02:00
Sam Brannen
333711fd36 Convert XmlValidationModeDetectorTests to JUnit Jupiter and AssertJ
See gh-23605
2019-09-09 16:29:00 +02:00
Sam Brannen
22c88d7126 Merge branch '5.1.x' 2019-09-09 16:25:20 +02:00
Sam Brannen
961010055e Support trailing comment in DTD declaration in XML config
Prior to this commit, Spring failed to determine that an XML config file
was DTD-based if the DTD declaration was followed by a comment.

This commit fixes this by modifying the consumeCommentTokens(String)
algorithm in XmlValidationModeDetector so that both leading and trailing
comments are properly consumed without losing any XML content.

Closes gh-23605
2019-09-09 16:18:21 +02:00
Sam Brannen
604eecaf67 Upgrade to JUnit 5.5.2
This commit also removes the testRuntime dependency on Hamcrest which
was a workaround for https://github.com/junit-team/junit5/issues/2004.

Closes gh-23604
2019-09-09 14:20:56 +02:00
Sebastien Deleuze
5bb8c47b14 Rename fromObject to fromValue in BodyInserters
Closes gh-23587
2019-09-09 00:08:55 +02:00
Sam Brannen
665e8aa51c Downgrade to JUnit 4.12
Since it does not appear that JUnit 4.13 will be released before Spring
Framework 5.2 GA, I am reverting back to JUnit 4.12 for the time being.

See gh-22894
2019-09-08 15:22:21 +02:00
Sam Brannen
683fe9ed70 Update comment
See gh-23604
2019-09-08 15:15:30 +02:00
康智冬
0d742cf3d0 Fix typos related to indefinite articles for SQL acronym
Closes gh-23603
2019-09-07 16:04:47 +02:00
Andy Wilkinson
df7e4ad023 Tweak detection of Bamboo
When exposed as an environment variable Bamboo's bamboo.resultsUrl
is mapped to bamboo_resultsUrl. This commit updates the build scan
user data script to look for the latter rather than the former.

Closes gh-23597
2019-09-06 19:18:46 +02:00
Sam Brannen
d817b591e5 Revert "Tweak detection of Bamboo (#23597)"
This reverts commit 35567678ef, reversing
changes made to 807e1d3367.
2019-09-06 19:16:59 +02:00
Sam Brannen
35567678ef Tweak detection of Bamboo (#23597)
When exposed as an environment variable Bamboo's bamboo.resultsUrl
is mapped to bamboo_resultsUrl. This commit updates the build scan
user data script to look for the latter rather than the former.
2019-09-06 17:18:10 +02:00
Sam Brannen
807e1d3367 Upgrade to Gradle 5.6.2
See gh-23479
2019-09-06 16:09:01 +02:00
Sam Brannen
5d5f9aceca Avoid accidental usage of JUnit 4 assumptions
This commit also avoids starting a server if an assumption fails.
2019-09-06 16:03:36 +02:00
Sam Brannen
591995ecc8 Polish and revive disabled tests
This commit revives some previously disabled tests and converts
some usage of @Disabled to @EnabledForTestGroups(...).
2019-09-06 15:57:27 +02:00
Andy Wilkinson
fcda0fb8d9 Tweak detection of Bamboo
When exposed as an environment variable Bamboo's bamboo.resultsUrl
is mapped to bamboo_resultsUrl. This commit updates the build scan
user data script to look for the latter rather than the former.
2019-09-06 10:08:35 +01:00
Andy Wilkinson
35b967a801 Add opt-in build scan integration with Gradle Enterprise
This commit adds opt-in build scan integration with Gradle Enterprise.
When the GRADLE_ENTERPRISE_URL environment variable is set on a
developer's machine or on CI, a build scan will be automatically
uploaded to Gradle Enterprise at the end of the build.

This initial integration will establish a baseline for Spring
Framework builds. Once that baseline has been established we can use
the build scans to identify ways in which the build can be optimized
and updated to make use of Gradle's build caching which should reduce
build times, significantly so for changes that only affect tasks near
the leaf nodes of the task graph.
2019-09-05 15:16:59 +01:00
Sam Brannen
2b1ae4af60 Remove obsolete Checkstyle suppression entries 2019-09-05 15:54:55 +02:00
Sam Brannen
760f7bed03 Merge branch '5.1.x' 2019-09-05 15:18:43 +02:00
Sebastien Deleuze
aa81fdc66f Upgrade to Kotlin Coroutines 1.3.1 2019-09-05 15:09:17 +02:00
Sam Brannen
a7aecbb4dc Ensure spring-test test tasks are UP-TO-DATE
See also: 69214429df and eec183ef28
2019-09-05 15:06:12 +02:00
Stephane Nicoll
9afe17a29b Fix static imports handling in IntelliJ IDEA configuration
Closes gh-23588
2019-09-05 14:35:54 +02:00
Sam Brannen
99d88ba14e Document minimum JDK 8 update version
Closes gh-23563
2019-09-05 14:04:43 +02:00
Sam Brannen
ef50777535 Polishing 2019-09-05 13:45:38 +02:00
Sam Brannen
d9e3b8b9a5 Introduce default constructor in TomcatHttpServer 2019-09-05 13:45:38 +02:00
Sebastien Deleuze
40a55b412d Rename BodyBuilder#bodyAndAwait to bodyValueAndAwait 2019-09-05 13:34:11 +02:00
Sam Brannen
73f5d05fd9 Avoid deprecation warning in RandomHandlerIntegrationTests 2019-09-05 13:29:01 +02:00
Sam Brannen
c80705a708 Polishing 2019-09-05 13:20:20 +02:00
Sam Brannen
ce178f76eb Add missing Temporal tests in BeanUtilsTests
This change will help to serve as a regression test.
2019-09-05 13:14:39 +02:00
Stephane Nicoll
facdbdb7b6 Fix checkstyle violation 2019-09-05 09:18:43 +02:00
Phillip Webb
6fbd4841ec Update checkstyle import rule
Update the checkstyle rule to enforce the blank line between `java`
and `javax`.

Closes gh-23539
2019-09-04 22:06:46 -07:00