15 #include <gtest/gtest.h> 17 #ifndef TEST_CORE_CONFIG_PATH 18 #define TEST_CORE_CONFIG_PATH "./tests/core/configs/" 24 TEST(ServerOptions, ParsesCommandLine)
26 const char * argv[4] = {
"test.exe",
"--config=" TEST_CORE_CONFIG_PATH,
"--log-file=/path/to/log/server.log",
"--daemon" };
34 TEST(ServerOptions, ParsesConfigurationFiles)
37 std::vector<Common::AddonInformation> addons(config.
Modules.size());
40 return Common::GetAddonInfomation(module);
48 ASSERT_EQ(module.Dependencies[0],
"parent_module1");
49 ASSERT_EQ(module.Dependencies[1],
"parent_module2");
51 ASSERT_EQ(module.Parameters.Parameters.size(), 5);
52 ASSERT_EQ(module.Parameters.Parameters[0].Name,
"application_name");
53 ASSERT_EQ(module.Parameters.Parameters[0].Value,
"Test OPC UA Server");
55 ASSERT_EQ(module.Parameters.Groups.size(), 2);
56 ASSERT_EQ(module.Parameters.Groups[0].Name,
"user_token_policy");
57 ASSERT_EQ(module.Parameters.Groups[0].Parameters.size(), 3);
58 ASSERT_EQ(module.Parameters.Groups[0].Parameters[0].Name,
"id");
59 ASSERT_EQ(module.Parameters.Groups[0].Parameters[0].Value,
"anonymous");
60 ASSERT_EQ(module.Parameters.Groups[0].Parameters[1].Name,
"type");
61 ASSERT_EQ(module.Parameters.Groups[0].Parameters[1].Value,
"anonymous");
Configuration ParseConfigurationFiles(const std::string &directory)
#define EXPECT_TRUE(condition)
std::string GetLogFile() const
const char * TestConfigPath
#define TEST_CORE_CONFIG_PATH
Test of class UaServer::CommandLine. GNU LGPL.
const char * TestConfigFile
std::string GetConfigDir() const
#define ASSERT_EQ(val1, val2)
bool IsDaemonMode() const
TEST(ServerOptions, ParsesCommandLine)
std::vector< ModuleConfiguration > Modules
#define EXPECT_EQ(expected, actual)