findCandidateResources can have the third parameter which is a waitTime
for discovering resources. If it is not specified, it acts like findResource.
It means, once any resource is discovered, it is immediately called, which
makes the test case failed if wrong resource is discovered.
To resolve this issue, we wait until a right resource id discovered.
Change-Id: Ib3d6f5595c955c8565d031d5fd2faf2ee904abe5
Signed-off-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/10703
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
lights.push_back((hostAddress + resourceURI));
g_light = (*rsrc);
lights.push_back((hostAddress + resourceURI));
g_light = (*rsrc);
}
else
{
configurationResource = (*rsrc);
}
else
{
configurationResource = (*rsrc);
vector<string> types;
types.push_back("oic.wk.con");
vector<string> types;
types.push_back("oic.wk.con");
- result = groupMgr->findCandidateResources(types, &foundResources);
+ result = groupMgr->findCandidateResources(types, &foundResources, 3);
std::mutex blocker;
std::unique_lock < std::mutex > lock(blocker);
std::mutex blocker;
std::unique_lock < std::mutex > lock(blocker);
vector<string> types;
types.push_back("oic.wk.con");
vector<string> types;
types.push_back("oic.wk.con");
- result = groupMgr->findCandidateResources(types, &foundResources);
+ result = groupMgr->findCandidateResources(types, &foundResources, 3);
std::mutex blocker;
std::unique_lock < std::mutex > lock(blocker);
std::mutex blocker;
std::unique_lock < std::mutex > lock(blocker);
vector<string> types;
types.push_back("oic.wk.con");
vector<string> types;
types.push_back("oic.wk.con");
- result = groupMgr->findCandidateResources(types, &foundResources);
+ result = groupMgr->findCandidateResources(types, &foundResources, 3);
std::mutex blocker2;
std::unique_lock < std::mutex > lock2(blocker2);
std::mutex blocker2;
std::unique_lock < std::mutex > lock2(blocker2);
vector<string> types;
types.push_back("oic.wk.con");
vector<string> types;
types.push_back("oic.wk.con");
- result = groupMgr->findCandidateResources(types, &foundResources);
+ result = groupMgr->findCandidateResources(types, &foundResources, 3);
std::mutex blocker2;
std::unique_lock < std::mutex > lock2(blocker2);
std::mutex blocker2;
std::unique_lock < std::mutex > lock2(blocker2);
vector<string> types;
types.push_back("oic.wk.mnt");
vector<string> types;
types.push_back("oic.wk.mnt");
- result = groupMgr->findCandidateResources(types, &foundResources);
+ result = groupMgr->findCandidateResources(types, &foundResources, 3);
std::mutex blocker;
std::unique_lock < std::mutex > lock(blocker);
std::mutex blocker;
std::unique_lock < std::mutex > lock(blocker);
vector<string> types;
types.push_back("oic.wk.mnt");
vector<string> types;
types.push_back("oic.wk.mnt");
- result = groupMgr->findCandidateResources(types, &foundResources);
+ result = groupMgr->findCandidateResources(types, &foundResources, 3);
std::mutex blocker;
std::unique_lock < std::mutex > lock(blocker);
std::mutex blocker;
std::unique_lock < std::mutex > lock(blocker);