xml_address_space_addon_ut.cpp
Go to the documentation of this file.
1 
13 #include "services_registry_test.h"
14 
19 
20 #include <functional>
21 #include <gtest/gtest.h>
22 #include <gmock/gmock.h>
23 
24 // TODO Add tests for several appearing nodes in xml.
25 // TODO Add tests for all node classes and for invalid classe names.
26 
27 using namespace testing;
28 using namespace OpcUa;
29 using namespace OpcUa::Internal;
30 
32 {
33 protected:
34  virtual void SetUp()
35  {
37  Logger = spdlog::stderr_color_mt("test");
38  Logger->set_level(spdlog::level::info);
39  Addons = Common::CreateAddonsManager(Logger);
42  Addons->Register(CreateXmlAddressSpaceAddonConfig());
43  Addons->Start();
44  }
45 
46  virtual void TearDown()
47  {
48  Addons->Stop();
49  Addons.reset();
50  }
51 
52 protected:
54  {
59  return config;
60  }
61 
62 protected:
63  Common::Logger::SharedPtr Logger;
64  Common::AddonsManager::SharedPtr Addons;
65 };
66 
67 TEST_F(XmlSpaceAddon, CanBeLoaded)
68 {
69  ASSERT_TRUE(static_cast<bool>(Addons->GetAddon(OpcUa::Server::XmlAddressSpaceAddonId)));
70 }
const char XmlAddressSpaceAddonId[]
Definition: xml_ns.h:21
TEST_F(TestInfoTest, Names)
const char AddressSpaceRegistryAddonId[]
std::shared_ptr< AddonFactory > Factory
Definition: addon_manager.h:32
Common::AddonsManager::SharedPtr Addons
std::vector< AddonId > Dependencies
Definition: addon_manager.h:33
AddonsManager::UniquePtr CreateAddonsManager(const Common::Logger::SharedPtr &logger)
Get instance of addons core.
void RegisterServicesRegistry(Common::AddonsManager &addons)
void RegisterAddressSpace(Common::AddonsManager &addons)
OPC UA Address space part. GNU LGPL.
#define ASSERT_TRUE(condition)
Common::AddonInformation CreateXmlAddressSpaceAddonConfig()
Common::Logger::SharedPtr Logger
std::shared_ptr< logger > stderr_color_mt(const std::string &logger_name)
Definition: spdlog_impl.h:150
void drop_all()
Definition: spdlog_impl.h:260


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Tue Jan 19 2021 03:12:08