Renamed startWaching, stopWatching apis to startMonitoring, stopMonitoring
authorJay Sharma <jay.sharma@samsung.com>
Sat, 18 Jul 2015 11:10:44 +0000 (16:40 +0530)
committerUze Choi <uzchoi@samsung.com>
Sat, 18 Jul 2015 14:30:22 +0000 (14:30 +0000)
- updated ResourceClient
- updated SampleResourceClient linux application.
- updated unittestcases of ResourceClient

Change-Id: I9f64e6218d7ff46b511f82401c65a0eee7bfff0b
Signed-off-by: Jay Sharma <jay.sharma@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1730
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
service/resource-manipulation/examples/linux/SampleResourceClient.cpp
service/resource-manipulation/include/ResourceClient.h
service/resource-manipulation/src/ResourceClient.cpp
service/resource-manipulation/unittests/ResourceClient_Test.cpp

index d7b7f7f..53ed6ef 100644 (file)
@@ -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)
index 1990091..128b6e4 100644 (file)
@@ -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.
index f24776f..f181a1f 100644 (file)
@@ -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)
index 7e861ef..e4cfc1c 100644 (file)
@@ -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