Search in sources :

Example 41 with ScanAll

use of com.scalar.db.api.ScanAll in project scalardb by scalar-labs.

the class ConsensusCommitSpecificIntegrationTestBase method scanAll_ScanAllGivenForDeletedWhenCoordinatorStateAbortedAndRolledBackByAnother_ShouldRollbackProperly.

@Test
public void scanAll_ScanAllGivenForDeletedWhenCoordinatorStateAbortedAndRolledBackByAnother_ShouldRollbackProperly() throws ExecutionException, CoordinatorException, CrudException {
    ScanAll scanAll = prepareScanAll(namespace1, TABLE_1);
    selection_SelectionGivenForDeletedWhenCoordinatorStateAbortedAndRolledBackByAnother_ShouldRollbackProperly(scanAll);
}
Also used : ScanAll(com.scalar.db.api.ScanAll) Test(org.junit.jupiter.api.Test)

Example 42 with ScanAll

use of com.scalar.db.api.ScanAll in project scalardb by scalar-labs.

the class ConsensusCommitSpecificIntegrationTestBase method scanAll_ScanAllGivenForPreparedWhenCoordinatorStateAborted_ShouldRollback.

@Test
public void scanAll_ScanAllGivenForPreparedWhenCoordinatorStateAborted_ShouldRollback() throws CrudException, ExecutionException, CoordinatorException {
    ScanAll scanAll = prepareScanAll(namespace1, TABLE_1);
    selection_SelectionGivenForPreparedWhenCoordinatorStateAborted_ShouldRollback(scanAll);
}
Also used : ScanAll(com.scalar.db.api.ScanAll) Test(org.junit.jupiter.api.Test)

Example 43 with ScanAll

use of com.scalar.db.api.ScanAll in project scalardb by scalar-labs.

the class ConsensusCommitSpecificIntegrationTestBase method scanAll_ScanAllGivenForDeletedWhenCoordinatorStateAborted_ShouldRollback.

@Test
public void scanAll_ScanAllGivenForDeletedWhenCoordinatorStateAborted_ShouldRollback() throws ExecutionException, CoordinatorException, CrudException {
    ScanAll scanAll = prepareScanAll(namespace1, TABLE_1);
    selection_SelectionGivenForDeletedWhenCoordinatorStateAborted_ShouldRollback(scanAll);
}
Also used : ScanAll(com.scalar.db.api.ScanAll) Test(org.junit.jupiter.api.Test)

Example 44 with ScanAll

use of com.scalar.db.api.ScanAll in project scalardb by scalar-labs.

the class ConsensusCommitSpecificIntegrationTestBase method scanAll_NonOverlappingPutGivenBefore_ShouldScanAll.

@Test
public void scanAll_NonOverlappingPutGivenBefore_ShouldScanAll() throws CommitException, UnknownTransactionStatusException {
    // Arrange
    ConsensusCommit transaction = manager.start();
    transaction.put(preparePut(0, 0, namespace1, TABLE_1).withIntValue(BALANCE, 1));
    // Act
    ScanAll scanAll = prepareScanAll(namespace2, TABLE_2);
    Throwable thrown = catchThrowable(() -> transaction.scan(scanAll));
    transaction.commit();
    // Assert
    assertThat(thrown).doesNotThrowAnyException();
}
Also used : Assertions.catchThrowable(org.assertj.core.api.Assertions.catchThrowable) ScanAll(com.scalar.db.api.ScanAll) Test(org.junit.jupiter.api.Test)

Example 45 with ScanAll

use of com.scalar.db.api.ScanAll in project scalardb by scalar-labs.

the class ConsensusCommitSpecificIntegrationTestBase method scanAll_ScanAllGivenForDeletedWhenCoordinatorStateCommittedAndRolledForwardByAnother_ShouldRollforwardProperly.

@Test
public void scanAll_ScanAllGivenForDeletedWhenCoordinatorStateCommittedAndRolledForwardByAnother_ShouldRollforwardProperly() throws ExecutionException, CoordinatorException, CrudException {
    ScanAll scanAll = prepareScanAll(namespace1, TABLE_1);
    selection_SelectionGivenForDeletedWhenCoordinatorStateCommittedAndRolledForwardByAnother_ShouldRollforwardProperly(scanAll);
}
Also used : ScanAll(com.scalar.db.api.ScanAll) Test(org.junit.jupiter.api.Test)

Aggregations

ScanAll (com.scalar.db.api.ScanAll)52 Test (org.junit.jupiter.api.Test)43 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)10 Result (com.scalar.db.api.Result)9 CosmosQueryRequestOptions (com.azure.cosmos.models.CosmosQueryRequestOptions)8 Put (com.scalar.db.api.Put)4 HashMap (java.util.HashMap)4 Scan (com.scalar.db.api.Scan)3 TableMetadata (com.scalar.db.api.TableMetadata)3 Key (com.scalar.db.io.Key)3 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)3 Assertions.catchThrowable (org.assertj.core.api.Assertions.catchThrowable)3 ScanRequest (software.amazon.awssdk.services.dynamodb.model.ScanRequest)3 SelectQuery (com.scalar.db.storage.jdbc.query.SelectQuery)2 PreparedStatement (java.sql.PreparedStatement)2 ResultSet (java.sql.ResultSet)2 List (java.util.List)2 Nonnull (javax.annotation.Nonnull)2 ResultSet (com.datastax.driver.core.ResultSet)1 Select (com.datastax.driver.core.querybuilder.Select)1