X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fnotification%2Funittest%2FNSConsumerSimulator.h;h=161a9ee91addece6beac7a93d7d18b94d69c2e94;hb=7f00f942c39b7bc27c7eeecf213a239c3fe4173c;hp=1a7a8ff857fa6aea773d1347417dc0670d43a409;hpb=edcfc3d2329da7b914771c0dcff5f42c9b74fd93;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/notification/unittest/NSConsumerSimulator.h b/service/notification/unittest/NSConsumerSimulator.h index 1a7a8ff..161a9ee 100644 --- a/service/notification/unittest/NSConsumerSimulator.h +++ b/service/notification/unittest/NSConsumerSimulator.h @@ -53,7 +53,7 @@ public: void findProvider() { - OC::OCPlatform::findResource("", std::string("/oic/res?rt=oic.wk.notification"), + OC::OCPlatform::findResource("", std::string("/oic/res?rt=x.org.iotivity.notification"), OCConnectivityType::CT_DEFAULT, std::bind(&NSConsumerSimulator::findResultCallback, this, std::placeholders::_1), OC::QualityOfService::LowQos); @@ -67,9 +67,9 @@ public: } OC::OCRepresentation rep; - rep.setValue("providerid", providerID); - rep.setValue("messageid", id); - rep.setValue("state", type); + rep.setValue("x.org.iotivity.ns.providerid", providerID); + rep.setValue("x.org.iotivity.ns.messageid", id); + rep.setValue("x.org.iotivity.ns.state", type); m_syncResource->post(rep, OC::QueryParamsMap(), &onPost, OC::QualityOfService::LowQos); } @@ -99,7 +99,7 @@ private: { if(resource->uri() == "/notification") { - resource->get(std::string("oic.wk.notification"), std::string("oic.if.baseline"), + resource->get(std::string("x.org.iotivity.notification"), std::string("oic.if.baseline"), OC::QueryParamsMap(), std::bind(&NSConsumerSimulator::onGet, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, resource), OC::QualityOfService::LowQos); @@ -110,12 +110,12 @@ private: std::shared_ptr resource) { OC::QueryParamsMap map; - map.insert(std::pair(std::string("consumerid"), + map.insert(std::pair(std::string("x.org.iotivity.ns.consumerid"), std::string("123456789012345678901234567890123456"))); try { - std::vector rts{"oic.wk.notification"}; + std::vector rts{"x.org.iotivity.notification"}; m_msgResource = OC::OCPlatform::constructResourceObject( @@ -155,17 +155,17 @@ private: const OC::OCRepresentation &rep , const int & /*eCode*/, const int &, std::shared_ptr ) { - if (rep.getUri() == "/notification/message" && rep.hasAttribute("messageid") - && rep.getValue("messageid") != 1) + if (rep.getUri() == "/notification/message" && rep.hasAttribute("x.org.iotivity.ns.messageid") + && rep.getValue("x.org.iotivity.ns.messageid") != 1) { - m_messageFunc(int(rep.getValue("messageid")), - std::string(rep.getValueToString("title")), - std::string(rep.getValueToString("contenttext")), - std::string(rep.getValueToString("source"))); + m_messageFunc(int(rep.getValue("x.org.iotivity.ns.messageid")), + std::string(rep.getValueToString("x.org.iotivity.ns.title")), + std::string(rep.getValueToString("x.org.iotivity.ns.contenttext")), + std::string(rep.getValueToString("x.org.iotivity.ns.source"))); - if(rep.getValue("messageid") == 3) + if(rep.getValue("x.org.iotivity.ns.messageid") == 3) { - m_topicResource->get(std::string("oic.wk.notification"), + m_topicResource->get(std::string("x.org.iotivity.notification"), std::string("oic.if.baseline"), OC::QueryParamsMap(), std::bind(&NSConsumerSimulator::onTopicGet, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, m_topicResource), @@ -174,7 +174,7 @@ private: } else if (rep.getUri() == "/notification/sync") { - m_syncFunc(int(rep.getValue("state")), int(rep.getValue("messageid"))); + m_syncFunc(int(rep.getValue("x.org.iotivity.ns.state")), int(rep.getValue("x.org.iotivity.ns.messageid"))); } } @@ -189,7 +189,7 @@ private: OC::OCRepresentation postRep; std::vector topicArr = - rep.getValue>("topiclist"); + rep.getValue>("x.org.iotivity.ns.topiclist"); std::vector postTopicArr; @@ -200,8 +200,8 @@ private: OC::OCRepresentation topic = *it; OC::OCRepresentation postTopic; - postTopic.setValue("topicname", topic.getValueToString("topicname")); - postTopic.setValue("topicstate", (int) topic.getValue("topicstate")); + postTopic.setValue("x.org.iotivity.ns.topicname", topic.getValueToString("x.org.iotivity.ns.topicname")); + postTopic.setValue("x.org.iotivity.ns.topicstate", (int) topic.getValue("x.org.iotivity.ns.topicstate")); postTopicArr.push_back(topic); @@ -210,10 +210,10 @@ private: } postRep.setValue> - ("topiclist", postTopicArr); + ("x.org.iotivity.ns.topiclist", postTopicArr); OC::QueryParamsMap map; - map.insert(std::pair(std::string("consumerid"), + map.insert(std::pair(std::string("x.org.iotivity.ns.consumerid"), std::string("123456789012345678901234567890123456"))); m_topicResource->post(postRep, map, &onPost, OC::QualityOfService::LowQos); }