diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f48f76182500292899e08819aed3d47b77f8aab7..4442e66dcf1fbf5c832a33d352cfc75204d5a589 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -32,7 +32,7 @@ set(test_cases test_transaction test_utility test_value - test_ccaosdb + test_clinkahead ) IF(BUILD_ACM) diff --git a/test/test_clinkahead.cpp b/test/test_clinkahead.cpp index 4ba352d0bf37084c0ce750a58f069f3114827755..ef6c06459d92c9552c8b37f10984d459c7a4593c 100644 --- a/test/test_clinkahead.cpp +++ b/test/test_clinkahead.cpp @@ -32,7 +32,7 @@ #include <gtest/gtest_pred_impl.h> // for Test, TestInfo, EXPECT_EQ, TEST #include <string> // for allocator, operator+, string,... -class test_ccaosdb : public ::testing::Test { +class test_clinkahead : public ::testing::Test { protected: void SetUp() override { linkahead::configuration::ConfigurationManager::Clear(); @@ -43,32 +43,32 @@ protected: void TearDown() override { linkahead::configuration::ConfigurationManager::Clear(); } }; -TEST_F(test_ccaosdb, test_get_env_fallback) { +TEST_F(test_clinkahead, test_get_env_fallback) { const char *const some_var = linkahead_utility_get_env_fallback("SOME_ENV_VAR", "fall-back"); EXPECT_EQ("fall-back", some_var); } -TEST_F(test_ccaosdb, test_other_client_error) { +TEST_F(test_clinkahead, test_other_client_error) { EXPECT_EQ(linkahead_status_code_OTHER_CLIENT_ERROR(), linkahead::StatusCode::OTHER_CLIENT_ERROR); } -TEST_F(test_ccaosdb, test_get_default_connection) { +TEST_F(test_clinkahead, test_get_default_connection) { linkahead_connection_connection out; linkahead_connection_connection_manager_get_default_connection(&out); EXPECT_TRUE(out.wrapped_connection); } -TEST_F(test_ccaosdb, test_get_connection) { +TEST_F(test_clinkahead, test_get_connection) { linkahead_connection_connection out; - linkahead_connection_connection_manager_get_connection(&out, "local-caosdb-admin"); + linkahead_connection_connection_manager_get_connection(&out, "local-linkahead-admin"); EXPECT_TRUE(out.wrapped_connection); } -TEST_F(test_ccaosdb, test_execute_transaction) { +TEST_F(test_clinkahead, test_execute_transaction) { linkahead_connection_connection connection; - linkahead_connection_connection_manager_get_connection(&connection, "local-caosdb-admin"); + linkahead_connection_connection_manager_get_connection(&connection, "local-linkahead-admin"); linkahead_transaction_transaction transaction; linkahead_connection_connection_create_transaction(&connection, &transaction); @@ -97,9 +97,9 @@ TEST_F(test_ccaosdb, test_execute_transaction) { EXPECT_EQ(return_code, 0); } -TEST_F(test_ccaosdb, test_multi_retrieve) { +TEST_F(test_clinkahead, test_multi_retrieve) { linkahead_connection_connection connection; - linkahead_connection_connection_manager_get_connection(&connection, "local-caosdb-admin"); + linkahead_connection_connection_manager_get_connection(&connection, "local-linkahead-admin"); linkahead_transaction_transaction multi_transaction; linkahead_connection_connection_create_transaction(&connection, &multi_transaction); @@ -114,9 +114,9 @@ TEST_F(test_ccaosdb, test_multi_retrieve) { EXPECT_EQ(return_code, 0); } -TEST_F(test_ccaosdb, test_query) { +TEST_F(test_clinkahead, test_query) { linkahead_connection_connection connection; - linkahead_connection_connection_manager_get_connection(&connection, "local-caosdb-admin"); + linkahead_connection_connection_manager_get_connection(&connection, "local-linkahead-admin"); linkahead_transaction_transaction transaction; linkahead_connection_connection_create_transaction(&connection, &transaction); @@ -128,7 +128,7 @@ TEST_F(test_ccaosdb, test_query) { EXPECT_EQ(return_code, 0); } -TEST_F(test_ccaosdb, test_datatype) { +TEST_F(test_clinkahead, test_datatype) { linkahead_entity_datatype atomic; // check that this fails @@ -233,7 +233,7 @@ TEST_F(test_ccaosdb, test_datatype) { EXPECT_EQ(return_code, 0); } -TEST_F(test_ccaosdb, test_value) { +TEST_F(test_clinkahead, test_value) { linkahead_entity_value string_value; int return_code(linkahead_entity_create_string_value(&string_value, "value")); @@ -380,7 +380,7 @@ TEST_F(test_ccaosdb, test_value) { EXPECT_EQ(return_code, 0); } -TEST_F(test_ccaosdb, test_entity) { +TEST_F(test_clinkahead, test_entity) { linkahead_entity_entity entity; int return_code(linkahead_entity_create_entity(&entity)); @@ -518,7 +518,7 @@ TEST_F(test_ccaosdb, test_entity) { EXPECT_EQ(return_code, 0); } -TEST_F(test_ccaosdb, test_parent) { +TEST_F(test_clinkahead, test_parent) { linkahead_entity_parent parent; int return_code(linkahead_entity_create_parent(&parent)); @@ -538,7 +538,7 @@ TEST_F(test_ccaosdb, test_parent) { EXPECT_EQ(return_code, 0); } -TEST_F(test_ccaosdb, test_property) { +TEST_F(test_clinkahead, test_property) { linkahead_entity_property property; int return_code(linkahead_entity_create_property(&property)); @@ -602,7 +602,7 @@ TEST_F(test_ccaosdb, test_property) { EXPECT_EQ(return_code, 0); } -TEST_F(test_ccaosdb, test_string_list_property) { +TEST_F(test_clinkahead, test_string_list_property) { linkahead_entity_property property; int return_code(linkahead_entity_create_property(&property)); @@ -663,7 +663,7 @@ TEST_F(test_ccaosdb, test_string_list_property) { EXPECT_EQ(return_code, 0); } -TEST_F(test_ccaosdb, test_int_list_property) { +TEST_F(test_clinkahead, test_int_list_property) { linkahead_entity_property property; int return_code(linkahead_entity_create_property(&property)); @@ -723,7 +723,7 @@ TEST_F(test_ccaosdb, test_int_list_property) { EXPECT_EQ(return_code, 0); } -TEST_F(test_ccaosdb, test_bool_list_property) { +TEST_F(test_clinkahead, test_bool_list_property) { linkahead_entity_property property; int return_code(linkahead_entity_create_property(&property)); @@ -783,7 +783,7 @@ TEST_F(test_ccaosdb, test_bool_list_property) { EXPECT_EQ(return_code, 0); } -TEST_F(test_ccaosdb, test_entity_with_parent_and_property) { +TEST_F(test_clinkahead, test_entity_with_parent_and_property) { linkahead_entity_parent input_parent; int return_code(linkahead_entity_create_parent(&input_parent)); EXPECT_EQ(return_code, 0); @@ -909,7 +909,7 @@ TEST_F(test_ccaosdb, test_entity_with_parent_and_property) { EXPECT_EQ(return_code, 0); } -TEST_F(test_ccaosdb, test_remove_property) { +TEST_F(test_clinkahead, test_remove_property) { linkahead_entity_entity entity; int return_code(linkahead_entity_create_entity(&entity)); EXPECT_EQ(return_code, 0); @@ -972,7 +972,7 @@ TEST_F(test_ccaosdb, test_remove_property) { EXPECT_EQ(return_code, 0); } -TEST_F(test_ccaosdb, test_insert_update_delete) { +TEST_F(test_clinkahead, test_insert_update_delete) { // Only test adding to a transaction. Excution and results are // tested in integration tests. linkahead_connection_connection connection; diff --git a/test/test_configuration.cpp b/test/test_configuration.cpp index b4ffc90ccb3686981f2f23c35422c8e3e12b4f65..4ec7d8359fbe051ee24d72f371e2a394115c2d64 100644 --- a/test/test_configuration.cpp +++ b/test/test_configuration.cpp @@ -40,9 +40,9 @@ protected: }; TEST_F(test_configuration, load_json) { - ConfigurationManager::LoadSingleJSONConfiguration(TEST_DATA_DIR + "/test_caosdb_client.json"); + ConfigurationManager::LoadSingleJSONConfiguration(TEST_DATA_DIR + "/test_linkahead_client.json"); EXPECT_THROW_MESSAGE(ConfigurationManager::LoadSingleJSONConfiguration("anything"), - ConfigurationError, "This CaosDB client has already been configured."); + ConfigurationError, "This LinkAhead client has already been configured."); ConfigurationManager::Clear(); EXPECT_THROW_MESSAGE(ConfigurationManager::LoadSingleJSONConfiguration("anything"), @@ -52,24 +52,24 @@ TEST_F(test_configuration, load_json) { TEST_F(test_configuration, get_default_connection_configuration_error) { EXPECT_THROW_MESSAGE(ConfigurationManager::GetDefaultConnectionName(), ConfigurationError, - "This CaosDB client has not been configured."); + "This LinkAhead client has not been configured."); ConfigurationManager::LoadSingleJSONConfiguration( TEST_DATA_DIR + "/test_broken_caosdb_client_no_connections1.json"); EXPECT_THROW_MESSAGE(ConfigurationManager::GetDefaultConnectionName(), ConfigurationError, - "This CaosDB client hasn't any configured connections."); + "This LinkAhead client hasn't any configured connections."); ConfigurationManager::Clear(); ConfigurationManager::LoadSingleJSONConfiguration( TEST_DATA_DIR + "/test_broken_caosdb_client_no_connections2.json"); EXPECT_THROW_MESSAGE(ConfigurationManager::GetDefaultConnectionName(), ConfigurationError, - "This CaosDB client hasn't any configured connections."); + "This LinkAhead client hasn't any configured connections."); ConfigurationManager::Clear(); ConfigurationManager::LoadSingleJSONConfiguration( TEST_DATA_DIR + "/test_broken_caosdb_client_no_connections3.json"); EXPECT_THROW_MESSAGE(ConfigurationManager::GetDefaultConnectionName(), ConfigurationError, - "This CaosDB client hasn't any configured connections."); + "This LinkAhead client hasn't any configured connections."); ConfigurationManager::Clear(); } diff --git a/test/test_connection.cpp b/test/test_connection.cpp index ef9934c1e02d49c466f86859c9e9a3bf8e518196..18313be0ab038a0c7d73b60e4fade804f3eaf069 100644 --- a/test/test_connection.cpp +++ b/test/test_connection.cpp @@ -86,12 +86,12 @@ TEST_F(test_connection, connection_missing_certificate) { TEST_F(test_connection, connection_manager_get_default_connection) { auto connection = ConnectionManager::GetDefaultConnection(); - EXPECT_EQ(connection, ConnectionManager::GetConnection("local-caosdb")); + EXPECT_EQ(connection, ConnectionManager::GetConnection("local-linkahead")); } TEST_F(test_connection, connection_manager_get_connection) { - EXPECT_TRUE(ConnectionManager::GetConnection("local-caosdb-admin")); + EXPECT_TRUE(ConnectionManager::GetConnection("local-linkahead-admin")); } #ifdef BUILD_ACM diff --git a/test/test_data/test_broken_caosdb_client_certificate_file_non_existent.json b/test/test_data/test_broken_linkahead_client_certificate_file_non_existent.json similarity index 85% rename from test/test_data/test_broken_caosdb_client_certificate_file_non_existent.json rename to test/test_data/test_broken_linkahead_client_certificate_file_non_existent.json index 832b0a62b674af5500815ca1726ccddf9802d757..4415a62d15e3899cc20a219a51c298b62965661e 100644 --- a/test/test_data/test_broken_caosdb_client_certificate_file_non_existent.json +++ b/test/test_data/test_broken_linkahead_client_certificate_file_non_existent.json @@ -1,7 +1,7 @@ { "connections": { - "default": "local-caosdb", - "local-caosdb-admin": { + "default": "local-linkahead", + "local-linkahead-admin": { "host": "localhost", "port": 8443, "server_certificate_path": "some/path/cacert.pem", @@ -11,7 +11,7 @@ "password": "caosdb" } }, - "local-caosdb": { + "local-linkahead": { "host": "localhost", "port": 8443, "server_certificate_path": "some/path/cacert.pem", diff --git a/test/test_data/test_broken_caosdb_client_no_connections1.json b/test/test_data/test_broken_linkahead_client_no_connections1.json similarity index 100% rename from test/test_data/test_broken_caosdb_client_no_connections1.json rename to test/test_data/test_broken_linkahead_client_no_connections1.json diff --git a/test/test_data/test_broken_caosdb_client_no_connections2.json b/test/test_data/test_broken_linkahead_client_no_connections2.json similarity index 100% rename from test/test_data/test_broken_caosdb_client_no_connections2.json rename to test/test_data/test_broken_linkahead_client_no_connections2.json diff --git a/test/test_data/test_broken_caosdb_client_no_connections3.json b/test/test_data/test_broken_linkahead_client_no_connections3.json similarity index 100% rename from test/test_data/test_broken_caosdb_client_no_connections3.json rename to test/test_data/test_broken_linkahead_client_no_connections3.json diff --git a/test/test_data/test_linkahead.json b/test/test_data/test_linkahead.json new file mode 100644 index 0000000000000000000000000000000000000000..11cd2d4ba8c77a8241accb001a9317d1834f1ce6 --- /dev/null +++ b/test/test_data/test_linkahead.json @@ -0,0 +1,50 @@ +{ + "connections": { + "default": "local-linkahead", + "local-linkahead-admin": { + "host": "localhost", + "port": 8443, + "authentication": { + "type": "plain", + "username": "admin", + "password": "caosdb" + } + }, + "local-linkahead": { + "host": "localhost", + "port": 8443, + "authentication": { + "type": "plain", + "username": "me", + "password": "secret!" + } + }, + "missing": { + "host": "localhost", + "port": 8443, + "server_certificate_path": "/missing", + "authentication": { + "type": "plain", + "username": "me", + "password": "secret!" + } + } + }, + "logging": { + "level": "info", + "sinks": { + "stderr": { + "destination": "console" + }, + "file" : { + "destination": "file" + }, + "syslog": { + "destination": "syslog" + } + } + }, + "extension": { + "this is my": "special option" + } +} diff --git a/test/test_protobuf.cpp b/test/test_protobuf.cpp index adfd5e531587958b0fbab1215d86742138bfcfb1..21f67787ecc303545972616a71affbe4a13f085c 100644 --- a/test/test_protobuf.cpp +++ b/test/test_protobuf.cpp @@ -29,7 +29,7 @@ #include <gtest/gtest_pred_impl.h> // for Test, TestInfo, TEST #include <memory> // for allocator -namespace caosdb { +namespace linkahead { using ProtoEntity = caosdb::entity::v1::Entity; using caosdb::entity::v1::Message; using google::protobuf::Arena; @@ -114,4 +114,4 @@ TEST(test_protobuf, test_copy_nested) { EXPECT_EQ(copy_entity.GetDataType().GetAsReference().GetName(), "src_per"); } -} // namespace caosdb +} // namespace linkahead diff --git a/test_package/conanfile.py b/test_package/conanfile.py index 8915ddcdaff5c67d757be9424a2cbf5dada79844..ba47c9d8103470900a1fbe216cd0a1de4703b8a2 100644 --- a/test_package/conanfile.py +++ b/test_package/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.files import copy from conan.tools.build import cross_building -class LibcaosdbTestConan(ConanFile): +class LiblinkaheadTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" def requirements(self):