Commit Graph

383 Commits

Author SHA1 Message Date
Sam Brannen 5581f3b77b Use Gradle test fixture support for spring-tx
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 726b1bb1d0 Rename test fixture package in spring-context
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 7cd4ddf5fc Rename test fixture package in spring-beans
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 4260c34b47 Rename test fixture package in spring-core
See gh-23550
2020-01-02 16:01:34 +01:00
Sam Brannen 61d4ee594d Use Gradle test fixture support for spring-beans and spring-context
See gh-23550
2020-01-02 16:01:34 +01:00
Sam Brannen 5718bf424b Use Gradle test fixture support for spring-core
See gh-23550
2020-01-02 16:01:34 +01:00
Juergen Hoeller a4f75e9c6a Polishing 2019-12-09 13:29:00 +01:00
Sam Brannen 9f00eb68e9 Clean up warnings 2019-10-30 19:14:58 +01:00
Christoph Dreis 3c17178b16 Fix Mockito deprecations 2019-10-30 18:30:05 +01:00
Juergen Hoeller 43a86565ca Consider target transaction manager for reactive transaction decision
Closes gh-23832
2019-10-30 16:23:37 +01:00
Mark Paluch 0d8aa854e8 Add tests for cancellation of transactional streams
See gh-23864

Closes gh-23873
2019-10-25 17:16:33 +02:00
Andreas Killaitis f838590300 Commit on cancelled subscription in TransactionalOperator::transactional
Prior to this commit, TransactionalOperator::transactional did not close
the transaction when cancelled.

Closes gh-23864
2019-10-25 14:48:46 +02:00
Sebastien Deleuze b24ac74106 Restore TransactionOperations Kotlin API compatibilty
This commit renames the Runnable variant to executeWithoutResult
and uses a Consumer<TransactionStatus> parameter for better
consistency with TransactionCallbackWithoutResult.

Closes gh-23724
2019-09-29 19:31:12 +02:00
Juergen Hoeller 2861fc65bd Polishing 2019-09-27 10:17:56 +02:00
Sebastien Deleuze 091c512f0d Upgrade to Coroutines 1.3.2
Closes gh-23663
2019-09-25 21:51:04 +02:00
Juergen Hoeller a48c13ae73 Avoid deprecated usingWhen method in Reactor 3.3
Closes gh-23562
2019-09-20 21:54:18 +02:00
Mark Paluch 393a81d4a9 Omit cancellation of transactional Monos in TransactionOperator
TransactionOperator.as(Mono) now no longer short-cuts via a Flux.next() but provides an implementation via Mono.usingWhen(…).
The short-cut previously issued a cancellation signal to the transactional Mono causing the transaction cleanup to happen without a handle for synchronization.

Using Mono.usingWhen(…) initiates transaction cleanup when the Mono completes eliminating the need for cancellation of the transactional Publisher.

This change does not fully fix gh-23304 but it softens its impact because TransactionalOperator.transactional(Mono) avoids cancellation.
2019-09-20 20:48:39 +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
康智冬 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
Sebastien Deleuze 70bbe71235 Polishing
See gh-22915
2019-09-04 18:24:35 +02:00
Rossen Stoyanchev 57d9b92b94 Upgrade Reactor to Dysprosium RC1
Closes: gh-23579
2019-09-04 08:55:45 +01:00
Juergen Hoeller eb6577755d Stackless variant of NoTransactionException for reactive flows
Closes gh-23360
2019-09-04 00:02:24 +02:00
Sebastien Deleuze 2b4eb610a7 Add support for Coroutines transactions
This commit adds Coroutines extensions for
TransactionalOperator.transactional that accept suspending lambda or
Kotlin Flow parameters.

@Transactional on suspending functions is not supported yet, gh-23575
has been created for that purpose.

Closes gh-22915
2019-09-03 23:41:42 +02: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
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
Juergen Hoeller 2c33c11d4c Introduce TransactionOperations.execute(Runnable) convenience method
Closes gh-23250
2019-07-17 22:35:26 +02:00
Sebastien Deleuze a3222476ad Use proxyBeanMethods in ProxyTransactionManagementConfiguration
Closes gh-23166
2019-07-13 12:19:33 +02:00
Stephane Nicoll 9a71a8d357 Fix checkstyle violation
Closes gh-23276
2019-07-12 15:57:16 +02:00
Stephane Nicoll 4f8b347aa0 Do not trigger transactional event listener if no transaction is active
This commit fixes the behaviour of not triggering a transactional event
listener if no transaction is active. Previously, a transaction boundary
was all that was necessary to trigger the listener regardless of the fact
there was an active transaction.

This commit now prevents `Propagation.NOT_SUPPORTED` and
`Propagation.SUPPORTS` without an active transaction to trigger the
listener.

Closes gh-23276
2019-07-12 15:39:14 +02:00
Сергей Цыпанов 1728bf17fc Avoid unnecessary boxing where primitives can be used
Closes gh-23267
2019-07-10 16:51:18 +02:00
Sam Brannen e57845a50f Polishing 2019-07-06 15:32:54 +02:00
Juergen Hoeller 2abff1a5b0 Introduce withoutTransaction factory method on TransactionOperations
Closes gh-23198
2019-07-05 16:24:37 +02:00
Juergen Hoeller 0a77477d32 Merge branch '5.1.x' 2019-06-12 18:16:30 +02:00
Juergen Hoeller fc46abf0b7 Polishing 2019-06-12 18:04:06 +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
Sebastien Deleuze 098ac0bbb8 Annotate Object#equals parameter with @Nullable
Closes gh-23093
2019-06-06 14:18:30 +02:00
Sam Brannen 2ed9a61ba0 Rename TransactionSynchronizationManager#currentTransaction()
This commit renames currentTransaction() to forCurrentTransaction() for
greater clarity.

Closes gh-23086
2019-06-05 14:15:07 +03:00
Сергей Цыпанов 6964ed33bf Allocate objects only when it's necessary
Closes gh-23036
2019-05-27 11:14:25 +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
Juergen Hoeller 3645281c35 Polishing 2019-05-21 19:26:39 +02:00
Juergen Hoeller ff838fd011 Consistently support CompletionStage in ReactiveAdapterRegistry
Aligns ReactiveAdapterRegistry with MVC/messaging handler methods in terms of recognizing CompletionStage as well as CompletableFuture. Includes consistent use of ReactiveAdapter for reactive transactions.

Closes gh-23011
2019-05-21 19:26:12 +02: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
Phillip Webb 798b51f4a3 Migrate to BDD Mockito
Migrate all tests to consistently use BDD Mockito. Also add
checksyle rule to enforce going forwards.
2019-05-08 13:46:13 -07: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
Juergen Hoeller eb16e853b1 Fix JDK 9+ generics compilation problem in TransactionAspectSupport
Includes consistent mentioning of ReactiveTransactionManager in javadoc.

Closes gh-22923
2019-05-08 14:01:12 +02:00
Mark Paluch bb002af8af Fix suspend/resume in AbstractReactiveTransactionManager
We now correctly unwrap suspended resources instead capturing
the Mono emitting suspended resources.

We also properly continue resume by chaining resume Mono's
instead of terminating eagerly.
2019-05-07 15:51:27 +02:00