|
RTC Toolkit 6.0.0
|
Provides an in-memory OLDB for unit testing. More...
Files | |
| file | inMemoryOldb.hpp |
| Header file with support routines for preparing an in-memory OLDB instance for testing. | |
| file | inMemoryOldb.cpp |
| Implementation of support functions to provide an in-memory OLDB for testing. | |
Functions | |
| OldbCreationResult | rtctk::componentFramework::test::CreateInMemoryOldbWithExtRedis () |
| This function prepares an in-memory OLDB with fake external Redis providers for unit testing. | |
| std::shared_ptr< elt::oldb::CiiOldb > | rtctk::componentFramework::test::CreateInMemoryOldb () |
| This function prepares an in-memory OLDB that is suitable for unit testing. | |
| void | rtctk::componentFramework::test::DeleteAllConfigDataPoints (const std::string &target_config_storage=elt::oldb::CiiOldbGlobal::CONFIG_STORAGE_CACHE) |
| Deletes all configuration datapoints in the CII configuration service. | |
Provides an in-memory OLDB for unit testing.
The primary purpose of this library is to allow testing the OldbAdapter. The in-memory OLD has been placed into its own library with no dependencies on other RTC Toolkit code to avoid dependency cycles between the library that provides the OldbAdapter and the corresponding test support library for OldbIf.
| std::shared_ptr< elt::oldb::CiiOldb > rtctk::componentFramework::test::CreateInMemoryOldb | ( | ) |
This function prepares an in-memory OLDB that is suitable for unit testing.
The in-memory OLDB is a fake, but should reproduce most OLDB behaviour as expected by the OldbAdapter and RuntimeRepoAdapter.
| OldbCreationResult rtctk::componentFramework::test::CreateInMemoryOldbWithExtRedis | ( | ) |
This function prepares an in-memory OLDB with fake external Redis providers for unit testing.
The created in-memory OLDB will contain two additional fake external Redis providers that should reproduce most of the OLDB external Redis behaviour as expected by the RuntimeRepoAdapter.
The result of this method will contain two pointers to mock interfaces for the external Redis backend. These can be used to check that the correct external Redis was called. See the following code for example:
std::make_tuple(oldb, ext_redis_1, ext_redis_2). | void rtctk::componentFramework::test::DeleteAllConfigDataPoints | ( | const std::string & | target_config_storage = elt::oldb::CiiOldbGlobal::CONFIG_STORAGE_CACHE | ) |
Deletes all configuration datapoints in the CII configuration service.
The function will recursively go through the entire configuration datapoint hierarchy in the CII configuration service and deletes all datapoints.
| [in] | target_config_storage | The target configuration to clear. By default this is the in-memory "cache" storage. |