common.h
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 #ifndef opcua_tests_common_utils_h
00012 #define opcua_tests_common_utils_h
00013 
00014 #include <opc/common/addons_core/addon_manager.h>
00015 
00016 #include <gmock/gmock.h>
00017 #include <gtest/gtest.h>
00018 
00019 namespace OpcUa
00020 {
00021   namespace Tests
00022   {
00023     inline std::string GetTcpServerAddonPath()
00024     {
00025       if (const char* path = getenv("TCP_ADDON_PATH"))
00026       {
00027         return path;
00028       }
00029       return std::string();
00030     }
00031     inline std::string GetBuiltinServerAddonPath()
00032     {
00033       if (const char* path = getenv("BUILTIN_COMPUTER_ADDON_PATH"))
00034       {
00035         return path;
00036       }
00037       return std::string();
00038     }
00039 /*
00040     inline std::string GetEndpointsAddonPath()
00041     {
00042       if (const char* path = getenv("ENDPOINTS_ADDON_PATH"))
00043       {
00044         return path;
00045       }
00046       return std::string();
00047     }
00048 */
00049     inline std::string GetEndpointsConfigPath()
00050     {
00051       if (const char* path = getenv("ENDPOINTS_CONFIG_PATH"))
00052       {
00053         return path;
00054       }
00055       return std::string();
00056     }
00057 
00058 /*
00059      class IncomingConnectionProcessorMock : public OpcUa::UaServer::IncomingConnectionProcessor
00060      {
00061      public:
00062        MOCK_METHOD1(Process, void (std::shared_ptr<OpcUa::IOChannel>));
00063        MOCK_METHOD1(StopProcessing, void (std::shared_ptr<OpcUa::IOChannel> clientChannel));
00064      };
00065 
00066     class EchoProcessor : public OpcUa::UaServer::IncomingConnectionProcessor
00067     {
00068     public:
00069       virtual void Process(std::shared_ptr<OpcUa::IOChannel> clientChannel)
00070       {
00071         char data[4] = {0};
00072         clientChannel->Receive(data, 4);
00073         clientChannel->Send(data, 4);
00074       }
00075       virtual void StopProcessing(std::shared_ptr<OpcUa::IOChannel> clientChannel)
00076       {
00077       }
00078     };
00079 */
00080 
00081 //    std::unique_ptr<Common::AddonsManager> LoadAddons(const std::string& configPath);
00082 
00083   } // namspace Tests
00084 } // namespace OpcUa
00085 
00086 #endif //  opcua_tests_common_utils_h
00087 


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Sat Jun 8 2019 18:24:40