{
try
{
- resource->startWatching(&OnResourceStateChanged);
+ resource->startMonitoring(&OnResourceStateChanged);
cout << "\n\n********** Hosting Started ***********" << std::endl;
}
catch (InvalidParameterException e)
{
- cout << "Exeception in startWatching :: " << e.what() << std::endl;
+ cout << "Exeception in startMonitoring :: " << e.what() << std::endl;
}
}
else if (userInput == 2)
{
- resource->stopWatching();
+ resource->stopMonitoring();
cout << "\n\n****** Hosting stopped******" << std::endl;
}
else if (userInput == 3)
return m_cachingFlag;
}
- void RemoteResourceObject::startWatching(ResourceStateChangedCallback cb)
+ void RemoteResourceObject::startMonitoring(ResourceStateChangedCallback cb)
{
OC_LOG(DEBUG, CLIENT_W_TAG, "RemoteResourceObject::startWatching entry");
if (true == m_watchingFlag)
OC_LOG(DEBUG, CLIENT_W_TAG, "RemoteResourceObject::startWatching exit");
}
- void RemoteResourceObject::stopWatching()
+ void RemoteResourceObject::stopMonitoring()
{
OC_LOG(DEBUG, CLIENT_W_TAG, "RemoteResourceObject::stopWatching entry");
if (true == m_watchingFlag)
{
createResource();
object->m_watchingFlag = false;
- object->startWatching(NULL);
+ object->startMonitoring(NULL);
EXPECT_TRUE(object->m_watchingFlag);
- object->stopWatching();
+ object->stopMonitoring();
destroyResource();
}
TEST(ResourceClientTest, testStartWatchingPass)
{
createResource();
- object->startWatching(&onResourceStateChanged);
+ object->startMonitoring(&onResourceStateChanged);
EXPECT_TRUE(object->m_watchingFlag);
- object->stopWatching();
+ object->stopMonitoring();
destroyResource();
}
TEST(ResourceClientTest, testStopWatching)
{
createResource();
- object->startWatching(&onResourceStateChanged);
- object->stopWatching();
+ object->startMonitoring(&onResourceStateChanged);
+ object->stopMonitoring();
EXPECT_FALSE(object->m_watchingFlag);
- object->startWatching(&onResourceStateChanged);
+ object->startMonitoring(&onResourceStateChanged);
destroyResource();
}
DiscoveryManager *instance = DiscoveryManager::getInstance();
EXPECT_THROW(instance->discoverResource("", uri, CT_DEFAULT, NULL), InvalidParameterException);
destroyResource();
- object->stopWatching();
+ object->stopMonitoring();
}
//Send invalid ResourceAttributes object to function