revise arch between actionRule and action
authorYoungjae Shin <yj99.shin@samsung.com>
Tue, 7 Jan 2020 23:25:35 +0000 (08:25 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Wed, 18 Mar 2020 08:53:50 +0000 (17:53 +0900)
24 files changed:
supervisor/ActionRule.cpp
supervisor/ActionRule.h
supervisor/ModeManager.cpp
supervisor/ModeManager.h
supervisor/ModeXMLParser.cpp
supervisor/ModeXMLParser.h
supervisor/PluginManager.cpp [deleted file]
supervisor/PluginManager.h [deleted file]
supervisor/PluginMapper.cpp [new file with mode: 0644]
supervisor/PluginMapper.h [new file with mode: 0644]
supervisor/RequestHandler.cpp
supervisor/RequestHandler.h
supervisor/RuleManager.cpp
supervisor/RuleManager.h
supervisor/Supervisor.cpp
supervisor/Supervisor.h
supervisor/TActionRule.h
unittest/CMakeLists.txt
unittest/modes_test_conflict.cpp
unittest/modes_test_generator.cpp
unittest/modes_test_modemgr.cpp
unittest/modes_test_parser.cpp
unittest/modes_test_plugin.cpp
unittest/modes_test_rulemgr.cpp

index 92e83575e3f0c51590ad11860757a0e990552b92..cac2de18eacf5af599a0fc57c37cbd7d224aa370 100644 (file)
@@ -25,12 +25,12 @@ std::string ActionRule::getName()
        return ruleName;
 }
 
-void ActionRule::setPlugin(const std::string &pi)
+void ActionRule::setPlugin(Plugin *pi)
 {
        plugin = pi;
 }
 
-std::string ActionRule::getPlugin()
+Plugin* ActionRule::getPlugin()
 {
        return plugin;
 }
index 8fbb9b378565f271dd4f2a60821538d35c0728d5..e0808c40cc4bd821531344f93c0575d6ad2dd6eb 100644 (file)
@@ -26,16 +26,16 @@ public:
        virtual ~ActionRule() = default;
 
        std::string getName();
-       std::string getPlugin();
-       void setPlugin(const std::string &pi);
+       Plugin* getPlugin();
+       void setPlugin(Plugin *pi);
        void setPrivilege(const std::string &priv);
        virtual Action* makeAction() = 0;
        virtual int addAlias(const std::string &alias, const std::string &value) = 0;
 protected:
        std::string ruleName;
        std::string privilege;
+       Plugin *plugin;
 private:
-       std::string plugin;
        // TODO:: handle conflict List, since, description, version
        //std::list<std::string> conflictActionList;
        //std::string description;
index a79bd10eb52dd7956e9a2b1f0c1d970e25eb0b43..033be0220e6bb34ec1aa4d452077f3bbae27d488 100644 (file)
@@ -30,8 +30,8 @@
 using std::string;
 MODES_NAMESPACE_USE;
 
-ModeManager::ModeManager(RuleManager &rMgr, PluginManager &pMgr)
-       : ruleMgr(rMgr), pluginMgr(pMgr)
+ModeManager::ModeManager(RuleManager &rMgr)
+       : ruleMgr(rMgr)
 {
 }
 
@@ -62,7 +62,7 @@ ModeParser* ModeManager::getModeParser(const string &path)
        const size_t suffixLen = sizeof("xml") - 1;
        if (suffixLen < path.length()
                        || path.compare(path.length() - suffixLen, suffixLen, "xml")) {
-               return new ModeXMLParser(path, ruleMgr, pluginMgr);
+               return new ModeXMLParser(path, ruleMgr);
        } else {
                ERR("Wrong path(%s)", path.c_str());
                throw std::invalid_argument("Wrong path");
index cc0c14250c4a7d44db892a46a2d4db1d8234c90a..4b71db665ba78a932a274215f35da35b2bcada1c 100644 (file)
@@ -20,7 +20,6 @@
 #include <set>
 #include "mdss.h"
 #include "ModeParser.h"
-#include "PluginManager.h"
 #include "RuleManager.h"
 #include "ModeCareTaker.h"
 #include "ClientPrivilege.h"
@@ -34,7 +33,7 @@ MODES_NAMESPACE_BEGIN
 
 class ModeManager {
 public:
-       ModeManager(RuleManager &rMgr, PluginManager &pMgr);
+       ModeManager(RuleManager &rMgr);
 
        void setOptions(const std::set<std::string> &modeDirs, const std::string &xsdFile, const std::string &undoInfoDir);
        void init();
@@ -54,7 +53,6 @@ private:
        std::string undoDir;
        std::string modeSyntaxFile;
        RuleManager &ruleMgr;
-       PluginManager &pluginMgr;
        ModeCareTaker careTaker;
 
 #ifdef MDS_TEST
index 17aba94880d42865cb3d0f75b7209d7547ebd411..59e361e27509fd4f0a22f474d38b8da9c2e0b581 100644 (file)
@@ -28,8 +28,8 @@
 
 MODES_NAMESPACE_USE;
 
-ModeXMLParser::ModeXMLParser(const std::string &modeFile, RuleManager &rMgr, PluginManager &pMgr)
-       : ModeParser(rMgr), XMLParser(modeFile), pluginManager(pMgr), isParsedModeAttr(false)
+ModeXMLParser::ModeXMLParser(const std::string &modeFile, RuleManager &rMgr)
+       : ModeParser(rMgr), XMLParser(modeFile), isParsedModeAttr(false)
 {
 }
 
@@ -179,21 +179,19 @@ void ModeXMLParser::parseAction(xmlNodePtr node)
 
 Action* ModeXMLParser::parseActionInfo(xmlNodePtr node)
 {
-       char *ruleProp = (char*)xmlGetProp(node, ModesXMLTag::RULE);
-       if (ruleProp == NULL) {
+       char *ruleName = (char*)xmlGetProp(node, ModesXMLTag::RULE);
+       if (ruleName == NULL) {
                ERR("rule attribute is null! [%s]", ModesXMLTag::RULE);
                throw ModesEx(ModesEx::PARSER_ERROR, "rule attribute is null!");
        }
 
-       Action *action = ruleMgr.createAction(ruleProp);
+       Action *action = ruleMgr.createAction(ruleName);
        if (action == nullptr) {
-               ERR("ruleMgr createAction(%s) Fail", ruleProp);
-               xmlFree(ruleProp);
+               ERR("ruleMgr createAction(%s) Fail", ruleName);
+               xmlFree(ruleName);
                throw ModesEx(ModesEx::PARSER_ERROR, "Action is null!");
        }
-
-       bindPlugin(ruleProp, action);
-       xmlFree(ruleProp);
+       xmlFree(ruleName);
 
        parseActionAttr(node, action);
 
@@ -212,11 +210,3 @@ Action* ModeXMLParser::parseActionInfo(xmlNodePtr node)
        action->printInfo();
        return action;
 }
-
-void ModeXMLParser::bindPlugin(const std::string &name, Action *action)
-{
-       std::string pluginName;
-       int pos = name.find_first_of(".");
-       pluginName = name.substr(0, pos);
-       action->setPlugin(pluginManager.getPlugin(pluginName));
-}
index cc5db70c45d6cb72dbae84aff161118a238fd4be..24518b1c77a2452b44162705e3cf93012171df8b 100644 (file)
 #include "mdss.h"
 #include "ModeParser.h"
 #include "XMLParser.h"
-#include "PluginManager.h"
 
 MODES_NAMESPACE_BEGIN
 
 class ModeXMLParser : public ModeParser, public XMLParser {
 public:
-       ModeXMLParser(const std::string &modeFile, RuleManager &mgr, PluginManager &pluginMgr);
+       ModeXMLParser(const std::string &modeFile, RuleManager &mgr);
        ~ModeXMLParser() = default;
 
        Mode getMode() override;
@@ -45,10 +44,8 @@ private:
        void parseAction(xmlNodePtr node);
        void parseUndo(xmlNodePtr node);
        Action *parseActionInfo(xmlNodePtr node);
-       void bindPlugin(const std::string &name, Action *action);
        void parseModeAttr();
 
-       PluginManager &pluginManager;
        Mode mode;
        std::string filePath;
        bool isParsedModeAttr;
diff --git a/supervisor/PluginManager.cpp b/supervisor/PluginManager.cpp
deleted file mode 100644 (file)
index 867f497..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "PluginManager.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <dirent.h>
-#include <errno.h>
-#include <dlfcn.h>
-#include "mdss.h"
-#include "ModesEx.h"
-
-MODES_NAMESPACE_USE;
-
-#define EMPTY_PLUGIN_PAIR std::make_pair(nullptr, nullptr)
-
-void PluginManager::setPluginDir(const std::string &dir)
-{
-       pluginDir = dir;
-}
-
-int PluginManager::loadPlugins()
-{
-       DIR *dir;
-       if ((dir = opendir(pluginDir.c_str())) == NULL) {
-               ERR("opendir(%s) Fail(%s)", pluginDir.c_str(), strerror(errno));
-               throw ModesEx(ModesEx::SYSTEM_ERROR);
-       }
-
-       struct dirent *entry;
-       while ((entry = readdir(dir)) != NULL) {
-               std::string file(entry->d_name);
-               if (std::string::npos == file.find(MODES_PLUGIN_LIB_PREFIX)) //library validation
-                       continue;
-
-               std::string fileFullPath = pluginDir + "/" + file;
-               try {
-                       PluginPair pluginPair = loadClass(fileFullPath);
-                       DBG("loadClass(%s) OK", pluginPair.second->getName().c_str());
-
-                       pluginMap[pluginPair.second->getName()] = pluginPair;
-               }
-               catch (ModesEx &e) {
-                       ERR("loadClass(%s) Fail", fileFullPath.c_str());
-               }
-       }
-
-       closedir(dir);
-
-       if (pluginMap.empty())
-               return MODES_ERROR_NO_DATA;
-
-       return MODES_ERROR_NONE;
-}
-
-PluginManager::PluginPair PluginManager::loadClass(const std::string &pluginFile)
-{
-       void *handle = dlopen(pluginFile.c_str(), RTLD_LAZY);
-       if (NULL == handle) {
-               ERR("dlopen(%s) Fail(%s)", pluginFile.c_str(), dlerror());
-               throw ModesEx(ModesEx::SYSTEM_ERROR);
-       }
-
-       /* load the symbols */
-       create_t *create_object_func = (create_t *) dlsym(handle, "objectCreate");
-       if (NULL == create_object_func) {
-               ERR("dlsym(objectCreate) Fail(Plugin[%s] error[%s])", pluginFile.c_str(), dlerror());
-               dlclose(handle);
-               throw ModesEx(ModesEx::SYSTEM_ERROR);
-       }
-
-       /* create an instance of the class */
-       Plugin *object = create_object_func();
-       if (NULL == object) {
-               ERR("create_object_func(%s) Fail", pluginFile.c_str());
-               dlclose(handle);
-               throw ModesEx(ModesEx::SYSTEM_ERROR);
-       }
-
-       return std::make_pair(handle, object);
-}
-
-int PluginManager::unloadClass(const PluginPair &pluginPair)
-{
-       void *handle = pluginPair.first;
-       Plugin *object = pluginPair.second;
-       std::string pluginName = object->getName();
-
-       RETVM_IF(NULL == handle, MODES_ERROR_SYSTEM, "handle(%s) is null", pluginName.c_str());
-
-       destroy_t *delete_object_func = (destroy_t *)dlsym(handle, "objectDelete");
-       if (NULL == delete_object_func) {
-               ERR("dlsym(objectDelete) Fail(plugin[%s] error[%s])", pluginName.c_str(), dlerror());
-               dlclose(handle);
-               return MODES_ERROR_SYSTEM;
-       }
-
-       delete_object_func(object);
-       dlclose(handle);
-
-       return MODES_ERROR_NONE;
-}
-
-
-int PluginManager::unloadPlugins()
-{
-       int ret = MODES_ERROR_NONE;
-
-       for (auto it = pluginMap.begin(); it != pluginMap.end(); ++it) {
-               int rc = unloadClass(it->second);
-               if (rc != MODES_ERROR_NONE) {
-                       ERR("unloadClass(%s) Fail", (it->first).c_str());
-                       ret = MODES_ERROR_SYSTEM;
-               }
-       }
-       pluginMap.clear();
-
-       return ret;
-}
-
-std::list<std::string> PluginManager::getPluginList()
-{
-       std::list<std::string> list;
-       for (auto it = pluginMap.begin(); it != pluginMap.end(); ++it) {
-               list.push_back(it->first);
-       }
-
-       return list;
-}
-
-Plugin *PluginManager::getPlugin(std::string name)
-{
-       return pluginMap[name].second;
-}
diff --git a/supervisor/PluginManager.h b/supervisor/PluginManager.h
deleted file mode 100644 (file)
index 15950bb..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#pragma once
-
-#include <iostream>
-#include <new>
-#include <list>
-#include <utility>
-#include <unordered_map>
-#include "mdss.h"
-#include "Plugin.h"
-
-MODES_NAMESPACE_BEGIN
-
-class PluginManager {
-public:
-       void setPluginDir(const std::string &dir_path);
-       int loadPlugins();
-       int unloadPlugins();
-
-       std::list<std::string> getPluginList();
-       Plugin* getPlugin(std::string name);
-
-       /*addDirChangeNotifier(); */
-       /*dirChangeNotifierCallBack(); */
-private:
-       typedef std::pair<void*, Plugin*> PluginPair;
-
-       PluginPair loadClass(const std::string &pluginFile);
-       int unloadClass(const PluginPair &pluginPair);
-
-       std::string pluginDir;
-       std::unordered_map<std::string, PluginPair> pluginMap;
-
-#ifdef MDS_TEST
-       friend class TestPluginBroker;
-#endif
-};
-
-MODES_NAMESPACE_END
diff --git a/supervisor/PluginMapper.cpp b/supervisor/PluginMapper.cpp
new file mode 100644 (file)
index 0000000..fd0956a
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "PluginMapper.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <dirent.h>
+#include <errno.h>
+#include <dlfcn.h>
+#include "mdss.h"
+#include "ModesEx.h"
+
+MODES_NAMESPACE_USE;
+
+#define EMPTY_PLUGIN_PAIR std::make_pair(nullptr, nullptr)
+
+void PluginMapper::setPluginDir(const std::string &dir)
+{
+       pluginDir = dir;
+}
+
+int PluginMapper::loadPlugins()
+{
+       DIR *dir;
+       if ((dir = opendir(pluginDir.c_str())) == NULL) {
+               ERR("opendir(%s) Fail(%s)", pluginDir.c_str(), strerror(errno));
+               throw ModesEx(ModesEx::SYSTEM_ERROR);
+       }
+
+       struct dirent *entry;
+       while ((entry = readdir(dir)) != NULL) {
+               std::string file(entry->d_name);
+               if (std::string::npos == file.find(MODES_PLUGIN_LIB_PREFIX)) //library validation
+                       continue;
+
+               std::string fileFullPath = pluginDir + "/" + file;
+               try {
+                       PluginPair pluginPair = loadClass(fileFullPath);
+                       DBG("loadClass(%s) OK", pluginPair.second->getName().c_str());
+
+                       pluginMap[pluginPair.second->getName()] = pluginPair;
+               }
+               catch (ModesEx &e) {
+                       ERR("loadClass(%s) Fail", fileFullPath.c_str());
+               }
+       }
+
+       closedir(dir);
+
+       if (pluginMap.empty())
+               return MODES_ERROR_NO_DATA;
+
+       return MODES_ERROR_NONE;
+}
+
+PluginMapper::PluginPair PluginMapper::loadClass(const std::string &pluginFile)
+{
+       void *handle = dlopen(pluginFile.c_str(), RTLD_LAZY);
+       if (NULL == handle) {
+               ERR("dlopen(%s) Fail(%s)", pluginFile.c_str(), dlerror());
+               throw ModesEx(ModesEx::SYSTEM_ERROR);
+       }
+
+       /* load the symbols */
+       create_t *create_object_func = (create_t *) dlsym(handle, "objectCreate");
+       if (NULL == create_object_func) {
+               ERR("dlsym(objectCreate) Fail(Plugin[%s] error[%s])", pluginFile.c_str(), dlerror());
+               dlclose(handle);
+               throw ModesEx(ModesEx::SYSTEM_ERROR);
+       }
+
+       /* create an instance of the class */
+       Plugin *object = create_object_func();
+       if (NULL == object) {
+               ERR("create_object_func(%s) Fail", pluginFile.c_str());
+               dlclose(handle);
+               throw ModesEx(ModesEx::SYSTEM_ERROR);
+       }
+
+       return std::make_pair(handle, object);
+}
+
+int PluginMapper::unloadClass(const PluginPair &pluginPair)
+{
+       void *handle = pluginPair.first;
+       Plugin *object = pluginPair.second;
+       std::string pluginName = object->getName();
+
+       RETVM_IF(NULL == handle, MODES_ERROR_SYSTEM, "handle(%s) is null", pluginName.c_str());
+
+       destroy_t *delete_object_func = (destroy_t *)dlsym(handle, "objectDelete");
+       if (NULL == delete_object_func) {
+               ERR("dlsym(objectDelete) Fail(plugin[%s] error[%s])", pluginName.c_str(), dlerror());
+               dlclose(handle);
+               return MODES_ERROR_SYSTEM;
+       }
+
+       delete_object_func(object);
+       dlclose(handle);
+
+       return MODES_ERROR_NONE;
+}
+
+
+int PluginMapper::unloadPlugins()
+{
+       int ret = MODES_ERROR_NONE;
+
+       for (auto it = pluginMap.begin(); it != pluginMap.end(); ++it) {
+               int rc = unloadClass(it->second);
+               if (rc != MODES_ERROR_NONE) {
+                       ERR("unloadClass(%s) Fail", (it->first).c_str());
+                       ret = MODES_ERROR_SYSTEM;
+               }
+       }
+       pluginMap.clear();
+
+       return ret;
+}
+
+std::list<std::string> PluginMapper::getPluginList()
+{
+       std::list<std::string> list;
+       for (auto it = pluginMap.begin(); it != pluginMap.end(); ++it) {
+               list.push_back(it->first);
+       }
+
+       return list;
+}
+
+Plugin *PluginMapper::getPlugin(std::string name)
+{
+       return pluginMap[name].second;
+}
diff --git a/supervisor/PluginMapper.h b/supervisor/PluginMapper.h
new file mode 100644 (file)
index 0000000..98fe50c
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include <iostream>
+#include <new>
+#include <list>
+#include <utility>
+#include <unordered_map>
+#include "mdss.h"
+#include "Plugin.h"
+
+MODES_NAMESPACE_BEGIN
+
+class PluginMapper {
+public:
+       void setPluginDir(const std::string &dir_path);
+       int loadPlugins();
+       int unloadPlugins();
+
+       std::list<std::string> getPluginList();
+       Plugin* getPlugin(std::string name);
+
+       /*addDirChangeNotifier(); */
+       /*dirChangeNotifierCallBack(); */
+private:
+       typedef std::pair<void*, Plugin*> PluginPair;
+
+       PluginPair loadClass(const std::string &pluginFile);
+       int unloadClass(const PluginPair &pluginPair);
+
+       std::string pluginDir;
+       std::unordered_map<std::string, PluginPair> pluginMap;
+
+#ifdef MDS_TEST
+       friend class TestPluginBroker;
+#endif
+};
+
+MODES_NAMESPACE_END
index 2f4d847252f4a09640b4abe9252b6943086742dc..0c1c02987ea2ef765c4df52771339a8f70732960 100644 (file)
@@ -23,7 +23,6 @@ MODES_NAMESPACE_USE;
 
 ModeManager* RequestHandler::modeMgr = NULL;
 RuleManager *RequestHandler::ruleMgr = NULL;
-PluginManager *RequestHandler::pluginMgr = NULL;
 
 void RequestHandler::setModeManager(ModeManager *mgr)
 {
index 363e5629a03285174aad316b5b06101f764ad09a..da5e0614e318759aa002c7a53545df1ca2f27959 100644 (file)
@@ -44,7 +44,6 @@ private:
 
        static ModeManager *modeMgr;
        static RuleManager *ruleMgr;
-       static PluginManager *pluginMgr;
 };
 
 MODES_NAMESPACE_END
index 6047f4716c90c54c73ac31656d72e19534e3bb51..b5f0d00454fc2dcf1d147f4c2ed276f3b7646d91 100644 (file)
@@ -35,6 +35,18 @@ const xmlChar* const RuleManager::RULE_TAGS[] = {
        (xmlChar*)"privilege",
 };
 
+void RuleManager::start()
+{
+       piMapper.loadPlugins();
+       makeRuleMap();
+}
+
+void RuleManager::stop()
+{
+       freeRuleMap();
+       piMapper.unloadPlugins();
+}
+
 void RuleManager::makeRuleMap()
 {
        if (ruleDir.empty()) {
@@ -128,10 +140,11 @@ Action* RuleManager::createAction(const string &ruleName)
        }
 }
 
-void RuleManager::setOptions(const string &actionRuleDir, const string &actionRuleXsd)
+void RuleManager::setOptions(const string &actionRuleDir, const string &actionRuleXsd, const std::string &pluginDir)
 {
        ruleDir = actionRuleDir;
        ruleXsd = actionRuleXsd;
+       piMapper.setPluginDir(pluginDir);
 }
 
 void RuleManager::addBoolAlias(ActionRule *actionRule)
@@ -142,13 +155,13 @@ void RuleManager::addBoolAlias(ActionRule *actionRule)
 
 ActionRule* RuleManager::makeRule(xmlNodePtr node)
 {
-       string type, name, plugin;
+       string type, name, pluginName;
        ActionRule *actionRule = NULL;
 
        try {
                name = XMLParser::extractValueOfTag(node, RULE_TAGS[TagAttName]);
                type = XMLParser::extractValueOfTag(node, RULE_TAGS[TagAttType]);
-               plugin = XMLParser::extractValueOfTag(node, RULE_TAGS[TagAttPlugin]);
+               pluginName = XMLParser::extractValueOfTag(node, RULE_TAGS[TagAttPlugin]);
        } catch (ModesEx &e) {
                ERR("extractValueOfTag() Fail(%s)", e.what());
                throw;
@@ -164,7 +177,7 @@ ActionRule* RuleManager::makeRule(xmlNodePtr node)
        } else {
                actionRule = new TActionRule<string>(name);
        }
-       actionRule->setPlugin(plugin);
+       actionRule->setPlugin(piMapper.getPlugin(pluginName));
        for (xmlNode *cur = node->children; cur; cur = cur->next) {
                if (xmlIsBlankNode(cur))
                        continue;
index 50035f7eaeac517c30e7fe16ffcc2d143e19e231..809a4955ca43623d0d23a509e5626f14d3ec487d 100644 (file)
@@ -22,6 +22,7 @@
 #include "ActionRule.h"
 #include "Action.h"
 #include "XMLParser.h"
+#include "PluginMapper.h"
 
 MODES_NAMESPACE_BEGIN
 
@@ -37,15 +38,17 @@ public:
                TagMax
        };
 
-       void setOptions(const std::string &actionRuleDir, const std::string &actionRuleXsd);
-       void makeRuleMap();
-       void freeRuleMap();
+       void start();
+       void stop();
+       void setOptions(const std::string &actionRuleDir, const std::string &actionRuleXsd, const std::string &pluginDir);
        Action* createAction(const std::string &actionName);
 private:
        static const xmlChar* const ACTION_RULE_TAG;
        static const xmlChar* const ACTION_RULE_TAG_RULE;
        static const xmlChar* const RULE_TAGS[];
 
+       void makeRuleMap();
+       void freeRuleMap();
        ActionRule* makeRule(xmlNodePtr node);
        void parseRule(xmlNodePtr node);
        void addBoolAlias(ActionRule * actionRule);
@@ -55,7 +58,7 @@ private:
        std::map<std::string, ActionRule*> ruleMap;
        std::string ruleDir;
        std::string ruleXsd;
-
+       PluginMapper piMapper;
 #ifdef MDS_TEST
        friend class RuleManagerTest;
        friend class ParserTest;
index 92c4de24c88c75fbaadb62fcf4756c725d1c0107..79159e3abeec6b0b86a3432af4619f9a97620cb6 100644 (file)
@@ -23,8 +23,8 @@
 
 MODES_NAMESPACE_USE;
 
-ModeSupervisorNamespace::Supervisor::Supervisor()
-       :modeMgr(ruleMgr, pluginMgr)
+Supervisor::Supervisor()
+       : modeMgr(ruleMgr)
 {
 }
 
@@ -35,8 +35,7 @@ void Supervisor::init()
 
        try {
                clientConn.startDbus();
-               ruleMgr.makeRuleMap();
-               pluginMgr.loadPlugins();
+               ruleMgr.start();
                modeMgr.init();
        }
        catch (ModesEx &e) {
@@ -46,8 +45,7 @@ void Supervisor::init()
 
 void Supervisor::deInit()
 {
-       pluginMgr.unloadPlugins();
-       ruleMgr.freeRuleMap();
+       ruleMgr.stop();
        clientConn.stopDbus();
        RequestHandler::setModeManager(NULL);
        RequestHandler::setRuleManager(NULL);
@@ -56,8 +54,7 @@ void Supervisor::deInit()
 void Supervisor::setOptions(const ModesConfig &config)
 {
        modeMgr.setOptions(config.modeXMLDirs, config.modeXsdFile, config.undoInfoDir);
-       pluginMgr.setPluginDir(config.pluginDir);
-       ruleMgr.setOptions(config.actionRuleDir, config.actionRuleXsdFile);
+       ruleMgr.setOptions(config.actionRuleDir, config.actionRuleXsdFile, config.pluginDir);
 }
 
 void Supervisor::registerHandler()
index 75dd23d178682474ec1900742ae334c154b83717..17424ac718646b9717c9f87b20caaeef17a4a113 100644 (file)
@@ -19,7 +19,6 @@
 #include "mdss.h"
 #include "ModeManager.h"
 #include "ModesConfig.h"
-#include "PluginManager.h"
 #include "ClientConnection.h"
 #include "RuleManager.h"
 
@@ -36,7 +35,6 @@ public:
 private:
        ClientConnection clientConn;
        RuleManager ruleMgr;
-       PluginManager pluginMgr;
        ModeManager modeMgr;
 };
 
index 6dea12cc8638ce1a1af6fda4f51494e332e5477c..a96625a27b64536e000762d8a0c63d32efb9c4ad 100644 (file)
@@ -38,6 +38,7 @@ public:
                TAction<T> *action = new TAction<T>(ruleName);
                action->setValueAliases(valueAliasList);
                action->setPrivilege(privilege);
+               action->setPlugin(plugin);
 
                return action;
        }
index 14b5d25bc8b492a30b29b20e152175e62a38b929..88d3d5b2284b56c932cb543a941983a085f87c0c 100644 (file)
@@ -49,10 +49,10 @@ FILE(GLOB GTEST_MODEMGR_SRCS
                ${SUPERVISOR_DIR}/Action.cpp
                ${SUPERVISOR_DIR}/ActionRule.cpp
                ${SUPERVISOR_DIR}/RuleManager.cpp
+               ${SUPERVISOR_DIR}/PluginMapper.cpp
                ${SUPERVISOR_DIR}/ClientPrivilege.cpp
                ${SUPERVISOR_DIR}/Mode.cpp
                ${SUPERVISOR_DIR}/ModesEx.cpp
-               ${SUPERVISOR_DIR}/PluginManager.cpp
                ${SUPERVISOR_DIR}/ValueChecker.cpp
                modes_test_modemgr.cpp
        )
@@ -64,7 +64,7 @@ INSTALL(TARGETS ${GTEST_MODEMGR} DESTINATION ${TEST_INSTALL_DIR})
 #=======================================================================================#
 SET(GTEST_PLUGIN "modes-gtest-plugin")
 FILE(GLOB GTEST_PLUGIN_SRCS
-               ${SUPERVISOR_DIR}/PluginManager.cpp
+               ${SUPERVISOR_DIR}/PluginMapper.cpp
                ${SUPERVISOR_DIR}/ModesEx.cpp
                modes_test_plugin.cpp
        )
@@ -76,11 +76,11 @@ INSTALL(TARGETS ${GTEST_PLUGIN} DESTINATION ${TEST_INSTALL_DIR})
 SET(GTEST_PARSER "modes-gtest-parser")
 FILE(GLOB GTEST_PARSER_SRCS
                ${SUPERVISOR_DIR}/XMLParser.cpp
-               ${SUPERVISOR_DIR}/PluginManager.cpp
                ${SUPERVISOR_DIR}/ClientPrivilege.cpp
                ${SUPERVISOR_DIR}/Action.cpp
                ${SUPERVISOR_DIR}/ActionRule.cpp
                ${SUPERVISOR_DIR}/RuleManager.cpp
+               ${SUPERVISOR_DIR}/PluginMapper.cpp
                ${SUPERVISOR_DIR}/ModeXMLParser.cpp
                ${SUPERVISOR_DIR}/ModesEx.cpp
                ${SUPERVISOR_DIR}/Mode.cpp
@@ -102,9 +102,9 @@ FILE(GLOB GTEST_GENERATOR_SRCS
                ${SUPERVISOR_DIR}/Mode.cpp
                ${SUPERVISOR_DIR}/Action.cpp
                ${SUPERVISOR_DIR}/ModesEx.cpp
-               ${SUPERVISOR_DIR}/PluginManager.cpp
                ${SUPERVISOR_DIR}/ClientPrivilege.cpp
                ${SUPERVISOR_DIR}/RuleManager.cpp
+               ${SUPERVISOR_DIR}/PluginMapper.cpp
                ${SUPERVISOR_DIR}/ActionRule.cpp
                ${SUPERVISOR_DIR}/ValueChecker.cpp
                "modes_test_generator.cpp"
@@ -127,8 +127,8 @@ FILE(GLOB GTEST_CONFLICT_SRCS
                ${SUPERVISOR_DIR}/ModesEx.cpp
                ${SUPERVISOR_DIR}/ClientPrivilege.cpp
                ${SUPERVISOR_DIR}/ModesXMLTag.cpp
-               ${SUPERVISOR_DIR}/PluginManager.cpp
                ${SUPERVISOR_DIR}/RuleManager.cpp
+               ${SUPERVISOR_DIR}/PluginMapper.cpp
                ${SUPERVISOR_DIR}/ActionRule.cpp
                ${SUPERVISOR_DIR}/ValueChecker.cpp
                modes_test_conflict.cpp
@@ -141,6 +141,7 @@ INSTALL(TARGETS ${GTEST_CONFLICT} DESTINATION ${TEST_INSTALL_DIR})
 SET(GTEST_RULEMGR "modes-gtest-rulemgr")
 FILE(GLOB GTEST_RULE_SRCS
                ${SUPERVISOR_DIR}/RuleManager.cpp
+               ${SUPERVISOR_DIR}/PluginMapper.cpp
                ${SUPERVISOR_DIR}/XMLParser.cpp
                ${SUPERVISOR_DIR}/ActionRule.cpp
                ${SUPERVISOR_DIR}/ModesEx.cpp
@@ -152,5 +153,5 @@ FILE(GLOB GTEST_RULE_SRCS
        )
 ADD_EXECUTABLE(${GTEST_RULEMGR} ${SRC} ${GTEST_RULE_SRCS})
 ADD_DEPENDENCIES(${GTEST_RULEMGR} GENERATED_DBUS_CODE)
-TARGET_LINK_LIBRARIES(${GTEST_RULEMGR} ${gtest_pkgs_LIBRARIES})
+TARGET_LINK_LIBRARIES(${GTEST_RULEMGR} ${gtest_pkgs_LIBRARIES} dl)
 INSTALL(TARGETS ${GTEST_RULEMGR} DESTINATION ${TEST_INSTALL_DIR})
index 91e56a6a64d55275776d35724b6c3c653c79be9f..d0e83efbfb87620760789f5e63585eaf38b214cb 100644 (file)
@@ -27,7 +27,7 @@ public:
 protected:
        void SetUp() override
        {
-               ModeXMLParser modeparser("tizen_conflict1_mode.xml", ruleMgr, piMgr);
+               ModeXMLParser modeparser("tizen_conflict1_mode.xml", ruleMgr);
                careTaker.pushMode(modeparser.getMode());
        }
 
@@ -37,7 +37,6 @@ protected:
                careTaker.popMode("conflict1", mode);
        }
 
-       PluginManager piMgr;
        RuleManager ruleMgr;
        ModeCareTaker careTaker;
 };
@@ -48,23 +47,24 @@ ConflictTest::ConflictTest()
        config.actionRuleDir = ".";
        config.actionRuleXsdFile = "./" MODES_ACTIONRULE_DEFAULT_XSD_FILE;
        config.undoInfoDir = ".";
+       config.undoInfoDir = ".";
 
-       ruleMgr.setOptions(config.actionRuleDir, config.actionRuleXsdFile);
-       ruleMgr.makeRuleMap();
+       ruleMgr.setOptions(config.actionRuleDir, config.actionRuleXsdFile, ".");
+       ruleMgr.start();
        careTaker.setOptions(config.undoInfoDir);
 }
 
 
 TEST_F(ConflictTest, isSavedMode)
 {
-       ModeXMLParser modeparser("tizen_conflict1_mode.xml", ruleMgr, piMgr);
+       ModeXMLParser modeparser("tizen_conflict1_mode.xml", ruleMgr);
 
        EXPECT_TRUE(careTaker.isSavedMode(modeparser.getModeName()));
 }
 
 TEST_F(ConflictTest, isExcluded)
 {
-       ModeXMLParser modeparser("tizen_conflict3_mode.xml", ruleMgr, piMgr);
+       ModeXMLParser modeparser("tizen_conflict3_mode.xml", ruleMgr);
 
        careTaker.pushMode(modeparser.getMode());
        EXPECT_TRUE(careTaker.isExclusive());
@@ -76,7 +76,7 @@ TEST_F(ConflictTest, isExcluded)
 
 TEST_F(ConflictTest, checkConflictAction)
 {
-       ModeXMLParser modeparser("tizen_conflict2_mode.xml", ruleMgr, piMgr);
+       ModeXMLParser modeparser("tizen_conflict2_mode.xml", ruleMgr);
 
        Mode mode = modeparser.getMode();
        EXPECT_TRUE(careTaker.checkConflictAction(mode));
@@ -86,6 +86,6 @@ TEST_F(ConflictTest, isConflict)
 {
        ConflictManager conflMgr(careTaker);
 
-       ModeXMLParser modeparser("tizen_conflict2_mode.xml", ruleMgr, piMgr);
+       ModeXMLParser modeparser("tizen_conflict2_mode.xml", ruleMgr);
        EXPECT_TRUE(conflMgr.isConflict(modeparser.getMode()));
 }
index cf4e509aaa2b63dcdc452ebfffe964f01740acf0..3fd35d13d3c5dcd92d9b29088fc9d7f796ad6b98 100644 (file)
@@ -31,7 +31,6 @@ class GeneratorTest {
 public:
        GeneratorTest();
        RuleManager ruleMgr;
-       PluginManager piMgr;
 };
 MODES_NAMESPACE_END
 
@@ -40,16 +39,17 @@ GeneratorTest::GeneratorTest()
        ModesConfig config;
        config.actionRuleDir = ".";
        config.actionRuleXsdFile = "./" MODES_ACTIONRULE_DEFAULT_XSD_FILE;
+       config.pluginDir = ".";
 
-       ruleMgr.setOptions(config.actionRuleDir, config.actionRuleXsdFile);
-       ruleMgr.makeRuleMap();
+       ruleMgr.setOptions(config.actionRuleDir, config.actionRuleXsdFile, config.pluginDir);
+       ruleMgr.start();
 }
 
 TEST(XMLGenerator, makeModeXML)
 {
        GeneratorTest broker;
 
-       ModeXMLParser modeparser("tizen_ex1_mode.xml", broker.ruleMgr, broker.piMgr);
+       ModeXMLParser modeparser("tizen_ex1_mode.xml", broker.ruleMgr);
        Mode mode = modeparser.getMode();
 
        try {
@@ -60,7 +60,7 @@ TEST(XMLGenerator, makeModeXML)
                FAIL();
        }
 
-       ModeXMLParser genmodeparser("tizen_gen_ex1_mode.xml", broker.ruleMgr, broker.piMgr);
+       ModeXMLParser genmodeparser("tizen_gen_ex1_mode.xml", broker.ruleMgr);
        Mode genMode = genmodeparser.getMode();
 
        EXPECT_EQ("ex1", genmodeparser.getModeName());
@@ -78,7 +78,7 @@ TEST(XMLGenerator, exFileName)
 {
        GeneratorTest broker;
 
-       ModeXMLParser modeparser("tizen_ex1_mode.xml", broker.ruleMgr, broker.piMgr);
+       ModeXMLParser modeparser("tizen_ex1_mode.xml", broker.ruleMgr);
        Mode mode = modeparser.getMode();
 
        EXPECT_THROW({
index a437392adf999a6efce81973a42dd478c65d76fa..872f2bf32ae60583a5c56bd1c750b4c31acd10ed 100644 (file)
@@ -27,7 +27,7 @@ class ModeManagerTest {
 public:
        ModeManagerTest();
        RuleManager rMgr;
-       PluginManager pMgr;
+       PluginMapper pMgr;
        ModeManager mdMgr;
 
        set<string> getDirectories();
@@ -37,7 +37,7 @@ public:
 MODES_NAMESPACE_END
 
 ModeManagerTest::ModeManagerTest()
-       : mdMgr(rMgr, pMgr)
+       : mdMgr(rMgr)
 {
        ModesConfig config;
        config.modeXMLDirs.insert(".");
index ea4fece73a066b6441c83d1d9cfff7d44f82f9b1..28248b82ea94d494270c696a46023ef8b2d4c4ba 100644 (file)
@@ -42,7 +42,6 @@ protected:
        {
        }
 
-       PluginManager piMgr;
        RuleManager ruleMgr;
 };
 MODES_NAMESPACE_END
@@ -52,8 +51,9 @@ ParserTest::ParserTest()
        ModesConfig config;
        config.actionRuleDir = ".";
        config.actionRuleXsdFile = "./" MODES_ACTIONRULE_DEFAULT_XSD_FILE;
+       config.pluginDir = ".";
 
-       ruleMgr.setOptions(std::string(), config.actionRuleXsdFile);
+       ruleMgr.setOptions(std::string(), config.actionRuleXsdFile, config.pluginDir);
        ruleMgr.parseActionRule("./tizen_ex_rule.xml");
 }
 
@@ -64,42 +64,42 @@ list<shared_ptr<Action>> ParserTest::getActionList(Mode& m)
 
 TEST_F(ParserTest, getModeName)
 {
-       ModeXMLParser modeparser("tizen_ex1_mode.xml", ruleMgr, piMgr);
+       ModeXMLParser modeparser("tizen_ex1_mode.xml", ruleMgr);
 
        EXPECT_EQ("ex1", modeparser.getModeName());
 }
 
 TEST_F(ParserTest, modeGetName)
 {
-       ModeXMLParser modeparser("tizen_ex2_mode.xml", ruleMgr, piMgr);
+       ModeXMLParser modeparser("tizen_ex2_mode.xml", ruleMgr);
        Mode mode = modeparser.getMode();
        EXPECT_EQ("ex2", mode.getName());
 }
 
 TEST_F(ParserTest, isHiddenTrue)
 {
-       ModeXMLParser modeparser("tizen_ex2_mode.xml", ruleMgr, piMgr);
+       ModeXMLParser modeparser("tizen_ex2_mode.xml", ruleMgr);
 
        EXPECT_EQ(true, modeparser.isHidden());
 }
 
 TEST_F(ParserTest, isHiddenFalse)
 {
-       ModeXMLParser modeparser("tizen_ex1_mode.xml", ruleMgr, piMgr);
+       ModeXMLParser modeparser("tizen_ex1_mode.xml", ruleMgr);
 
        EXPECT_EQ(false, modeparser.isHidden());
 }
 
 TEST_F(ParserTest, getModeType)
 {
-       ModeXMLParser modeparser("tizen_ex1_mode.xml", ruleMgr, piMgr);
+       ModeXMLParser modeparser("tizen_ex1_mode.xml", ruleMgr);
        Mode mode = modeparser.getMode();
        EXPECT_EQ(Mode::MODE_NORMAL, mode.getModeType());
 }
 
 TEST_F(ParserTest, printAction)
 {
-       ModeXMLParser modeparser("tizen_ex1_mode.xml", ruleMgr, piMgr);
+       ModeXMLParser modeparser("tizen_ex1_mode.xml", ruleMgr);
        Mode mode = modeparser.getMode();
 
        list<std::shared_ptr<Action>> actionList = getActionList(mode);
@@ -114,10 +114,10 @@ TEST_F(ParserTest, printAction)
 
 TEST_F(ParserTest, invalidActionValue)
 {
-       ModeXMLParser modeparser1("tizen_invalid1_mode.xml", ruleMgr, piMgr);
+       ModeXMLParser modeparser1("tizen_invalid1_mode.xml", ruleMgr);
        EXPECT_THROW(modeparser1.getMode(), ModesEx);
 
-       ModeXMLParser modeparser2("tizen_invalid2_mode.xml", ruleMgr, piMgr);
+       ModeXMLParser modeparser2("tizen_invalid2_mode.xml", ruleMgr);
        EXPECT_THROW(modeparser2.getMode(), ModesEx);
 }
 
index bc1b59cc02d779cbc5460bcfb9f6bcd391b5ba79..6af5d7387bbe28289ac97a0811e901a3238c64fc 100644 (file)
@@ -15,7 +15,7 @@
  */
 #include <iostream>
 #include <gtest/gtest.h>
-#include "supervisor/PluginManager.h"
+#include "supervisor/PluginMapper.h"
 #include "supervisor/ModesEx.h"
 
 using namespace std;
@@ -26,7 +26,7 @@ public:
        bool emptyPluginMap();
        string getpluginDir();
 
-       PluginManager pMgr;
+       PluginMapper piMapper;
 };
 MODES_NAMESPACE_END
 
@@ -34,30 +34,30 @@ MODES_NAMESPACE_USE;
 
 bool TestPluginBroker::emptyPluginMap()
 {
-       return pMgr.pluginMap.empty();
+       return piMapper.pluginMap.empty();
 }
 
 string TestPluginBroker::getpluginDir()
 {
-       return pMgr.pluginDir;
+       return piMapper.pluginDir;
 }
 
-TEST(PluginManager, readLibraryList)
+TEST(PluginMapper, readLibraryList)
 {
        TestPluginBroker broker;
 
-       broker.pMgr.setPluginDir(MODES_PLUGIN_DEFAULT_DIR);
+       broker.piMapper.setPluginDir(MODES_PLUGIN_DEFAULT_DIR);
        try {
-               broker.pMgr.loadPlugins();
+               broker.piMapper.loadPlugins();
        }
        catch (ModesEx &e) {
-               broker.pMgr.setPluginDir("../plugin");
-               EXPECT_NO_THROW(broker.pMgr.loadPlugins());
+               broker.piMapper.setPluginDir("../plugin");
+               EXPECT_NO_THROW(broker.piMapper.loadPlugins());
        }
 
        EXPECT_FALSE(broker.emptyPluginMap());
 
-       list<string> pluginList = broker.pMgr.getPluginList();
+       list<string> pluginList = broker.piMapper.getPluginList();
        if (pluginList.empty()) {
                FAIL() << "getPluginList() Fail:This should never be reached";
        } else {
@@ -66,42 +66,42 @@ TEST(PluginManager, readLibraryList)
        }
 }
 
-TEST(PluginManager, setPluginDir)
+TEST(PluginMapper, setPluginDir)
 {
        TestPluginBroker broker;
 
        string path = "../plugin";
-       broker.pMgr.setPluginDir(path);
+       broker.piMapper.setPluginDir(path);
 
        EXPECT_EQ(path, broker.getpluginDir());
 }
 
-TEST(PluginManager, unloadClassMap)
+TEST(PluginMapper, unloadClassMap)
 {
        TestPluginBroker broker;
 
-       int ret = broker.pMgr.unloadPlugins();
+       int ret = broker.piMapper.unloadPlugins();
        EXPECT_EQ(ret, MODES_ERROR_NONE);
        EXPECT_TRUE(broker.emptyPluginMap());
 }
 
-TEST(PluginManager, getPluginTest)
+TEST(PluginMapper, getPluginTest)
 {
        int ret;
        TestPluginBroker broker;
 
-       broker.pMgr.setPluginDir(MODES_PLUGIN_DEFAULT_DIR);
+       broker.piMapper.setPluginDir(MODES_PLUGIN_DEFAULT_DIR);
        try {
-               broker.pMgr.loadPlugins();
+               broker.piMapper.loadPlugins();
        }
        catch (ModesEx &e) {
-               broker.pMgr.setPluginDir("../plugin");
-               EXPECT_NO_THROW(broker.pMgr.loadPlugins());
+               broker.piMapper.setPluginDir("../plugin");
+               EXPECT_NO_THROW(broker.piMapper.loadPlugins());
        }
 
        EXPECT_FALSE(broker.emptyPluginMap());
 
-       Plugin *plugin = broker.pMgr.getPlugin("test");
+       Plugin *plugin = broker.piMapper.getPlugin("test");
        ASSERT_TRUE(plugin != NULL);
 
        ret = plugin->set("testSetInt", 0, nullptr);
@@ -128,7 +128,7 @@ TEST(PluginManager, getPluginTest)
        string strVal = plugin->getString("testGetString");
        EXPECT_EQ(strVal, "test");
 
-       ret = broker.pMgr.unloadPlugins();
+       ret = broker.piMapper.unloadPlugins();
        EXPECT_EQ(ret, MODES_ERROR_NONE);
        EXPECT_TRUE(broker.emptyPluginMap());
 }
index ed67672834cd5d3ef399d8c6d165f38875d6e646..a5c25bacf919b963b7276dc66913841e7956aecf 100644 (file)
@@ -44,14 +44,15 @@ RuleManagerTest::RuleManagerTest()
        ModesConfig config;
        config.actionRuleDir = ".";
        config.actionRuleXsdFile = "./" MODES_ACTIONRULE_DEFAULT_XSD_FILE;
+       config.pluginDir = ".";
 
-       rMgr.setOptions(config.actionRuleDir, config.actionRuleXsdFile);
+       rMgr.setOptions(config.actionRuleDir, config.actionRuleXsdFile, config.pluginDir);
 }
 
 TEST(RuleManagerTest, makeRuleMapP)
 {
        RuleManagerTest testBroker;
-       EXPECT_NO_THROW(testBroker.rMgr.makeRuleMap());
+       EXPECT_NO_THROW(testBroker.rMgr.start());
 }
 
 TEST(RuleManagerTest, parseActionRuleP)