Fix bugs for invalid uri in notificaiton service.
authorKIM JungYong <jyong2.kim@samsung.com>
Thu, 13 Apr 2017 06:15:12 +0000 (15:15 +0900)
committerUze Choi <uzchoi@samsung.com>
Thu, 13 Apr 2017 08:50:40 +0000 (08:50 +0000)
[Problem]
Notification service sync service does not working.

[Reason]
When notification service built with TEST=0 (by default),
Sync resource uri was registered as invalid.

[Fix]
Divided sync resource uri for test, was combined.

Change-Id: I979fd8169afc15cf747796894d98a1be9e9ef853
Signed-off-by: KIM JungYong <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18885
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
service/notification/cpp-wrapper/unittest/NSConsumerServiceTest2.cpp
service/notification/cpp-wrapper/unittest/NSProviderServiceSimulator.h
service/notification/src/consumer/NSConsumerCommunication.c
service/notification/unittest/NSProviderSimulator.h

index b0e4e6f..3bec0be 100644 (file)
@@ -264,8 +264,6 @@ TEST_F(NotificationServiceConsumerTest, ExpectSuccessSendSyncInfo)
 
 TEST_F(NotificationServiceConsumerTest, ExpectSuccessGetTopicsList)
 {
-    uint64_t msgId = 10;
-    OIC::Service::NSResult res = OIC::Service::NSResult::FAIL;
     std::string provId;
 
     ::NSProvider *provider = (::NSProvider *)malloc(sizeof(::NSProvider));
index 79b0b1a..edfa90c 100644 (file)
@@ -81,7 +81,7 @@ class NSProviderSimulator
         NSProviderSimulator()
             : m_notificationHandle(), m_messageHandle(), m_syncHandle(), m_topicHandle(),
               m_syncRep(), m_messageRep(), m_accepter(0),
-              m_notificationUri(std::string("/notificationTest")),
+              m_notificationUri(std::string("/notification")),
               m_messageUri(std::string("/message")),
               m_syncUri(std::string("/sync")),
               m_topicUri(std::string("/topic")),
index 0d74c56..38a022e 100644 (file)
 #include "oic_string.h"
 #include "ocpayload.h"
 
-#ifdef LOCAL_RUNNING
 #define NS_SYNC_URI "/notification/sync"
-#else
-#define NS_SYNC_URI "/notificationTest/sync"
-#endif
 
 NSSyncInfo * NSCreateSyncInfo_consumer(uint64_t msgId, const char * providerId, NSSyncType state);
 
index c66dc37..909a8a6 100644 (file)
@@ -80,7 +80,7 @@ public:
     NSProviderSimulator()
     : m_notificationHandle(), m_messageHandle(), m_syncHandle(), m_topicHandle(),
       m_syncRep(), m_messageRep(), m_accepter(0),
-      m_notificationUri(std::string("/notificationTest")),
+      m_notificationUri(std::string("/notification")),
       m_messageUri(std::string("/message")),
       m_syncUri(std::string("/sync")),
       m_topicUri(std::string("/topic")),