From: Jay Sharma Date: Sat, 18 Jul 2015 11:10:44 +0000 (+0530) Subject: Renamed startWaching, stopWatching apis to startMonitoring, stopMonitoring X-Git-Tag: 0.9.2-RC1^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6b90306672aa780a547ea1d963edcf68c2744b81;p=contrib%2Fiotivity.git Renamed startWaching, stopWatching apis to startMonitoring, stopMonitoring - updated ResourceClient - updated SampleResourceClient linux application. - updated unittestcases of ResourceClient Change-Id: I9f64e6218d7ff46b511f82401c65a0eee7bfff0b Signed-off-by: Jay Sharma Reviewed-on: https://gerrit.iotivity.org/gerrit/1730 Reviewed-by: Uze Choi Tested-by: Uze Choi --- diff --git a/service/resource-manipulation/examples/linux/SampleResourceClient.cpp b/service/resource-manipulation/examples/linux/SampleResourceClient.cpp index d7b7f7f..53ed6ef 100644 --- a/service/resource-manipulation/examples/linux/SampleResourceClient.cpp +++ b/service/resource-manipulation/examples/linux/SampleResourceClient.cpp @@ -163,17 +163,17 @@ int main() { 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) diff --git a/service/resource-manipulation/include/ResourceClient.h b/service/resource-manipulation/include/ResourceClient.h index 1990091..128b6e4 100644 --- a/service/resource-manipulation/include/ResourceClient.h +++ b/service/resource-manipulation/include/ResourceClient.h @@ -158,12 +158,12 @@ namespace OIC * @throw InvalidParameterException * */ - void startWatching(ResourceStateChangedCallback); + void startMonitoring(ResourceStateChangedCallback cb); /** * API to stop watching the resource. */ - void stopWatching(); + void stopMonitoring(); /** * API to get resource state. diff --git a/service/resource-manipulation/src/ResourceClient.cpp b/service/resource-manipulation/src/ResourceClient.cpp index f24776f..f181a1f 100644 --- a/service/resource-manipulation/src/ResourceClient.cpp +++ b/service/resource-manipulation/src/ResourceClient.cpp @@ -179,7 +179,7 @@ namespace OIC 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) @@ -204,7 +204,7 @@ namespace OIC 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) diff --git a/service/resource-manipulation/unittests/ResourceClient_Test.cpp b/service/resource-manipulation/unittests/ResourceClient_Test.cpp index 7e861ef..e4cfc1c 100644 --- a/service/resource-manipulation/unittests/ResourceClient_Test.cpp +++ b/service/resource-manipulation/unittests/ResourceClient_Test.cpp @@ -150,9 +150,9 @@ TEST(ResourceClientTest, testStartWatchingFail) { createResource(); object->m_watchingFlag = false; - object->startWatching(NULL); + object->startMonitoring(NULL); EXPECT_TRUE(object->m_watchingFlag); - object->stopWatching(); + object->stopMonitoring(); destroyResource(); } @@ -160,9 +160,9 @@ TEST(ResourceClientTest, testStartWatchingFail) TEST(ResourceClientTest, testStartWatchingPass) { createResource(); - object->startWatching(&onResourceStateChanged); + object->startMonitoring(&onResourceStateChanged); EXPECT_TRUE(object->m_watchingFlag); - object->stopWatching(); + object->stopMonitoring(); destroyResource(); } @@ -170,10 +170,10 @@ TEST(ResourceClientTest, testStartWatchingPass) 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(); } @@ -341,7 +341,7 @@ TEST(ResourceClientTest, testDiscoverResourceEmptyCallback) DiscoveryManager *instance = DiscoveryManager::getInstance(); EXPECT_THROW(instance->discoverResource("", uri, CT_DEFAULT, NULL), InvalidParameterException); destroyResource(); - object->stopWatching(); + object->stopMonitoring(); } //Send invalid ResourceAttributes object to function