|
Database System 0.1.0
Advanced C++20 Database System with Multi-Backend Support
|
#include <gtest/gtest.h>#include <atomic>#include <chrono>#include <future>#include <string>#include <thread>#include <vector>#include "database/async/async_operations.h"#include "database/core/database_backend.h"
Go to the source code of this file.
Classes | |
| class | AsyncResultTest |
| class | AsyncExecutorTest |
| class | AsyncDatabaseTest |
| class | TransactionCoordinatorTest |
| class | SagaBuilderTest |
| class | StreamProcessorTest |
Functions | |
| TEST_F (AsyncResultTest, ConstructsFromFuture) | |
| TEST_F (AsyncResultTest, GetReturnsValue) | |
| TEST_F (AsyncResultTest, GetReturnsStringValue) | |
| TEST_F (AsyncResultTest, GetRethrowsException) | |
| TEST_F (AsyncResultTest, GetInvokesSuccessCallback) | |
| TEST_F (AsyncResultTest, GetInvokesErrorCallback) | |
| TEST_F (AsyncResultTest, GetForReturnsValueWithinTimeout) | |
| TEST_F (AsyncResultTest, GetForThrowsOnTimeout) | |
| TEST_F (AsyncResultTest, IsReadyReturnsFalseBeforeCompletion) | |
| TEST_F (AsyncResultTest, IsReadyReturnsTrueWhenReady) | |
| TEST_F (AsyncResultTest, WaitForReturnsReadyWhenComplete) | |
| TEST_F (AsyncResultTest, WaitForReturnsTimeoutWhenNotReady) | |
| TEST_F (AsyncResultTest, ThenWithLambda) | |
| TEST_F (AsyncResultTest, OnErrorWithLambda) | |
| TEST_F (AsyncResultTest, ThenLegacyOverload) | |
| TEST_F (AsyncResultTest, OnErrorLegacyOverload) | |
| TEST_F (AsyncResultTest, NoCallbackDoesNotCrashOnSuccess) | |
| TEST_F (AsyncResultTest, NoErrorCallbackDoesNotCrashOnFailure) | |
| TEST_F (AsyncResultTest, GetBlocksUntilValueAvailable) | |
| TEST_F (AsyncExecutorTest, ConstructsWithCustomThreadCount) | |
| TEST_F (AsyncExecutorTest, ConstructsWithDefaultThreadCount) | |
| TEST_F (AsyncExecutorTest, IsNotUsingThreadSystem) | |
| TEST_F (AsyncExecutorTest, SubmitExecutesCallable) | |
| TEST_F (AsyncExecutorTest, SubmitWithArguments) | |
| TEST_F (AsyncExecutorTest, SubmitReturnsString) | |
| TEST_F (AsyncExecutorTest, SubmitPropagatesException) | |
| TEST_F (AsyncExecutorTest, MultipleConcurrentSubmissions) | |
| TEST_F (AsyncExecutorTest, WaitForCompletionBlocksUntilDone) | |
| TEST_F (AsyncExecutorTest, ShutdownAfterSubmitCompletesGracefully) | |
| TEST_F (AsyncExecutorTest, SubmitAfterShutdownThrows) | |
| TEST_F (AsyncExecutorTest, ThreadCountReturnsConfigured) | |
| TEST (AsyncHelpersTest, MakeReadyResultIsImmediatelyAvailable) | |
| TEST (AsyncHelpersTest, MakeReadyResultWithString) | |
| TEST (AsyncHelpersTest, MakeErrorResultThrowsOnGet) | |
| TEST (AsyncHelpersTest, MakeErrorResultInvokesOnErrorCallback) | |
| TEST_F (AsyncDatabaseTest, ConstructsWithBackendAndExecutor) | |
| TEST_F (AsyncDatabaseTest, ExecuteAsyncReturnsTrue) | |
| TEST_F (AsyncDatabaseTest, ExecuteAsyncDelegatesToBackend) | |
| TEST_F (AsyncDatabaseTest, ExecuteAsyncThrowsOnBackendFailure) | |
| TEST_F (AsyncDatabaseTest, SelectAsyncReturnsRows) | |
| TEST_F (AsyncDatabaseTest, ExecuteBatchAsyncProcessesAllQueries) | |
| TEST_F (AsyncDatabaseTest, ExecuteBatchAsyncReportsFailures) | |
| TEST_F (AsyncDatabaseTest, SelectBatchAsyncReturnsMultipleResults) | |
| TEST_F (AsyncDatabaseTest, BeginTransactionAsyncSucceeds) | |
| TEST_F (AsyncDatabaseTest, CommitTransactionAsyncSucceeds) | |
| TEST_F (AsyncDatabaseTest, RollbackTransactionAsyncSucceeds) | |
| TEST_F (AsyncDatabaseTest, ConnectAsyncInitializesBackend) | |
| TEST_F (AsyncDatabaseTest, DisconnectAsyncShutsDownBackend) | |
| TEST_F (AsyncDatabaseTest, ConcurrentExecuteAsyncOperations) | |
| TEST_F (AsyncDatabaseTest, ExecuteAsyncWithThenCallback) | |
| TEST_F (AsyncDatabaseTest, ExecuteAsyncWithOnErrorCallback) | |
| TEST_F (TransactionCoordinatorTest, BeginCreatesTransaction) | |
| TEST_F (TransactionCoordinatorTest, BeginGeneratesUniqueIds) | |
| TEST_F (TransactionCoordinatorTest, PreparePhaseSuccess) | |
| TEST_F (TransactionCoordinatorTest, PreparePhaseThrowsForUnknownTransaction) | |
| TEST_F (TransactionCoordinatorTest, PreparePhaseRollsBackOnPartialFailure) | |
| TEST_F (TransactionCoordinatorTest, CommitPhaseSuccess) | |
| TEST_F (TransactionCoordinatorTest, CommitPhaseFailsIfNotPrepared) | |
| TEST_F (TransactionCoordinatorTest, CommitDistributedTransactionFull2PC) | |
| TEST_F (TransactionCoordinatorTest, CommitDistributedTransactionFailsOnPrepare) | |
| TEST_F (TransactionCoordinatorTest, RollbackDistributedTransaction) | |
| TEST_F (TransactionCoordinatorTest, RollbackThrowsForUnknownTransaction) | |
| TEST_F (TransactionCoordinatorTest, RecoverCleansUpCompletedTransactions) | |
| TEST_F (TransactionCoordinatorTest, CreateSagaReturnsSagaBuilder) | |
| TEST_F (SagaBuilderTest, EmptySagaSucceeds) | |
| TEST_F (SagaBuilderTest, AllStepsSucceed) | |
| TEST_F (SagaBuilderTest, CompensatesOnActionFailure) | |
| TEST_F (SagaBuilderTest, CompensatesOnException) | |
| TEST_F (SagaBuilderTest, SingleStepSuccess) | |
| TEST_F (SagaBuilderTest, CompensationExceptionDoesNotBreakChain) | |
| TEST_F (SagaBuilderTest, AddStepReturnsSelfForChaining) | |
| TEST_F (StreamProcessorTest, ConstructsWithBackend) | |
| TEST_F (StreamProcessorTest, StartStreamReturnsTrue) | |
| TEST_F (StreamProcessorTest, StartStreamDuplicateReturnsFalse) | |
| TEST_F (StreamProcessorTest, StopStreamReturnsTrue) | |
| TEST_F (StreamProcessorTest, StopStreamNonExistentReturnsFalse) | |
| TEST_F (StreamProcessorTest, StopAllStreamsStopsMultiple) | |
| TEST_F (StreamProcessorTest, EventHandlerReceivesConnectedEvent) | |
| TEST_F (StreamProcessorTest, EventHandlerReceivesCorrectChannel) | |
| TEST_F (StreamProcessorTest, EventHandlerReceivesCorrectType) | |
| TEST_F (StreamProcessorTest, GlobalHandlerReceivesAllEvents) | |
| TEST_F (StreamProcessorTest, EventFilterRejectsEvent) | |
| TEST_F (StreamProcessorTest, EventFilterAcceptsEvent) | |
| TEST_F (StreamProcessorTest, FilterDoesNotAffectGlobalHandler) | |
| TEST_F (StreamProcessorTest, StopOneStreamDoesNotAffectOthers) | |
| TEST_F (StreamProcessorTest, DestructorStopsAllStreams) | |
| TEST_F (StreamProcessorTest, TemplateEventHandlerWithLambda) | |
| TEST_F (StreamProcessorTest, TemplateGlobalHandlerWithLambda) | |
| TEST_F (StreamProcessorTest, TemplateEventFilterWithLambda) | |
| TEST | ( | AsyncHelpersTest | , |
| MakeErrorResultInvokesOnErrorCallback | ) |
Definition at line 378 of file test_async_operations.cpp.
References database::async::make_error_result().

| TEST | ( | AsyncHelpersTest | , |
| MakeErrorResultThrowsOnGet | ) |
Definition at line 369 of file test_async_operations.cpp.
References database::async::make_error_result().

| TEST | ( | AsyncHelpersTest | , |
| MakeReadyResultIsImmediatelyAvailable | ) |
Definition at line 357 of file test_async_operations.cpp.
References database::async::make_ready_result().

| TEST | ( | AsyncHelpersTest | , |
| MakeReadyResultWithString | ) |
Definition at line 363 of file test_async_operations.cpp.
References database::async::make_ready_result().

| TEST_F | ( | AsyncDatabaseTest | , |
| BeginTransactionAsyncSucceeds | ) |
Definition at line 596 of file test_async_operations.cpp.
| TEST_F | ( | AsyncDatabaseTest | , |
| CommitTransactionAsyncSucceeds | ) |
Definition at line 602 of file test_async_operations.cpp.
| TEST_F | ( | AsyncDatabaseTest | , |
| ConcurrentExecuteAsyncOperations | ) |
Definition at line 633 of file test_async_operations.cpp.
| TEST_F | ( | AsyncDatabaseTest | , |
| ConnectAsyncInitializesBackend | ) |
Definition at line 618 of file test_async_operations.cpp.
| TEST_F | ( | AsyncDatabaseTest | , |
| ConstructsWithBackendAndExecutor | ) |
Definition at line 519 of file test_async_operations.cpp.
| TEST_F | ( | AsyncDatabaseTest | , |
| DisconnectAsyncShutsDownBackend | ) |
Definition at line 624 of file test_async_operations.cpp.
| TEST_F | ( | AsyncDatabaseTest | , |
| ExecuteAsyncDelegatesToBackend | ) |
Definition at line 530 of file test_async_operations.cpp.
| TEST_F | ( | AsyncDatabaseTest | , |
| ExecuteAsyncReturnsTrue | ) |
Definition at line 525 of file test_async_operations.cpp.
| TEST_F | ( | AsyncDatabaseTest | , |
| ExecuteAsyncThrowsOnBackendFailure | ) |
Definition at line 536 of file test_async_operations.cpp.
| TEST_F | ( | AsyncDatabaseTest | , |
| ExecuteAsyncWithOnErrorCallback | ) |
Definition at line 673 of file test_async_operations.cpp.
| TEST_F | ( | AsyncDatabaseTest | , |
| ExecuteAsyncWithThenCallback | ) |
Definition at line 660 of file test_async_operations.cpp.
| TEST_F | ( | AsyncDatabaseTest | , |
| ExecuteBatchAsyncProcessesAllQueries | ) |
Definition at line 553 of file test_async_operations.cpp.
References ASSERT_EQ.
| TEST_F | ( | AsyncDatabaseTest | , |
| ExecuteBatchAsyncReportsFailures | ) |
Definition at line 568 of file test_async_operations.cpp.
References ASSERT_EQ.
| TEST_F | ( | AsyncDatabaseTest | , |
| RollbackTransactionAsyncSucceeds | ) |
Definition at line 609 of file test_async_operations.cpp.
| TEST_F | ( | AsyncDatabaseTest | , |
| SelectAsyncReturnsRows | ) |
Definition at line 544 of file test_async_operations.cpp.
References ASSERT_EQ.
| TEST_F | ( | AsyncDatabaseTest | , |
| SelectBatchAsyncReturnsMultipleResults | ) |
Definition at line 581 of file test_async_operations.cpp.
References ASSERT_EQ.
| TEST_F | ( | AsyncExecutorTest | , |
| ConstructsWithCustomThreadCount | ) |
Definition at line 255 of file test_async_operations.cpp.
| TEST_F | ( | AsyncExecutorTest | , |
| ConstructsWithDefaultThreadCount | ) |
Definition at line 259 of file test_async_operations.cpp.
| TEST_F | ( | AsyncExecutorTest | , |
| IsNotUsingThreadSystem | ) |
Definition at line 265 of file test_async_operations.cpp.
| TEST_F | ( | AsyncExecutorTest | , |
| MultipleConcurrentSubmissions | ) |
Definition at line 297 of file test_async_operations.cpp.
| TEST_F | ( | AsyncExecutorTest | , |
| ShutdownAfterSubmitCompletesGracefully | ) |
Definition at line 332 of file test_async_operations.cpp.
| TEST_F | ( | AsyncExecutorTest | , |
| SubmitAfterShutdownThrows | ) |
Definition at line 338 of file test_async_operations.cpp.
| TEST_F | ( | AsyncExecutorTest | , |
| SubmitExecutesCallable | ) |
Definition at line 271 of file test_async_operations.cpp.
| TEST_F | ( | AsyncExecutorTest | , |
| SubmitPropagatesException | ) |
Definition at line 288 of file test_async_operations.cpp.
| TEST_F | ( | AsyncExecutorTest | , |
| SubmitReturnsString | ) |
Definition at line 281 of file test_async_operations.cpp.
| TEST_F | ( | AsyncExecutorTest | , |
| SubmitWithArguments | ) |
Definition at line 276 of file test_async_operations.cpp.
| TEST_F | ( | AsyncExecutorTest | , |
| ThreadCountReturnsConfigured | ) |
Definition at line 347 of file test_async_operations.cpp.
References database::async::async_executor::shutdown(), and database::async::async_executor::thread_count().

| TEST_F | ( | AsyncExecutorTest | , |
| WaitForCompletionBlocksUntilDone | ) |
Definition at line 313 of file test_async_operations.cpp.
| TEST_F | ( | AsyncResultTest | , |
| ConstructsFromFuture | ) |
Definition at line 60 of file test_async_operations.cpp.
References database::async::async_result< T >::is_ready().

| TEST_F | ( | AsyncResultTest | , |
| GetBlocksUntilValueAvailable | ) |
Definition at line 221 of file test_async_operations.cpp.
References database::async::async_result< T >::get().

| TEST_F | ( | AsyncResultTest | , |
| GetForReturnsValueWithinTimeout | ) |
Definition at line 110 of file test_async_operations.cpp.
| TEST_F | ( | AsyncResultTest | , |
| GetForThrowsOnTimeout | ) |
Definition at line 115 of file test_async_operations.cpp.
References database::async::async_result< T >::get_for().

| TEST_F | ( | AsyncResultTest | , |
| GetInvokesErrorCallback | ) |
Definition at line 96 of file test_async_operations.cpp.
| TEST_F | ( | AsyncResultTest | , |
| GetInvokesSuccessCallback | ) |
Definition at line 86 of file test_async_operations.cpp.
| TEST_F | ( | AsyncResultTest | , |
| GetRethrowsException | ) |
Definition at line 81 of file test_async_operations.cpp.
| TEST_F | ( | AsyncResultTest | , |
| GetReturnsStringValue | ) |
Definition at line 76 of file test_async_operations.cpp.
| TEST_F | ( | AsyncResultTest | , |
| GetReturnsValue | ) |
Definition at line 71 of file test_async_operations.cpp.
| TEST_F | ( | AsyncResultTest | , |
| IsReadyReturnsFalseBeforeCompletion | ) |
Definition at line 126 of file test_async_operations.cpp.
References database::async::async_result< T >::is_ready().

| TEST_F | ( | AsyncResultTest | , |
| IsReadyReturnsTrueWhenReady | ) |
Definition at line 135 of file test_async_operations.cpp.
| TEST_F | ( | AsyncResultTest | , |
| NoCallbackDoesNotCrashOnSuccess | ) |
Definition at line 209 of file test_async_operations.cpp.
| TEST_F | ( | AsyncResultTest | , |
| NoErrorCallbackDoesNotCrashOnFailure | ) |
Definition at line 214 of file test_async_operations.cpp.
| TEST_F | ( | AsyncResultTest | , |
| OnErrorLegacyOverload | ) |
Definition at line 195 of file test_async_operations.cpp.
| TEST_F | ( | AsyncResultTest | , |
| OnErrorWithLambda | ) |
Definition at line 170 of file test_async_operations.cpp.
| TEST_F | ( | AsyncResultTest | , |
| ThenLegacyOverload | ) |
Definition at line 184 of file test_async_operations.cpp.
| TEST_F | ( | AsyncResultTest | , |
| ThenWithLambda | ) |
Definition at line 160 of file test_async_operations.cpp.
| TEST_F | ( | AsyncResultTest | , |
| WaitForReturnsReadyWhenComplete | ) |
Definition at line 142 of file test_async_operations.cpp.
| TEST_F | ( | AsyncResultTest | , |
| WaitForReturnsTimeoutWhenNotReady | ) |
Definition at line 148 of file test_async_operations.cpp.
References database::async::async_result< T >::wait_for().

| TEST_F | ( | SagaBuilderTest | , |
| AddStepReturnsSelfForChaining | ) |
Definition at line 1145 of file test_async_operations.cpp.
References database::async::make_ready_result().

| TEST_F | ( | SagaBuilderTest | , |
| AllStepsSucceed | ) |
Definition at line 979 of file test_async_operations.cpp.
References database::async::make_ready_result().

| TEST_F | ( | SagaBuilderTest | , |
| CompensatesOnActionFailure | ) |
Definition at line 1017 of file test_async_operations.cpp.
References database::async::make_ready_result().

| TEST_F | ( | SagaBuilderTest | , |
| CompensatesOnException | ) |
Definition at line 1056 of file test_async_operations.cpp.
References database::async::make_ready_result().

| TEST_F | ( | SagaBuilderTest | , |
| CompensationExceptionDoesNotBreakChain | ) |
Definition at line 1105 of file test_async_operations.cpp.
References database::async::make_ready_result().

| TEST_F | ( | SagaBuilderTest | , |
| EmptySagaSucceeds | ) |
Definition at line 973 of file test_async_operations.cpp.
References database::async::transaction_coordinator::create_saga(), and database::async::saga_builder::execute().

| TEST_F | ( | SagaBuilderTest | , |
| SingleStepSuccess | ) |
Definition at line 1087 of file test_async_operations.cpp.
References database::async::make_ready_result().

| TEST_F | ( | StreamProcessorTest | , |
| ConstructsWithBackend | ) |
Definition at line 1197 of file test_async_operations.cpp.
| TEST_F | ( | StreamProcessorTest | , |
| DestructorStopsAllStreams | ) |
Definition at line 1433 of file test_async_operations.cpp.
References database::async::stream_processor::start_stream().

| TEST_F | ( | StreamProcessorTest | , |
| EventFilterAcceptsEvent | ) |
Definition at line 1355 of file test_async_operations.cpp.
References ASSERT_TRUE.
| TEST_F | ( | StreamProcessorTest | , |
| EventFilterRejectsEvent | ) |
Definition at line 1333 of file test_async_operations.cpp.
| TEST_F | ( | StreamProcessorTest | , |
| EventHandlerReceivesConnectedEvent | ) |
Definition at line 1246 of file test_async_operations.cpp.
References ASSERT_TRUE.
| TEST_F | ( | StreamProcessorTest | , |
| EventHandlerReceivesCorrectChannel | ) |
Definition at line 1269 of file test_async_operations.cpp.
References ASSERT_TRUE.
| TEST_F | ( | StreamProcessorTest | , |
| EventHandlerReceivesCorrectType | ) |
Definition at line 1292 of file test_async_operations.cpp.
References ASSERT_TRUE.
| TEST_F | ( | StreamProcessorTest | , |
| FilterDoesNotAffectGlobalHandler | ) |
Definition at line 1375 of file test_async_operations.cpp.
| TEST_F | ( | StreamProcessorTest | , |
| GlobalHandlerReceivesAllEvents | ) |
Definition at line 1313 of file test_async_operations.cpp.
References ASSERT_TRUE.
| TEST_F | ( | StreamProcessorTest | , |
| StartStreamDuplicateReturnsFalse | ) |
Definition at line 1209 of file test_async_operations.cpp.
| TEST_F | ( | StreamProcessorTest | , |
| StartStreamReturnsTrue | ) |
Definition at line 1203 of file test_async_operations.cpp.
| TEST_F | ( | StreamProcessorTest | , |
| StopAllStreamsStopsMultiple | ) |
Definition at line 1227 of file test_async_operations.cpp.
| TEST_F | ( | StreamProcessorTest | , |
| StopOneStreamDoesNotAffectOthers | ) |
Definition at line 1399 of file test_async_operations.cpp.
References ASSERT_TRUE.
| TEST_F | ( | StreamProcessorTest | , |
| StopStreamNonExistentReturnsFalse | ) |
Definition at line 1223 of file test_async_operations.cpp.
| TEST_F | ( | StreamProcessorTest | , |
| StopStreamReturnsTrue | ) |
Definition at line 1217 of file test_async_operations.cpp.
| TEST_F | ( | StreamProcessorTest | , |
| TemplateEventFilterWithLambda | ) |
Definition at line 1479 of file test_async_operations.cpp.
References ASSERT_TRUE.
| TEST_F | ( | StreamProcessorTest | , |
| TemplateEventHandlerWithLambda | ) |
Definition at line 1448 of file test_async_operations.cpp.
References ASSERT_TRUE.
| TEST_F | ( | StreamProcessorTest | , |
| TemplateGlobalHandlerWithLambda | ) |
Definition at line 1464 of file test_async_operations.cpp.
References ASSERT_TRUE.
| TEST_F | ( | TransactionCoordinatorTest | , |
| BeginCreatesTransaction | ) |
Definition at line 812 of file test_async_operations.cpp.
References ASSERT_EQ.
| TEST_F | ( | TransactionCoordinatorTest | , |
| BeginGeneratesUniqueIds | ) |
Definition at line 823 of file test_async_operations.cpp.
| TEST_F | ( | TransactionCoordinatorTest | , |
| CommitDistributedTransactionFailsOnPrepare | ) |
Definition at line 904 of file test_async_operations.cpp.
| TEST_F | ( | TransactionCoordinatorTest | , |
| CommitDistributedTransactionFull2PC | ) |
Definition at line 893 of file test_async_operations.cpp.
| TEST_F | ( | TransactionCoordinatorTest | , |
| CommitPhaseFailsIfNotPrepared | ) |
Definition at line 883 of file test_async_operations.cpp.
| TEST_F | ( | TransactionCoordinatorTest | , |
| CommitPhaseSuccess | ) |
Definition at line 868 of file test_async_operations.cpp.
| TEST_F | ( | TransactionCoordinatorTest | , |
| CreateSagaReturnsSagaBuilder | ) |
Definition at line 957 of file test_async_operations.cpp.
| TEST_F | ( | TransactionCoordinatorTest | , |
| PreparePhaseRollsBackOnPartialFailure | ) |
Definition at line 849 of file test_async_operations.cpp.
References ASSERT_EQ.
| TEST_F | ( | TransactionCoordinatorTest | , |
| PreparePhaseSuccess | ) |
Definition at line 832 of file test_async_operations.cpp.
References ASSERT_EQ.
| TEST_F | ( | TransactionCoordinatorTest | , |
| PreparePhaseThrowsForUnknownTransaction | ) |
Definition at line 845 of file test_async_operations.cpp.
| TEST_F | ( | TransactionCoordinatorTest | , |
| RecoverCleansUpCompletedTransactions | ) |
Definition at line 941 of file test_async_operations.cpp.
References ASSERT_EQ.
| TEST_F | ( | TransactionCoordinatorTest | , |
| RollbackDistributedTransaction | ) |
Definition at line 918 of file test_async_operations.cpp.
| TEST_F | ( | TransactionCoordinatorTest | , |
| RollbackThrowsForUnknownTransaction | ) |
Definition at line 933 of file test_async_operations.cpp.