-
- std::cout << "\n==== 2nd TEST CASE =====" << std::endl;
- std::cout << "======================" << std::endl;
- std::cout << "Get Plugin List\n" << std::endl;
- std::vector<Plugin> user_plugin;
-
- user_plugin = m_pm->getPlugins();
-
- for (unsigned int i = 0; i < user_plugin.size(); i++)
- {
- std::cout << "value Name = " << user_plugin[i].getName() << std::endl;
- std::cout << "value ID = " << user_plugin[i].getID() << std::endl;
- id = user_plugin[i].getID();
- }
- std::cout << "\n===== 3rd TEST CASE =====" << std::endl;
- std::cout << "======================" << std::endl;
- std::cout << "Start Fan Plugin by Name\n" << std::endl;
-
- name = user_plugin[0].getName();
- m_pm->startPlugins(key, name);
-
- sleep(5);
-
- std::cout << "\n====== 4th TEST CASE ======" << std::endl;
- std::cout << "========================" << std::endl;
- std::cout << "Get Plugin Status\n" << std::endl;
-
- state = m_pm->getState(id);
-
- std::cout << "last plugin status : " << state << std::endl;
- std::cout << "sleep 15 seconds please add new plugin in the plugin folder " << std::endl;
-
- sleep(15);
-
- std::cout << "\n==== 5th TEST CASE ====" << std::endl;
- std::cout << "========================" << std::endl;
- std::cout << "Rescan Plugins.........\n" << std::endl;
-
- m_pm->rescanPlugin();
-
- std::cout << "\n==== 6th TEST CASE ====" << std::endl;
- std::cout << "========================" << std::endl;
- std::cout << "Try to start new resource type.........\n" << std::endl;
- std::cout << "start oic.test resource" << std::endl;
-
- sleep(5);
-
- int flag = m_pm->startPlugins("ResourceType", "oic.test");
-
- if (!flag)
- std::cout << "There are no resouce type. Start plugin failed" << std::endl;
- // Start each client in a seperate thread
-
- sleep(10);
-
- std::cout << "\n====== 7th TEST CASE =======" << std::endl;
- std::cout << "========================" << std::endl;
- std::cout << " start client to find resource" << std::endl;
-
- std::thread t1(client1);
- t1.detach();
-
- sleep(5);
-
- // Start each client in a seperate thread
- std::thread t2(client2);
- t2.detach();
-