use of com.scalar.db.api.ScanAll in project scalardb by scalar-labs.
the class ConsensusCommitSpecificIntegrationTestBase method scanAll_ScanAllGivenForPreparedWhenCoordinatorStateAbortedAndRolledBackByAnother_ShouldRollbackProperly.
@Test
public void scanAll_ScanAllGivenForPreparedWhenCoordinatorStateAbortedAndRolledBackByAnother_ShouldRollbackProperly() throws ExecutionException, CoordinatorException, CrudException {
ScanAll scanAll = prepareScanAll(namespace1, TABLE_1);
selection_SelectionGivenForPreparedWhenCoordinatorStateAbortedAndRolledBackByAnother_ShouldRollbackProperly(scanAll);
}
use of com.scalar.db.api.ScanAll in project scalardb by scalar-labs.
the class ConsensusCommitSpecificIntegrationTestBase method scanAll_ScanAllGivenForPreparedWhenCoordinatorStateCommittedAndRolledForwardByAnother_ShouldRollforwardProperly.
@Test
public void scanAll_ScanAllGivenForPreparedWhenCoordinatorStateCommittedAndRolledForwardByAnother_ShouldRollforwardProperly() throws ExecutionException, CoordinatorException, CrudException {
ScanAll scanAll = prepareScanAll(namespace1, TABLE_1);
selection_SelectionGivenForPreparedWhenCoordinatorStateCommittedAndRolledForwardByAnother_ShouldRollforwardProperly(scanAll);
}
use of com.scalar.db.api.ScanAll in project scalardb by scalar-labs.
the class ConsensusCommitSpecificIntegrationTestBase method scanAll_ScanAllGivenForDeletedWhenCoordinatorStateNotExistAndNotExpired_ShouldNotAbortTransaction.
@Test
public void scanAll_ScanAllGivenForDeletedWhenCoordinatorStateNotExistAndNotExpired_ShouldNotAbortTransaction() throws ExecutionException, CoordinatorException {
ScanAll scanAll = prepareScanAll(namespace1, TABLE_1);
selection_SelectionGivenForDeletedWhenCoordinatorStateNotExistAndNotExpired_ShouldNotAbortTransaction(scanAll);
}
use of com.scalar.db.api.ScanAll in project scalardb by scalar-labs.
the class TwoPhaseConsensusCommitSpecificIntegrationTestBase method scanAll_ScanAllGivenForNonExisting_ShouldReturnEmpty.
@Test
public void scanAll_ScanAllGivenForNonExisting_ShouldReturnEmpty() throws CrudException, CommitException, UnknownTransactionStatusException, PreparationException {
// Arrange
TwoPhaseConsensusCommit putTransaction = manager.start();
putTransaction.put(preparePut(0, 0, TABLE_1));
putTransaction.prepare();
putTransaction.commit();
TwoPhaseConsensusCommit transaction = manager.start();
ScanAll scanAll = new ScanAll().forNamespace(namespace).forTable(TABLE_2).withConsistency(Consistency.LINEARIZABLE);
// Act
List<Result> results = transaction.scan(scanAll);
// Assert
assertThat(results.size()).isEqualTo(0);
}
use of com.scalar.db.api.ScanAll in project scalardb by scalar-labs.
the class TwoPhaseConsensusCommitSpecificIntegrationTestBase method scanAll_ScanAllGivenForCommittedRecord_ShouldReturnRecord.
@Test
public void scanAll_ScanAllGivenForCommittedRecord_ShouldReturnRecord() throws TransactionException {
// Arrange
populate(TABLE_1);
TwoPhaseConsensusCommit transaction = manager.start();
ScanAll scanAll = prepareScanAll(TABLE_1).withLimit(1);
// Act
List<Result> results = transaction.scan(scanAll);
// Assert
assertThat(results.size()).isEqualTo(1);
Assertions.assertThat(((TransactionResult) ((FilteredResult) results.get(0)).getOriginalResult()).getState()).isEqualTo(TransactionState.COMMITTED);
}
Aggregations