@@ -11,9 +11,8 @@ import org.jetbrains.exposed.v1.jdbc.transactions.transaction
1111import org.junit.jupiter.api.AfterEach
1212import org.junit.jupiter.api.Assertions.assertEquals
1313import org.junit.jupiter.api.BeforeEach
14- import org.junit.jupiter.api.Test
14+ import org.junit.jupiter.api.RepeatedTest
1515import org.springframework.test.annotation.Commit
16- import org.springframework.test.annotation.Repeat
1716import org.springframework.transaction.IllegalTransactionStateException
1817import org.springframework.transaction.TransactionDefinition
1918import org.springframework.transaction.annotation.Isolation
@@ -44,19 +43,17 @@ open class ExposedTransactionManagerTest : SpringTransactionTestBase() {
4443 }
4544 }
4645
47- @Test
46+ @RepeatedTest( 5 )
4847 @Transactional
4948 @Commit
50- @Repeat(5 )
5149 open fun testConnection () {
5250 T1 .insertRandom()
5351 assertEquals(1 , T1 .selectAll().count())
5452 }
5553
56- @Test
54+ @RepeatedTest( 5 )
5755 @Transactional
5856 @Commit
59- @Repeat(5 )
6057 open fun testConnection2 () {
6158 val rnd = Random ().nextInt().toString()
6259 T1 .insert {
@@ -65,8 +62,7 @@ open class ExposedTransactionManagerTest : SpringTransactionTestBase() {
6562 assertEquals(rnd, T1 .selectAll().single()[T1 .c1])
6663 }
6764
68- @Test
69- @Repeat(5 )
65+ @RepeatedTest(5 )
7066 @Commit
7167 open fun testConnectionCombineWithExposedTransaction () {
7268 transaction {
@@ -83,8 +79,7 @@ open class ExposedTransactionManagerTest : SpringTransactionTestBase() {
8379 }
8480 }
8581
86- @Test
87- @Repeat(5 )
82+ @RepeatedTest(5 )
8883 @Commit
8984 @Transactional
9085 open fun testConnectionCombineWithExposedTransaction2 () {
@@ -104,8 +99,7 @@ open class ExposedTransactionManagerTest : SpringTransactionTestBase() {
10499 * Test for Propagation.NESTED
105100 * Execute within a nested transaction if a current transaction exists, behave like REQUIRED otherwise.
106101 */
107- @Test
108- @Repeat(5 )
102+ @RepeatedTest(5 )
109103 @Transactional
110104 open fun testConnectionWithNestedTransactionCommit () {
111105 T1 .insertRandom()
@@ -121,8 +115,7 @@ open class ExposedTransactionManagerTest : SpringTransactionTestBase() {
121115 * Test for Propagation.NESTED with inner roll-back
122116 * The nested transaction will be roll-back only inner transaction when the transaction marks as rollback.
123117 */
124- @Test
125- @Repeat(5 )
118+ @RepeatedTest(5 )
126119 @Transactional
127120 open fun testConnectionWithNestedTransactionInnerRollback () {
128121 T1 .insertRandom()
@@ -139,8 +132,7 @@ open class ExposedTransactionManagerTest : SpringTransactionTestBase() {
139132 * Test for Propagation.NESTED with outer roll-back
140133 * The nested transaction will be roll-back entire transaction when the transaction marks as rollback.
141134 */
142- @Test
143- @Repeat(5 )
135+ @RepeatedTest(5 )
144136 fun testConnectionWithNestedTransactionOuterRollback () {
145137 transactionManager.execute {
146138 T1 .insertRandom()
@@ -163,8 +155,7 @@ open class ExposedTransactionManagerTest : SpringTransactionTestBase() {
163155 * Test for Propagation.REQUIRES_NEW
164156 * Create a new transaction, and suspend the current transaction if one exists.
165157 */
166- @Test
167- @Repeat(5 )
158+ @RepeatedTest(5 )
168159 @Transactional
169160 open fun testConnectionWithRequiresNew () {
170161 T1 .insertRandom()
@@ -182,8 +173,7 @@ open class ExposedTransactionManagerTest : SpringTransactionTestBase() {
182173 * The inner transaction will be roll-back only inner transaction when the transaction marks as rollback.
183174 * And since isolation level is READ_COMMITTED, the inner transaction can't see the changes of outer transaction.
184175 */
185- @Test
186- @Repeat(5 )
176+ @RepeatedTest(5 )
187177 fun testConnectionWithRequiresNewWithInnerTransactionRollback () {
188178 transactionManager.execute {
189179 T1 .insertRandom()
@@ -205,8 +195,7 @@ open class ExposedTransactionManagerTest : SpringTransactionTestBase() {
205195 * Test for Propagation.NEVER
206196 * Execute non-transactionally, throw an exception if a transaction exists.
207197 */
208- @Test
209- @Repeat(5 )
198+ @RepeatedTest(5 )
210199 @Transactional(propagation = Propagation .NEVER )
211200 open fun testPropagationNever () {
212201 assertFailsWith<IllegalStateException > { // Should Be "No transaction exist"
@@ -218,8 +207,7 @@ open class ExposedTransactionManagerTest : SpringTransactionTestBase() {
218207 * Test for Propagation.NEVER
219208 * Throw an exception cause outer transaction exists.
220209 */
221- @Test
222- @Repeat(5 )
210+ @RepeatedTest(5 )
223211 @Transactional
224212 open fun testPropagationNeverWithExistingTransaction () {
225213 assertFailsWith<IllegalTransactionStateException > {
@@ -234,8 +222,7 @@ open class ExposedTransactionManagerTest : SpringTransactionTestBase() {
234222 * Test for Propagation.MANDATORY
235223 * Support a current transaction, throw an exception if none exists.
236224 */
237- @Test
238- @Repeat(5 )
225+ @RepeatedTest(5 )
239226 @Transactional
240227 open fun testPropagationMandatoryWithTransaction () {
241228 T1 .insertRandom()
@@ -248,8 +235,7 @@ open class ExposedTransactionManagerTest : SpringTransactionTestBase() {
248235 * Test for Propagation.MANDATORY
249236 * Throw an exception cause no transaction exists.
250237 */
251- @Test
252- @Repeat(5 )
238+ @RepeatedTest(5 )
253239 open fun testPropagationMandatoryWithoutTransaction () {
254240 assertFailsWith<IllegalTransactionStateException > {
255241 transactionManager.execute(TransactionDefinition .PROPAGATION_MANDATORY ) {
@@ -262,8 +248,7 @@ open class ExposedTransactionManagerTest : SpringTransactionTestBase() {
262248 * Test for Propagation.SUPPORTS
263249 * Support a current transaction, execute non-transactionally if none exists.
264250 */
265- @Test
266- @Repeat(5 )
251+ @RepeatedTest(5 )
267252 @Transactional
268253 open fun testPropagationSupportWithTransaction () {
269254 T1 .insertRandom()
@@ -276,8 +261,7 @@ open class ExposedTransactionManagerTest : SpringTransactionTestBase() {
276261 * Test for Propagation.SUPPORTS
277262 * Execute non-transactionally if none exists.
278263 */
279- @Test
280- @Repeat(5 )
264+ @RepeatedTest(5 )
281265 open fun testPropagationSupportWithoutTransaction () {
282266 transactionManager.execute(TransactionDefinition .PROPAGATION_SUPPORTS ) {
283267 assertFailsWith<IllegalStateException > { // Should Be "No transaction exist"
@@ -289,8 +273,7 @@ open class ExposedTransactionManagerTest : SpringTransactionTestBase() {
289273 /* *
290274 * Test for Isolation Level
291275 */
292- @Test
293- @Repeat(5 )
276+ @RepeatedTest(5 )
294277 @Transactional(isolation = Isolation .READ_COMMITTED )
295278 open fun testIsolationLevelReadUncommitted () {
296279 assertTransactionIsolationLevel(TransactionDefinition .ISOLATION_READ_COMMITTED )
@@ -307,8 +290,7 @@ open class ExposedTransactionManagerTest : SpringTransactionTestBase() {
307290 * Test for Timeout
308291 * Execute with query timeout
309292 */
310- @Test
311- @Repeat(5 )
293+ @RepeatedTest(5 )
312294 open fun testTimeout () {
313295 transactionManager.execute(timeout = 1 ) {
314296 try {
0 commit comments