Skip to content
Snippets Groups Projects

F files

Merged Henrik tom Wörden requested to merge f-files into main
2 files
+ 4
3
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 16
16
@@ -28,9 +28,9 @@
#include "caosdb/info.h" // for VersionInfo
#include "caosdb/utility.h" // for get_env_var
#include "caosdb_test_utility.h" // for EXPECT_THROW_MESSAGE
#include <gtest/gtest-message.h> // for Message
#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestPartR...
#include "gtest/gtest_pred_impl.h" // for Test, TestInfo, TEST, EXPEC...
#include <gtest/gtest-message.h> // NOLINT TODO ?? for Message
#include <gtest/gtest-test-part.h> // NOLINT for SuiteApiResolver, TestPartR...
#include "gtest/gtest_pred_impl.h" // NOLINT for Test, TestInfo, TEST, EXPEC...
#include <memory> // for allocator, unique_ptr, __sh...
#include <string> // for stoi, string
@@ -62,10 +62,10 @@ TEST(test_connection, connect_somehost_42347_fails) {
TEST(test_connection, connection_insecure_authentication_error_anonymous) {
const auto *port_str =
caosdb::utility::get_env_var("CAOSDB_SERVER_GRPC_PORT_HTTP", "8080");
caosdb::utility::get_env_var("CAOSDB_SERVER_GRPC_PORT_HTTP", "8080");
auto port = std::stoi(port_str);
const auto *const host =
caosdb::utility::get_env_var("CAOSDB_SERVER_HOST", "localhost");
caosdb::utility::get_env_var("CAOSDB_SERVER_HOST", "localhost");
auto config = InsecureConnectionConfiguration(host, port);
auto connection = Connection(config);
@@ -75,12 +75,12 @@ TEST(test_connection, connection_insecure_authentication_error_anonymous) {
TEST(test_connection, connection_ssl_authentication_error_anonymous) {
const auto *port_str =
caosdb::utility::get_env_var("CAOSDB_SERVER_GRPC_PORT_HTTPS", "8443");
caosdb::utility::get_env_var("CAOSDB_SERVER_GRPC_PORT_HTTPS", "8443");
auto port = std::stoi(port_str);
const auto *const host =
caosdb::utility::get_env_var("CAOSDB_SERVER_HOST", "localhost");
caosdb::utility::get_env_var("CAOSDB_SERVER_HOST", "localhost");
const auto path =
caosdb::utility::get_env_var("CAOSDB_SERVER_CERT", std::string());
caosdb::utility::get_env_var("CAOSDB_SERVER_CERT", std::string());
auto cert = PemFileCertificateProvider(path);
auto config = TlsConnectionConfiguration(host, port, cert);
@@ -94,12 +94,12 @@ TEST(test_connection, connection_ssl_authentication_error_anonymous) {
TEST(test_connection, connection_ssl_authentication_error_wrong_credentials) {
const auto *port_str =
caosdb::utility::get_env_var("CAOSDB_SERVER_GRPC_PORT_HTTPS", "8443");
caosdb::utility::get_env_var("CAOSDB_SERVER_GRPC_PORT_HTTPS", "8443");
auto port = std::stoi(port_str);
const auto *const host =
caosdb::utility::get_env_var("CAOSDB_SERVER_HOST", "localhost");
caosdb::utility::get_env_var("CAOSDB_SERVER_HOST", "localhost");
const auto path =
caosdb::utility::get_env_var("CAOSDB_SERVER_CERT", std::string());
caosdb::utility::get_env_var("CAOSDB_SERVER_CERT", std::string());
const auto *const user = "not-a-user-23461237";
const auto *const password = "very-c-cred";
@@ -109,10 +109,10 @@ TEST(test_connection, connection_ssl_authentication_error_wrong_credentials) {
auto connection = Connection(config);
EXPECT_THROW_MESSAGE(
connection.RetrieveVersionInfo(), AuthenticationError,
"The attempt to execute this transaction has not been executed at all "
"because the authentication did not succeed. Original error: "
"Authentication failed. Username or password wrong.");
connection.RetrieveVersionInfo(), AuthenticationError,
"The attempt to execute this transaction has not been executed at all "
"because the authentication did not succeed. Original error: "
"Authentication failed. Username or password wrong.");
}
TEST(test_connection, connection_ssl_authentication_success) {
@@ -121,7 +121,7 @@ TEST(test_connection, connection_ssl_authentication_success) {
auto major = caosdb::COMPATIBLE_SERVER_VERSION_MAJOR;
auto minor = caosdb::COMPATIBLE_SERVER_VERSION_MINOR;
const auto pre_release =
std::string(caosdb::COMPATIBLE_SERVER_VERSION_PRE_RELEASE);
std::string(caosdb::COMPATIBLE_SERVER_VERSION_PRE_RELEASE);
const auto &v_info = connection->RetrieveVersionInfo();
EXPECT_EQ(major, v_info.GetMajor());
Loading