From 4edc63009417dfee51f2f2a173078fbf57ef8c2a Mon Sep 17 00:00:00 2001 From: agrgr Date: Wed, 8 Jan 2025 19:20:59 +0200 Subject: [PATCH] update comments in transactions tests --- ...tiveAerospikeTemplateTransactionTests.java | 26 +++++++++---------- ...ReactiveAerospikeTransactionTestUtils.java | 2 +- .../AerospikeTemplateTransactionTests.java | 24 ++++++++--------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/test/java/org/springframework/data/aerospike/transaction/reactive/ReactiveAerospikeTemplateTransactionTests.java b/src/test/java/org/springframework/data/aerospike/transaction/reactive/ReactiveAerospikeTemplateTransactionTests.java index e22e6cb4..5dded26a 100644 --- a/src/test/java/org/springframework/data/aerospike/transaction/reactive/ReactiveAerospikeTemplateTransactionTests.java +++ b/src/test/java/org/springframework/data/aerospike/transaction/reactive/ReactiveAerospikeTemplateTransactionTests.java @@ -89,7 +89,7 @@ public void afterAll() { @Test public void verifyOneWriteInTransaction() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ SampleClasses.DocumentWithIntegerId document = new SampleClasses.DocumentWithIntegerId(500, "test1"); // only for testing purposes as performing one write in a transaction lacks sense @@ -109,7 +109,7 @@ public void verifyOneWriteInTransaction() { @Test public void verifyMultipleWritesInTransaction() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ SampleClasses.DocumentWithIntegerId document1 = new SampleClasses.DocumentWithIntegerId(501, "test1"); SampleClasses.DocumentWithIntegerId document2 = new SampleClasses.DocumentWithIntegerId(501, "test2"); @@ -129,7 +129,7 @@ public void verifyMultipleWritesInTransaction() { @Test public void verifyMultipleWritesInTransactionWithTimeout() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ SampleClasses.DocumentWithIntegerId document1 = new SampleClasses.DocumentWithIntegerId(520, "test1"); SampleClasses.DocumentWithIntegerId document2 = new SampleClasses.DocumentWithIntegerId(520, "test2"); @@ -151,7 +151,7 @@ public void verifyMultipleWritesInTransactionWithTimeout() { @Test public void verifyMultipleWritesInTransactionWithTimeoutExpired() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ SampleClasses.DocumentWithIntegerId document1 = new SampleClasses.DocumentWithIntegerId(521, "test1"); SampleClasses.DocumentWithIntegerId document2 = new SampleClasses.DocumentWithIntegerId(521, "test2"); @@ -172,7 +172,7 @@ public void verifyMultipleWritesInTransactionWithTimeoutExpired() { @Test public void verifyMultipleWritesInTransactionWithDefaultTimeoutExpired() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ SampleClasses.DocumentWithIntegerId document1 = new SampleClasses.DocumentWithIntegerId(522, "test1"); SampleClasses.DocumentWithIntegerId document2 = new SampleClasses.DocumentWithIntegerId(522, "test2"); @@ -193,7 +193,7 @@ public void verifyMultipleWritesInTransactionWithDefaultTimeoutExpired() { @Test public void oneWriteInTransaction_manual_transactional() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ SampleClasses.DocumentWithIntegerId document = new SampleClasses.DocumentWithIntegerId(502, "test1"); transactionalOperator.transactional(reactiveTemplate.insert(document)).then() @@ -209,7 +209,7 @@ public void oneWriteInTransaction_manual_transactional() { @Test public void oneWriteInTransaction_manual_execute() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ SampleClasses.DocumentWithIntegerId document = new SampleClasses.DocumentWithIntegerId(503, "test1"); // Manually manage the transaction by using transactionalOperator.execute() @@ -231,7 +231,7 @@ public void oneWriteInTransaction_manual_execute() { @Test public void multipleWritesInTransaction_manual_execute() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ SampleClasses.DocumentWithIntegerId document1 = new SampleClasses.DocumentWithIntegerId(504, "test1"); SampleClasses.DocumentWithIntegerId document2 = new SampleClasses.DocumentWithIntegerId(505, "test2"); @@ -254,7 +254,7 @@ public void multipleWritesInTransaction_manual_execute() { @Test public void verifyRepeatingCommit() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ SampleClasses.DocumentWithIntegerId document1 = new SampleClasses.DocumentWithIntegerId(506, "test1"); // Manually manage the transaction by using transactionalOperator.execute() @@ -280,7 +280,7 @@ public void verifyRepeatingCommit() { @Test public void verifyTransactionRollback() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ SampleClasses.DocumentWithIntegerId document = new SampleClasses.DocumentWithIntegerId(507, "test1"); reactiveTemplate.insert(document).then(reactiveTemplate.insert(document)) @@ -298,7 +298,7 @@ public void verifyTransactionRollback() { @Test public void oneWriteInTransaction_multipleThreads() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ AtomicInteger counter = new AtomicInteger(); int threadsNumber = 5; AsyncUtils.executeConcurrently(threadsNumber, () -> { @@ -320,7 +320,7 @@ public void oneWriteInTransaction_multipleThreads() { @Test public void rollbackTransaction_multipleThreads() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ AtomicInteger counter = new AtomicInteger(); int threadsNumber = 5; AsyncUtils.executeConcurrently(threadsNumber, () -> { @@ -343,7 +343,7 @@ public void rollbackTransaction_multipleThreads() { @Test public void multipleWritesInTransaction_multipleThreads() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ AtomicInteger counter = new AtomicInteger(); int threadsNumber = 5; AsyncUtils.executeConcurrently(threadsNumber, () -> { diff --git a/src/test/java/org/springframework/data/aerospike/transaction/reactive/ReactiveAerospikeTransactionTestUtils.java b/src/test/java/org/springframework/data/aerospike/transaction/reactive/ReactiveAerospikeTransactionTestUtils.java index d522466d..89fe61e6 100644 --- a/src/test/java/org/springframework/data/aerospike/transaction/reactive/ReactiveAerospikeTransactionTestUtils.java +++ b/src/test/java/org/springframework/data/aerospike/transaction/reactive/ReactiveAerospikeTransactionTestUtils.java @@ -34,7 +34,7 @@ public ReactiveAerospikeTransactionTestUtils(IAerospikeReactorClient client, Rea protected Mono verifyOngoingTransaction_withPropagation(SampleClasses.DocumentWithPrimitiveIntId document, int propagationType, int numberOfSuspendCalls) { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ AerospikeReactiveTransactionManager trackedTxManager = spy(txManager); DefaultTransactionDefinition tranDefinition = new DefaultTransactionDefinition(); tranDefinition.setPropagationBehavior(propagationType); diff --git a/src/test/java/org/springframework/data/aerospike/transaction/sync/AerospikeTemplateTransactionTests.java b/src/test/java/org/springframework/data/aerospike/transaction/sync/AerospikeTemplateTransactionTests.java index c3ef548b..42e2f96e 100644 --- a/src/test/java/org/springframework/data/aerospike/transaction/sync/AerospikeTemplateTransactionTests.java +++ b/src/test/java/org/springframework/data/aerospike/transaction/sync/AerospikeTemplateTransactionTests.java @@ -90,7 +90,7 @@ public void afterAll() { @Test // just for testing purposes as performing only one write in a transaction lacks sense public void writeInTransaction() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ transactionTemplate.executeWithoutResult(status -> { assertThat(status.isNewTransaction()).isTrue(); template.insert(new SampleClasses.DocumentWithIntegerId(107, "test1")); @@ -102,7 +102,7 @@ public void writeInTransaction() { @Test public void multipleWritesInTransaction() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ transactionTemplate.executeWithoutResult(status -> { assertThat(status.isNewTransaction()).isTrue(); template.insert(new SampleClasses.DocumentWithIntegerId(101, "test1")); @@ -115,7 +115,7 @@ public void multipleWritesInTransaction() { @Test public void multipleWritesInTransactionWithTimeout() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ transactionTemplate.setTimeout(2); // timeout after the first command within a transaction transactionTemplate.executeWithoutResult(status -> { assertThat(status.isNewTransaction()).isTrue(); @@ -131,7 +131,7 @@ public void multipleWritesInTransactionWithTimeout() { @Test public void multipleWritesInTransactionWithTimeoutExpired() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ transactionTemplate.setTimeout(2); // timeout after the first command within a transaction assertThatThrownBy(() -> transactionTemplate.executeWithoutResult(status -> { template.insert(new SampleClasses.DocumentWithIntegerId(115, "test1")); @@ -147,7 +147,7 @@ public void multipleWritesInTransactionWithTimeoutExpired() { @Test public void multipleWritesInTransactionWithDefaultTimeoutExpired() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ assertThatThrownBy(() -> transactionTemplate.executeWithoutResult(status -> { template.insert(new SampleClasses.DocumentWithIntegerId(124, "test1")); AwaitilityUtils.wait(15, SECONDS); // timeout expires during this wait @@ -163,7 +163,7 @@ public void multipleWritesInTransactionWithDefaultTimeoutExpired() { @Test // just for testing purposes as performing only one write in a transaction lacks sense public void batchWriteInTransaction() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ List persons = IntStream.range(1, 10) .mapToObj(age -> Person.builder().id(nextId()) .firstName("Gregor") @@ -181,7 +181,7 @@ public void batchWriteInTransaction() { @Test public void multipleBatchWritesInTransactionWithTimeout() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ transactionTemplate.setTimeout(2); // timeout after the first command within a transaction transactionTemplate.executeWithoutResult(status -> { assertThat(status.isNewTransaction()).isTrue(); @@ -200,7 +200,7 @@ public void multipleBatchWritesInTransactionWithTimeout() { @Test public void multipleBatchWritesInTransactionWithTimeoutExpired() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ transactionTemplate.setTimeout(2); // timeout after the first command within a transaction assertThatThrownBy(() -> transactionTemplate.executeWithoutResult(status -> { template.insertAll(List.of(new DocumentWithPrimitiveIntId(120), @@ -375,7 +375,7 @@ protected void doInTransactionWithoutResult(TransactionStatus status) { @Test public void oneWriteInTransaction_multipleThreads() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ AtomicInteger counter = new AtomicInteger(); int threadsNumber = 5; AsyncUtils.executeConcurrently(threadsNumber, () -> { @@ -394,7 +394,7 @@ public void oneWriteInTransaction_multipleThreads() { @Test public void rollbackTransaction_multipleThreads() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ AtomicInteger counter = new AtomicInteger(); int threadsNumber = 10; AsyncUtils.executeConcurrently(threadsNumber, () -> { @@ -414,7 +414,7 @@ public void rollbackTransaction_multipleThreads() { @Test public void multipleWritesInTransaction_multipleThreads() { - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ AtomicInteger counter = new AtomicInteger(); int threadsNumber = 10; AsyncUtils.executeConcurrently(threadsNumber, () -> { @@ -438,7 +438,7 @@ public void multipleWritesInTransaction_multipleThreads() { public void deleteInTransaction() { DocumentWithPrimitiveIntId doc = new DocumentWithPrimitiveIntId(1000); template.insert(doc); - // Multi-record transactions are supported starting with Server version 8.0+ + // Transactions are supported starting with Server version 8.0+ transactionTemplate.executeWithoutResult(status -> { assertThat(status.isNewTransaction()).isTrue(); template.delete(doc);