1#include "ChimeraTK/ControlSystemAdapter/ControlSystemPVManager.h"
2#include "ChimeraTK/ControlSystemAdapter/DevicePVManager.h"
3#include "ChimeraTK/ControlSystemAdapter/PVManager.h"
5#include <boost/test/included/unit_test.hpp>
11using namespace boost::unit_test_framework;
20 cout <<
"UAAdapterTest with ExampleSet started." << endl;
23 BOOST_CHECK_THROW(
ua_uaadapter(
"uamapping_test_twoconfigs.xml"), std::runtime_error);
24 BOOST_CHECK_THROW(
ua_uaadapter(
"uamapping_test_notwellformed.xml"), std::logic_error);
28 ad1 =
new ua_uaadapter(
"uamapping_test_configismissing.xml");
30 ad1 =
new ua_uaadapter(
"uamapping_test_portismissing.xml");
39 BOOST_CHECK(!UA_NodeId_isNull(&ownNodeId));
44 UA_NodeId folderNodeId = adapter->
existFolderPath(ownNodeId, pathVector);
45 BOOST_CHECK(UA_NodeId_isNull(&folderNodeId));
49 BOOST_CHECK(!UA_NodeId_isNull(&folderNodeId));
52 BOOST_CHECK(!UA_NodeId_isNull(&folderNodeId));
57 BOOST_CHECK(UA_NodeId_isNull(&folderNodeId));
60 BOOST_CHECK(!UA_NodeId_isNull(&folderNodeId));
63 BOOST_CHECK(!UA_NodeId_isNull(&folderNodeId));
66 UA_NodeId existingFolderNodeId = adapter->
createFolderPath(ownNodeId, pathVector);
67 BOOST_CHECK(UA_NodeId_equal(&existingFolderNodeId, &folderNodeId));
70 BOOST_CHECK(UA_NodeId_isNull(&folderNodeId));
72 for(
auto processVar : tfExampleSet.
csManager.get()->getAllProcessVariables()) {
This class provide the opcua server and manage the variable mapping.
void implicitVarMapping(const std::string &varName, const boost::shared_ptr< ControlSystemPVManager > &csManager)
Start implicit mapping process.
vector< ua_processvariable * > getVariables()
Methode that returns all <ua_processvariable> of the class.
UA_NodeId getOwnNodeId()
Methode that returns the node id of the instanced class.
UA_DateTime getSourceTimeStamp()
Return the timestamp of the node.
UA_NodeId existFolderPath(UA_NodeId basenodeid, const vector< string > &folderPath)
Check if a folder path exist in opcua server.
UA_NodeId createFolderPath(UA_NodeId basenodeid, vector< string > folderPathVector)
Create a path of folders in the given parent node.
vector< string > getAllNotMappableVariablesNames()
Methode to get all names from all potential VarableNodes from XML-Mappingfile which could not allocat...
This class support any file interaction with a xml file.
static std::vector< std::string > parseVariablePath(const std::string &variablePath, const std::string &seperator="/")
This methode splitt a given string bey the given seperators.
static void testExampleSet()
boost::shared_ptr< ControlSystemPVManager > csManager
test_suite * init_unit_test_suite(int, char **)