Skip to content

Commit

Permalink
update comments in transactions tests
Browse files Browse the repository at this point in the history
  • Loading branch information
agrgr committed Jan 8, 2025
1 parent 6291221 commit 4edc630
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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");

Expand All @@ -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");

Expand All @@ -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");

Expand All @@ -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");

Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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");

Expand All @@ -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()
Expand All @@ -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))
Expand All @@ -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, () -> {
Expand All @@ -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, () -> {
Expand All @@ -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, () -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public ReactiveAerospikeTransactionTestUtils(IAerospikeReactorClient client, Rea

protected Mono<Void> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand All @@ -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"));
Expand All @@ -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();
Expand All @@ -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"));
Expand All @@ -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
Expand All @@ -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<Person> persons = IntStream.range(1, 10)
.mapToObj(age -> Person.builder().id(nextId())
.firstName("Gregor")
Expand All @@ -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();
Expand All @@ -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),
Expand Down Expand Up @@ -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, () -> {
Expand All @@ -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, () -> {
Expand All @@ -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, () -> {
Expand All @@ -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);
Expand Down

0 comments on commit 4edc630

Please sign in to comment.