From 9378122394680009804a5181275b16a6b71819dc Mon Sep 17 00:00:00 2001 From: coderhyme Date: Sun, 20 Sep 2015 23:25:15 -0700 Subject: [PATCH] Rename resource-encapsulation exception classes. It is to make class names consistent. All exposed classes in resource-encapsultion layer as the API must start with RCS. Change-Id: I64280bc959a60d368cfabab731196e35a7383a94 Signed-off-by: coderhyme Reviewed-on: https://gerrit.iotivity.org/gerrit/2817 Tested-by: jenkins-iotivity Reviewed-by: Hun-je Yeon Reviewed-by: Madan Lanka --- .../NotificationManager/src/HostingObject.cpp | 12 +++++----- .../NotificationManager/src/ResourceHosting.cpp | 8 +++---- .../NotificationManager/src/hosting.cpp | 4 ++-- .../src/main/jni/JniRcsDiscoveryManager.cpp | 2 +- .../src/main/jni/JniRcsRemoteResourceObject.cpp | 12 +++++----- .../service/src/main/jni/JniRcsResourceObject.cpp | 6 ++--- .../service/src/main/jni/util/JavaExceptions.cpp | 2 +- .../service/src/main/jni/util/JavaExceptions.h | 4 ++-- .../examples/linux/NestedAttributeServer.cpp | 2 +- .../examples/linux/SampleResourceClient.cpp | 6 ++--- .../examples/linux/SampleResourceServer.cpp | 2 +- .../NestedAttributeServerApp/src/reserver.cpp | 2 +- .../tizen/RESampleClientApp/src/reclient.cpp | 14 +++++------ .../tizen/RESampleServerApp/src/reserver.cpp | 2 +- .../resource-encapsulation/include/RCSException.h | 28 +++++++++++----------- .../include/RCSResourceAttributes.h | 4 ++-- .../src/common/expiryTimer/src/ExpiryTimerImpl.cpp | 4 ++-- .../common/primitiveResource/include/AssertUtils.h | 18 +++++++------- .../common/primitiveResource/src/RCSException.cpp | 22 ++++++++--------- .../src/RCSResourceAttributes.cpp | 6 ++--- .../unittests/PresenceSubscriberTest.cpp | 6 ++--- .../unittests/PrimitiveResourceTest.cpp | 8 +++---- .../unittests/ResourceAttributesTest.cpp | 6 ++--- .../src/resourceBroker/include/ResourceBroker.h | 4 ++-- .../src/resourceBroker/src/DevicePresence.cpp | 2 +- .../src/resourceBroker/src/ResourceBroker.cpp | 2 +- .../unittest/DevicePresenceUnitTest.cpp | 2 +- .../src/resourceClient/RCSDiscoveryManagerImpl.cpp | 2 +- .../src/resourceClient/RCSRemoteResourceObject.cpp | 14 +++++------ .../resourceContainer/src/DiscoverResourceUnit.cpp | 6 ++--- .../src/serverBuilder/src/RCSResourceObject.cpp | 2 +- .../unittests/RCSResourceObjectTest.cpp | 2 +- .../unittests/ResourceClientTest.cpp | 16 ++++++------- 33 files changed, 116 insertions(+), 116 deletions(-) diff --git a/service/notification-manager/NotificationManager/src/HostingObject.cpp b/service/notification-manager/NotificationManager/src/HostingObject.cpp index 3cb127e..3c0a1c3 100644 --- a/service/notification-manager/NotificationManager/src/HostingObject.cpp +++ b/service/notification-manager/NotificationManager/src/HostingObject.cpp @@ -111,7 +111,7 @@ void HostingObject::stateChangedCB(ResourceState state, RemoteObjectPtr rObject) try { rObject->startCaching(pDataUpdateCB); - }catch(InvalidParameterException &e) + }catch(const RCSInvalidParameterException &e) { OIC_HOSTING_LOG(DEBUG, "[HostingObject::stateChangedCB]startCaching InvalidParameterException:%s", @@ -128,7 +128,7 @@ void HostingObject::stateChangedCB(ResourceState state, RemoteObjectPtr rObject) try { rObject->stopCaching(); - }catch(InvalidParameterException &e) + }catch(const RCSInvalidParameterException &e) { OIC_HOSTING_LOG(DEBUG, "[HostingObject::stateChangedCB]stopCaching InvalidParameterException:%s", @@ -140,7 +140,7 @@ void HostingObject::stateChangedCB(ResourceState state, RemoteObjectPtr rObject) try { rObject->stopMonitoring(); - }catch(InvalidParameterException &e) + }catch(const RCSInvalidParameterException &e) { OIC_HOSTING_LOG(DEBUG, "[HostingObject::stateChangedCB]stopWatching InvalidParameterException:%s", @@ -170,7 +170,7 @@ void HostingObject::dataChangedCB(const RCSResourceAttributes & attributes, Remo try { mirroredServer = createMirroredServer(rObject); - }catch(PlatformException &e) + }catch(const RCSPlatformException &e) { OIC_HOSTING_LOG(DEBUG, "[HostingObject::dataChangedCB]createMirroredServer PlatformException:%s", @@ -237,7 +237,7 @@ HostingObject::ResourceObjectPtr HostingObject::createMirroredServer(RemoteObjec } else { - throw PlatformException(OC_STACK_ERROR); + throw RCSPlatformException(OC_STACK_ERROR); } return retResource; @@ -252,7 +252,7 @@ RCSSetResponse HostingObject::setRequestHandler(const RCSRequest & primitiveRequ RequestObject newRequest = { }; newRequest.invokeRequest(remoteObject, RequestObject::RequestMethod::Setter, resourceAttibutes); - }catch(PlatformException &e) + }catch(const RCSPlatformException &e) { OIC_HOSTING_LOG(DEBUG, "[HostingObject::setRequestHandler] PlatformException:%s", diff --git a/service/notification-manager/NotificationManager/src/ResourceHosting.cpp b/service/notification-manager/NotificationManager/src/ResourceHosting.cpp index a940417..0f05cbd 100644 --- a/service/notification-manager/NotificationManager/src/ResourceHosting.cpp +++ b/service/notification-manager/NotificationManager/src/ResourceHosting.cpp @@ -69,17 +69,17 @@ void ResourceHosting::startHosting() { requestMulticastPresence(); requestMulticastDiscovery(); - }catch(PlatformException &e) + }catch(const RCSPlatformException &e) { OIC_HOSTING_LOG(DEBUG, "[ResourceHosting::startHosting]PlatformException:%s", e.what()); throw; - }catch(InvalidParameterException &e) + }catch(const RCSInvalidParameterException &e) { OIC_HOSTING_LOG(DEBUG, "[ResourceHosting::startHosting]InvalidParameterException:%s", e.what()); throw; - }catch(std::exception &e) + }catch(const std::exception &e) { OIC_HOSTING_LOG(DEBUG, "[ResourceHosting::startHosting]std::exception:%s", e.what()); @@ -206,7 +206,7 @@ void ResourceHosting::discoverHandler(RemoteObjectPtr remoteResource) std::bind(&ResourceHosting::destroyedHostingObject, this, HostingObjectWeakPtr(foundHostingObject))); hostingObjectList.push_back(foundHostingObject); - }catch(InvalidParameterException &e) + }catch(const RCSInvalidParameterException &e) { OIC_HOSTING_LOG(DEBUG, "[ResourceHosting::discoverHandler]InvalidParameterException:%s", e.what()); diff --git a/service/notification-manager/NotificationManager/src/hosting.cpp b/service/notification-manager/NotificationManager/src/hosting.cpp index d222795..3d0ccfa 100644 --- a/service/notification-manager/NotificationManager/src/hosting.cpp +++ b/service/notification-manager/NotificationManager/src/hosting.cpp @@ -38,13 +38,13 @@ OCStackResult OICStartCoordinate() try { ResourceHosting::getInstance()->startHosting(); - }catch(PlatformException &e) + }catch(const RCSPlatformException &e) { OIC_HOSTING_LOG(DEBUG, "[OICStartCoordinate] platformException, reason:%s", e.what()); retResult = OC_STACK_ERROR; throw; - }catch(InvalidParameterException &e) + }catch(const RCSInvalidParameterException &e) { OIC_HOSTING_LOG(DEBUG, "[OICStartCoordinate] InvalidParameterException, reason:%s", e.what()); diff --git a/service/resource-encapsulation/android/service/src/main/jni/JniRcsDiscoveryManager.cpp b/service/resource-encapsulation/android/service/src/main/jni/JniRcsDiscoveryManager.cpp index 0d3f82a..f8e4833 100644 --- a/service/resource-encapsulation/android/service/src/main/jni/JniRcsDiscoveryManager.cpp +++ b/service/resource-encapsulation/android/service/src/main/jni/JniRcsDiscoveryManager.cpp @@ -117,7 +117,7 @@ Java_org_iotivity_service_client_RcsDiscoveryManager_nativeDiscoverResource( return taskObj; } - catch (const PlatformException& e) { + catch (const RCSPlatformException& e) { throwPlatformException(env, e); } diff --git a/service/resource-encapsulation/android/service/src/main/jni/JniRcsRemoteResourceObject.cpp b/service/resource-encapsulation/android/service/src/main/jni/JniRcsRemoteResourceObject.cpp index 91e4b99..d4116e2 100644 --- a/service/resource-encapsulation/android/service/src/main/jni/JniRcsRemoteResourceObject.cpp +++ b/service/resource-encapsulation/android/service/src/main/jni/JniRcsRemoteResourceObject.cpp @@ -297,7 +297,7 @@ Java_org_iotivity_service_client_RcsRemoteResourceObject_nativeStartMonitoring res->startMonitoring( std::bind(onStateChanged, std::placeholders::_1, JavaGlobalRef{ env, listener })); } - catch (const BadRequestException& e) + catch (const RCSBadRequestException& e) { env->ThrowNew(env->FindClass(EXC_NAME_ILLEGAL_STATE), e.what()); } @@ -348,7 +348,7 @@ Java_org_iotivity_service_client_RcsRemoteResourceObject_nativeStartCaching res->startCaching(); } } - catch (const BadRequestException& e) + catch (const RCSBadRequestException& e) { env->ThrowNew(env->FindClass(EXC_NAME_ILLEGAL_STATE), e.what()); } @@ -391,7 +391,7 @@ Java_org_iotivity_service_client_RcsRemoteResourceObject_nativeIsCachedAvailable { return res->isCachedAvailable(); } - catch (const BadRequestException& e) + catch (const RCSBadRequestException& e) { env->ThrowNew(env->FindClass(EXC_NAME_ILLEGAL_STATE), e.what()); return false; @@ -414,7 +414,7 @@ Java_org_iotivity_service_client_RcsRemoteResourceObject_nativeGetCachedAttribut return newAttributesObject(env, attrs); } - catch (const BadRequestException& e) + catch (const RCSBadRequestException& e) { env->ThrowNew(env->FindClass(EXC_NAME_ILLEGAL_STATE), e.what()); return { }; @@ -436,7 +436,7 @@ Java_org_iotivity_service_client_RcsRemoteResourceObject_nativeGetRemoteAttribut res->getRemoteAttributes(std::bind(onRemoteAttributesReceived, std::placeholders::_1, std::placeholders::_2, JavaGlobalRef{ env, listener })); } - catch (const PlatformException& e) { + catch (const RCSPlatformException& e) { throwPlatformException(env, e); } } @@ -457,7 +457,7 @@ Java_org_iotivity_service_client_RcsRemoteResourceObject_nativeSetRemoteAttribut res->setRemoteAttributes(attrs, std::bind(onRemoteAttributesReceived, std::placeholders::_1, std::placeholders::_2, JavaGlobalRef{ env, listener })); } - catch (const PlatformException& e) { + catch (const RCSPlatformException& e) { throwPlatformException(env, e); } } diff --git a/service/resource-encapsulation/android/service/src/main/jni/JniRcsResourceObject.cpp b/service/resource-encapsulation/android/service/src/main/jni/JniRcsResourceObject.cpp index 36a298d..f38d309 100644 --- a/service/resource-encapsulation/android/service/src/main/jni/JniRcsResourceObject.cpp +++ b/service/resource-encapsulation/android/service/src/main/jni/JniRcsResourceObject.cpp @@ -417,7 +417,7 @@ Java_org_iotivity_service_server_RcsResourceObject_nativeBuild return resourceObj; } - catch (const PlatformException& e) + catch (const RCSPlatformException& e) { LOGE("%s", e.what()); throwPlatformException(env, e); @@ -460,7 +460,7 @@ Java_org_iotivity_service_server_RcsResourceObject_nativeGetAttributeValue return valueObj; } - catch(const InvalidKeyException& e) + catch(const RCSInvalidKeyException& e) { return nullptr; } @@ -602,7 +602,7 @@ JNIEXPORT void JNICALL Java_org_iotivity_service_server_RcsResourceObject_native { res->notify(); } - catch (const PlatformException& e) { + catch (const RCSPlatformException& e) { throwPlatformException(env, e); } } diff --git a/service/resource-encapsulation/android/service/src/main/jni/util/JavaExceptions.cpp b/service/resource-encapsulation/android/service/src/main/jni/util/JavaExceptions.cpp index 52c9f34..74e6cfc 100644 --- a/service/resource-encapsulation/android/service/src/main/jni/util/JavaExceptions.cpp +++ b/service/resource-encapsulation/android/service/src/main/jni/util/JavaExceptions.cpp @@ -44,7 +44,7 @@ void clearJavaExceptions(JNIEnvWrapper* env) env->DeleteGlobalRef(g_cls_PlatformException); } -void throwPlatformException(JNIEnv* env, const OIC::Service::PlatformException& e) +void throwPlatformException(JNIEnv* env, const OIC::Service::RCSPlatformException& e) { auto msg = newStringObject(env, e.getReason()); VERIFY_NO_EXC(env); diff --git a/service/resource-encapsulation/android/service/src/main/jni/util/JavaExceptions.h b/service/resource-encapsulation/android/service/src/main/jni/util/JavaExceptions.h index ca2a6cc..eccbf0d 100644 --- a/service/resource-encapsulation/android/service/src/main/jni/util/JavaExceptions.h +++ b/service/resource-encapsulation/android/service/src/main/jni/util/JavaExceptions.h @@ -29,7 +29,7 @@ namespace OIC { namespace Service { - class PlatformException; + class RCSPlatformException; } } @@ -38,7 +38,7 @@ class JNIEnvWrapper; void initJavaExceptions(JNIEnvWrapper*); void clearJavaExceptions(JNIEnvWrapper*); -void throwPlatformException(JNIEnv*, const OIC::Service::PlatformException&); +void throwPlatformException(JNIEnv*, const OIC::Service::RCSPlatformException&); template < typename ENV > void throwRCSException(ENV* env, const char* msg) diff --git a/service/resource-encapsulation/examples/linux/NestedAttributeServer.cpp b/service/resource-encapsulation/examples/linux/NestedAttributeServer.cpp index ba1383b..86a8a3d 100644 --- a/service/resource-encapsulation/examples/linux/NestedAttributeServer.cpp +++ b/service/resource-encapsulation/examples/linux/NestedAttributeServer.cpp @@ -248,7 +248,7 @@ void initServer() { createResource(); } - catch (const PlatformException &e) + catch (const RCSPlatformException &e) { std::cout << "Exception in initServer : " << e.what() << std::endl; } diff --git a/service/resource-encapsulation/examples/linux/SampleResourceClient.cpp b/service/resource-encapsulation/examples/linux/SampleResourceClient.cpp index 197f8b0..82c8781 100644 --- a/service/resource-encapsulation/examples/linux/SampleResourceClient.cpp +++ b/service/resource-encapsulation/examples/linux/SampleResourceClient.cpp @@ -332,7 +332,7 @@ void getCachedAttributes() } } } - catch (const BadRequestException& e) + catch (const RCSBadRequestException& e) { std::cout << "Exception in getCachedAttributes : " << e.what() << std::endl; } @@ -346,11 +346,11 @@ void getCachedAttribute() << "\tvalue : " << resource->getCachedAttribute(defaultKey).get< int >() << std::endl; } - catch (const BadRequestException& e) + catch (const RCSBadRequestException& e) { std::cout << "Exception in getCachedAttribute : " << e.what() << std::endl; } - catch (const BadGetException& e) + catch (const RCSBadGetException& e) { std::cout << "Exception in getCachedAttribute : " << e.what() << std::endl; } diff --git a/service/resource-encapsulation/examples/linux/SampleResourceServer.cpp b/service/resource-encapsulation/examples/linux/SampleResourceServer.cpp index b1c67cf..983b375 100644 --- a/service/resource-encapsulation/examples/linux/SampleResourceServer.cpp +++ b/service/resource-encapsulation/examples/linux/SampleResourceServer.cpp @@ -160,7 +160,7 @@ void initServer() { createResource(); } - catch (const PlatformException& e) + catch (const RCSPlatformException& e) { std::cout << "Exception in initServer : " << e.what() << std::endl; } diff --git a/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/src/reserver.cpp b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/src/reserver.cpp index c90943b..7c2fb62 100644 --- a/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/src/reserver.cpp +++ b/service/resource-encapsulation/examples/tizen/NestedAttributeServerApp/src/reserver.cpp @@ -236,7 +236,7 @@ static void initServer() server = RCSResourceObject::Builder(resourceUri, resourceType, resourceInterface).setDiscoverable(true).setObservable(true).build(); } - catch (const PlatformException &e) + catch (const RCSPlatformException &e) { dlog_print(DLOG_ERROR, LOG_TAG, "#### Create resource exception! (%s)", e.what()); } diff --git a/service/resource-encapsulation/examples/tizen/RESampleClientApp/src/reclient.cpp b/service/resource-encapsulation/examples/tizen/RESampleClientApp/src/reclient.cpp index b07fb17..0d61537 100644 --- a/service/resource-encapsulation/examples/tizen/RESampleClientApp/src/reclient.cpp +++ b/service/resource-encapsulation/examples/tizen/RESampleClientApp/src/reclient.cpp @@ -195,12 +195,12 @@ static void startMonitoring(void *data, Evas_Object *obj, void *event_info) logMessage = logMessage + "Started Monitoring
"; resource->startMonitoring(&onResourceStateChanged); } - catch (const BadRequestException &e) + catch (const RCSBadRequestException &e) { logMessage = logMessage + "Exception BadRequest
"; dlog_print(DLOG_INFO, LOG_TAG, "#### Exception in isMonitoring : %s", e.what()); } - catch (const InvalidParameterException &e) + catch (const RCSInvalidParameterException &e) { logMessage = logMessage + "Exception Invalid Param
"; dlog_print(DLOG_INFO, LOG_TAG, "#### Exception in isMonitoring : %s", e.what()); @@ -303,7 +303,7 @@ static void startCaching(std::function cb) logMessage = logMessage + "Caching with callback
"; resource->startCaching(&onCacheUpdated); } - catch (const BadRequestException &e) + catch (const RCSBadRequestException &e) { logMessage = logMessage + "Exception BadRequest
"; dlog_print(DLOG_INFO, LOG_TAG, "#### Exception in startCaching : %s", e.what()); @@ -317,7 +317,7 @@ static void startCaching(std::function cb) logMessage = logMessage + "Caching without callback
"; resource->startCaching(); } - catch (const BadRequestException &e) + catch (const RCSBadRequestException &e) { logMessage = logMessage + "Exception BadRequest
"; dlog_print(DLOG_INFO, LOG_TAG, "#### Exception in startCaching : %s", e.what()); @@ -401,7 +401,7 @@ static void getCachedAttributes(void *data, Evas_Object *obj, void *event_info) } } } - catch (const BadRequestException &e) + catch (const RCSBadRequestException &e) { logMessage = "Exception Received
"; dlog_print(DLOG_INFO, LOG_TAG, "#### Exception in getCachedAttributes : %s", e.what()); @@ -430,12 +430,12 @@ static void getCachedAttribute(void *data, Evas_Object *obj, void *event_info) int attrValue = resource->getCachedAttribute(defaultKey).get< int >(); logMessage = logMessage + "VALUE:" + to_string(attrValue) + "
"; } - catch (const BadRequestException &e) + catch (const RCSBadRequestException &e) { logMessage = logMessage + "Exception BadRequest
"; dlog_print(DLOG_INFO, LOG_TAG, "#### Exception in getCachedAttribute : %s", e.what()); } - catch (const BadGetException &e) + catch (const RCSBadGetException &e) { logMessage = logMessage + "Exception BadGet
"; dlog_print(DLOG_INFO, LOG_TAG, "#### Exception in getCachedAttribute : %s", e.what()); diff --git a/service/resource-encapsulation/examples/tizen/RESampleServerApp/src/reserver.cpp b/service/resource-encapsulation/examples/tizen/RESampleServerApp/src/reserver.cpp index a7556f1..47aac09 100644 --- a/service/resource-encapsulation/examples/tizen/RESampleServerApp/src/reserver.cpp +++ b/service/resource-encapsulation/examples/tizen/RESampleServerApp/src/reserver.cpp @@ -178,7 +178,7 @@ static void initServer() server = RCSResourceObject::Builder(resourceUri, resourceType, resourceInterface).setDiscoverable(true).setObservable(true).build(); } - catch (const PlatformException &e) + catch (const RCSPlatformException &e) { dlog_print(DLOG_ERROR, LOG_TAG, "#### Create resource exception! (%s)", e.what()); } diff --git a/service/resource-encapsulation/include/RCSException.h b/service/resource-encapsulation/include/RCSException.h index 256ba59..acd45d3 100644 --- a/service/resource-encapsulation/include/RCSException.h +++ b/service/resource-encapsulation/include/RCSException.h @@ -80,10 +80,10 @@ namespace OIC * Thrown when OC layer returns an error. * */ - class PlatformException: public RCSException + class RCSPlatformException: public RCSException { public: - explicit PlatformException(OCStackResult reason); + explicit RCSPlatformException(OCStackResult reason); /** * Returns the reason. @@ -105,43 +105,43 @@ namespace OIC * Thrown when a request is not acceptable. * */ - class BadRequestException: public RCSException + class RCSBadRequestException: public RCSException { public: - explicit BadRequestException(const std::string& what); - explicit BadRequestException(std::string&& what); + explicit RCSBadRequestException(const std::string& what); + explicit RCSBadRequestException(std::string&& what); }; /** * Thrown when a parameter is not valid. * */ - class InvalidParameterException: public RCSException + class RCSInvalidParameterException: public RCSException { public: - explicit InvalidParameterException(const std::string& what); - explicit InvalidParameterException(std::string&& what); + explicit RCSInvalidParameterException(const std::string& what); + explicit RCSInvalidParameterException(std::string&& what); }; /** * Thrown when getting value with wrong template parameter. */ - class BadGetException: public RCSException + class RCSBadGetException: public RCSException { public: - explicit BadGetException(const std::string& what); - explicit BadGetException(std::string&& what); + explicit RCSBadGetException(const std::string& what); + explicit RCSBadGetException(std::string&& what); }; /** * Thrown when a key is invalid. * */ - class InvalidKeyException: public RCSException + class RCSInvalidKeyException: public RCSException { public: - explicit InvalidKeyException(const std::string& what); - explicit InvalidKeyException(std::string&& what); + explicit RCSInvalidKeyException(const std::string& what); + explicit RCSInvalidKeyException(std::string&& what); }; } diff --git a/service/resource-encapsulation/include/RCSResourceAttributes.h b/service/resource-encapsulation/include/RCSResourceAttributes.h index 670f77b..90afa5d 100644 --- a/service/resource-encapsulation/include/RCSResourceAttributes.h +++ b/service/resource-encapsulation/include/RCSResourceAttributes.h @@ -351,7 +351,7 @@ namespace OIC } catch (const boost::bad_get&) { - throw BadGetException{ "Wrong type" }; + throw RCSBadGetException{ "Wrong type" }; } } @@ -362,7 +362,7 @@ namespace OIC { return get< T >() == rhs; } - catch (const BadGetException&) + catch (const RCSBadGetException&) { return false; } diff --git a/service/resource-encapsulation/src/common/expiryTimer/src/ExpiryTimerImpl.cpp b/service/resource-encapsulation/src/common/expiryTimer/src/ExpiryTimerImpl.cpp index ac4b088..f7ca6bd 100644 --- a/service/resource-encapsulation/src/common/expiryTimer/src/ExpiryTimerImpl.cpp +++ b/service/resource-encapsulation/src/common/expiryTimer/src/ExpiryTimerImpl.cpp @@ -64,12 +64,12 @@ namespace OIC { if (delay < 0LL) { - throw InvalidParameterException{ "delay can't be negative." }; + throw RCSInvalidParameterException{ "delay can't be negative." }; } if (!cb) { - throw InvalidParameterException{ "callback is empty." }; + throw RCSInvalidParameterException{ "callback is empty." }; } return addTask(convertToTime(Milliseconds{ delay }), std::move(cb), generateId()); diff --git a/service/resource-encapsulation/src/common/primitiveResource/include/AssertUtils.h b/service/resource-encapsulation/src/common/primitiveResource/include/AssertUtils.h index 6faaf8c..c91f9d9 100644 --- a/service/resource-encapsulation/src/common/primitiveResource/include/AssertUtils.h +++ b/service/resource-encapsulation/src/common/primitiveResource/include/AssertUtils.h @@ -83,14 +83,14 @@ namespace OIC if (actual == r) return; } - throw PlatformException(actual); + throw RCSPlatformException(actual); } inline void expectOCStackResult(OCStackResult actual, OCStackResult expected) { if (actual != expected) { - throw PlatformException(actual); + throw RCSPlatformException(actual); } } @@ -111,7 +111,7 @@ namespace OIC } catch (const OC::OCException& e) { - throw PlatformException(e.code()); + throw RCSPlatformException(e.code()); } } @@ -127,7 +127,7 @@ namespace OIC } catch (const OC::OCException& e) { - throw PlatformException(e.code()); + throw RCSPlatformException(e.code()); } } @@ -142,7 +142,7 @@ namespace OIC } catch (const OC::OCException& e) { - throw PlatformException(e.code()); + throw RCSPlatformException(e.code()); } } @@ -159,7 +159,7 @@ namespace OIC } catch (const OC::OCException& e) { - throw PlatformException(e.code()); + throw RCSPlatformException(e.code()); } } @@ -177,7 +177,7 @@ namespace OIC } catch (const OC::OCException& e) { - throw PlatformException(e.code()); + throw RCSPlatformException(e.code()); } } @@ -194,7 +194,7 @@ namespace OIC } catch (const OC::OCException& e) { - throw PlatformException(e.code()); + throw RCSPlatformException(e.code()); } } @@ -212,7 +212,7 @@ namespace OIC } catch (const OC::OCException& e) { - throw PlatformException(e.code()); + throw RCSPlatformException(e.code()); } } diff --git a/service/resource-encapsulation/src/common/primitiveResource/src/RCSException.cpp b/service/resource-encapsulation/src/common/primitiveResource/src/RCSException.cpp index 02e8dce..b696718 100644 --- a/service/resource-encapsulation/src/common/primitiveResource/src/RCSException.cpp +++ b/service/resource-encapsulation/src/common/primitiveResource/src/RCSException.cpp @@ -51,62 +51,62 @@ namespace OIC } - PlatformException::PlatformException(OCStackResult reason) : + RCSPlatformException::RCSPlatformException(OCStackResult reason) : RCSException{ "Failed : " + OC::OCException::reason(reason) }, m_reason { reason } { } - OCStackResult PlatformException::getReasonCode() const + OCStackResult RCSPlatformException::getReasonCode() const { return m_reason; } - std::string PlatformException::getReason() const + std::string RCSPlatformException::getReason() const { return OC::OCException::reason(m_reason); } - BadRequestException::BadRequestException(const std::string& what) : + RCSBadRequestException::RCSBadRequestException(const std::string& what) : RCSException{ what } { } - BadRequestException::BadRequestException(std::string&& what) : + RCSBadRequestException::RCSBadRequestException(std::string&& what) : RCSException{ std::move(what) } { } - InvalidParameterException::InvalidParameterException(const std::string& what) : + RCSInvalidParameterException::RCSInvalidParameterException(const std::string& what) : RCSException{ what } { } - InvalidParameterException::InvalidParameterException(std::string&& what) : + RCSInvalidParameterException::RCSInvalidParameterException(std::string&& what) : RCSException{ std::move(what) } { } - BadGetException::BadGetException(const std::string& what) : + RCSBadGetException::RCSBadGetException(const std::string& what) : RCSException{ what } { } - BadGetException::BadGetException(std::string&& what) : + RCSBadGetException::RCSBadGetException(std::string&& what) : RCSException{ std::move(what) } { } - InvalidKeyException::InvalidKeyException(const std::string& what) : + RCSInvalidKeyException::RCSInvalidKeyException(const std::string& what) : RCSException{ what } { } - InvalidKeyException::InvalidKeyException(std::string&& what) : + RCSInvalidKeyException::RCSInvalidKeyException(std::string&& what) : RCSException{ std::move(what) } { } diff --git a/service/resource-encapsulation/src/common/primitiveResource/src/RCSResourceAttributes.cpp b/service/resource-encapsulation/src/common/primitiveResource/src/RCSResourceAttributes.cpp index 1318154..cb339ec 100644 --- a/service/resource-encapsulation/src/common/primitiveResource/src/RCSResourceAttributes.cpp +++ b/service/resource-encapsulation/src/common/primitiveResource/src/RCSResourceAttributes.cpp @@ -363,7 +363,7 @@ namespace OIC -> result_type { // should not reach here. - throw BadGetException(""); + throw RCSBadGetException(""); } auto RCSResourceAttributes::KeyValuePair::ConstValueVisitor::operator()( @@ -551,7 +551,7 @@ namespace OIC } catch (const std::out_of_range&) { - throw InvalidKeyException{ "No attribute named '" + key + "'" }; + throw RCSInvalidKeyException{ "No attribute named '" + key + "'" }; } } @@ -563,7 +563,7 @@ namespace OIC } catch (const std::out_of_range&) { - throw InvalidKeyException{ "No attribute named '" + key + "'" }; + throw RCSInvalidKeyException{ "No attribute named '" + key + "'" }; } } diff --git a/service/resource-encapsulation/src/common/primitiveResource/unittests/PresenceSubscriberTest.cpp b/service/resource-encapsulation/src/common/primitiveResource/unittests/PresenceSubscriberTest.cpp index 845737a..191e8ec 100644 --- a/service/resource-encapsulation/src/common/primitiveResource/unittests/PresenceSubscriberTest.cpp +++ b/service/resource-encapsulation/src/common/primitiveResource/unittests/PresenceSubscriberTest.cpp @@ -57,7 +57,7 @@ TEST_F(PresenceSubscriberNonMemberTest, SubscribePresenceThrowsIfResultIsNotOK) static_cast< SubscribePresence1>(OC::OCPlatform::subscribePresence)) .Return(OC_STACK_ERROR); - ASSERT_THROW(subscribePresence(handle, "", CONTYPE, SubscribeCallback()), PlatformException); + ASSERT_THROW(subscribePresence(handle, "", CONTYPE, SubscribeCallback()), RCSPlatformException); } TEST_F(PresenceSubscriberNonMemberTest, OCPlatformUnsubscribePresenceWillBeCalled) @@ -71,7 +71,7 @@ TEST_F(PresenceSubscriberNonMemberTest, UnsubscribePresenceThrowIfResultIsNotOK) { mocks.ExpectCallFuncOverload(OC::OCPlatform::unsubscribePresence).Return(OC_STACK_ERROR); - ASSERT_THROW(unsubscribePresence(handle), PlatformException); + ASSERT_THROW(unsubscribePresence(handle), RCSPlatformException); } class PresenceSubscriberTest: public TestWithMock @@ -126,7 +126,7 @@ TEST_F(PresenceSubscriberTest, ConstructorThrowsIfResultIsNotOK) static_cast< SubscribePresence1 >(OC::OCPlatform::subscribePresence)) .Return(OC_STACK_ERROR); - ASSERT_THROW(PresenceSubscriber(HOST, CONTYPE, SubscribeCallback()), PlatformException); + ASSERT_THROW(PresenceSubscriber(HOST, CONTYPE, SubscribeCallback()), RCSPlatformException); } TEST_F(PresenceSubscriberTest, IsSubscribingIfConstructedWithoutException) diff --git a/service/resource-encapsulation/src/common/primitiveResource/unittests/PrimitiveResourceTest.cpp b/service/resource-encapsulation/src/common/primitiveResource/unittests/PrimitiveResourceTest.cpp index 8f15ad5..6355fa5 100644 --- a/service/resource-encapsulation/src/common/primitiveResource/unittests/PrimitiveResourceTest.cpp +++ b/service/resource-encapsulation/src/common/primitiveResource/unittests/PrimitiveResourceTest.cpp @@ -82,7 +82,7 @@ TEST_F(PrimitiveResourceTest, RequestGetThrowsOCResourceGetReturnsNotOK) { mocks.OnCall(fakeResource, FakeOCResource::get).Return(OC_STACK_ERROR); - ASSERT_THROW(resource->requestGet(PrimitiveResource::GetCallback()), PlatformException); + ASSERT_THROW(resource->requestGet(PrimitiveResource::GetCallback()), RCSPlatformException); } TEST_F(PrimitiveResourceTest, RequestSetInvokesOCResourcePut) @@ -97,7 +97,7 @@ TEST_F(PrimitiveResourceTest, RequestSetThrowsOCResourcePutReturnsNotOK) mocks.OnCall(fakeResource, FakeOCResource::put).Return(OC_STACK_ERROR); ASSERT_THROW(resource->requestSet(RCSResourceAttributes{ }, PrimitiveResource::SetCallback()), - PlatformException); + RCSPlatformException); } TEST_F(PrimitiveResourceTest, RequestSetPassResourceAttributesToOCResourcePut) @@ -129,7 +129,7 @@ TEST_F(PrimitiveResourceTest, RequestObserveThrowsOCResourceObserveReturnsNotOK) { mocks.OnCall(fakeResource, FakeOCResource::observe).Return(OC_STACK_ERROR); - ASSERT_THROW(resource->requestObserve(PrimitiveResource::ObserveCallback()), PlatformException); + ASSERT_THROW(resource->requestObserve(PrimitiveResource::ObserveCallback()), RCSPlatformException); } TEST_F(PrimitiveResourceTest, DelegteGettersToOCResource) @@ -204,6 +204,6 @@ TEST_F(DiscoverResourceTest, ThrowsdWhenOCPlatformFindResourceReturnsNotOK) mocks.ExpectCallFuncOverload(static_cast(OC::OCPlatform::findResource)). Return(OC_STACK_ERROR); - EXPECT_THROW(discoverResource("", "", OCConnectivityType{ }, discovered), PlatformException); + EXPECT_THROW(discoverResource("", "", OCConnectivityType{ }, discovered), RCSPlatformException); } diff --git a/service/resource-encapsulation/src/common/primitiveResource/unittests/ResourceAttributesTest.cpp b/service/resource-encapsulation/src/common/primitiveResource/unittests/ResourceAttributesTest.cpp index 264ebf2..acb8732 100644 --- a/service/resource-encapsulation/src/common/primitiveResource/unittests/ResourceAttributesTest.cpp +++ b/service/resource-encapsulation/src/common/primitiveResource/unittests/ResourceAttributesTest.cpp @@ -53,12 +53,12 @@ TEST_F(ResourceAttributesTest, ValueThrowsIfTypeDoesNotMatch) resourceAttributes[KEY] = 1; auto& valueRef = resourceAttributes[KEY]; - ASSERT_THROW(valueRef.get< std::string >(), BadGetException); + ASSERT_THROW(valueRef.get< std::string >(), RCSBadGetException); } TEST_F(ResourceAttributesTest, GettingWithAtThrowsIfThereIsNoMatchedValue) { - ASSERT_THROW(resourceAttributes.at(KEY), InvalidKeyException); + ASSERT_THROW(resourceAttributes.at(KEY), RCSInvalidKeyException); } TEST_F(ResourceAttributesTest, CopyingValueDoesNotShareState) @@ -103,7 +103,7 @@ TEST_F(ResourceAttributesTest, GettingWithAtThrowsAfterRemoved) resourceAttributes.erase(KEY); - ASSERT_THROW(resourceAttributes.at(KEY), InvalidKeyException); + ASSERT_THROW(resourceAttributes.at(KEY), RCSInvalidKeyException); } TEST_F(ResourceAttributesTest, NoDataErasedIfKeyDoesNotMatch) diff --git a/service/resource-encapsulation/src/resourceBroker/include/ResourceBroker.h b/service/resource-encapsulation/src/resourceBroker/include/ResourceBroker.h index 56e2545..fee3837 100644 --- a/service/resource-encapsulation/src/resourceBroker/include/ResourceBroker.h +++ b/service/resource-encapsulation/src/resourceBroker/include/ResourceBroker.h @@ -44,11 +44,11 @@ namespace OIC InvalidParameterException(std::string&& what) : RCSException{ std::move(what) } {} }; - class FailedSubscribePresenceException: public PlatformException + class FailedSubscribePresenceException: public RCSPlatformException { public: FailedSubscribePresenceException(OCStackResult reason) - : PlatformException{reason} {} + : RCSPlatformException{reason} {} }; static ResourceBroker * getInstance(); diff --git a/service/resource-encapsulation/src/resourceBroker/src/DevicePresence.cpp b/service/resource-encapsulation/src/resourceBroker/src/DevicePresence.cpp index aade9e9..b3ada66 100644 --- a/service/resource-encapsulation/src/resourceBroker/src/DevicePresence.cpp +++ b/service/resource-encapsulation/src/resourceBroker/src/DevicePresence.cpp @@ -60,7 +60,7 @@ namespace OIC OC_LOG_V(DEBUG, BROKER_TAG, "subscribe Presence"); presenceSubscriber = PresenceSubscriber(address, BROKER_TRANSPORT, pSubscribeRequestCB); - } catch(PlatformException &e) + } catch(RCSPlatformException &e) { OC_LOG_V(DEBUG, BROKER_TAG, "exception in subscribe Presence %s", e.getReason().c_str()); diff --git a/service/resource-encapsulation/src/resourceBroker/src/ResourceBroker.cpp b/service/resource-encapsulation/src/resourceBroker/src/ResourceBroker.cpp index 0332bcd..fe1c852 100644 --- a/service/resource-encapsulation/src/resourceBroker/src/ResourceBroker.cpp +++ b/service/resource-encapsulation/src/resourceBroker/src/ResourceBroker.cpp @@ -84,7 +84,7 @@ namespace OIC OC_LOG_V(DEBUG, BROKER_TAG, "create the ResourcePresence."); presenceItem.reset(new ResourcePresence()); presenceItem->initializeResourcePresence(pResource); - }catch(PlatformException &e) + }catch(RCSPlatformException &e) { throw FailedSubscribePresenceException(e.getReasonCode()); } diff --git a/service/resource-encapsulation/src/resourceBroker/unittest/DevicePresenceUnitTest.cpp b/service/resource-encapsulation/src/resourceBroker/unittest/DevicePresenceUnitTest.cpp index 6d4b3de..e773f15 100644 --- a/service/resource-encapsulation/src/resourceBroker/unittest/DevicePresenceUnitTest.cpp +++ b/service/resource-encapsulation/src/resourceBroker/unittest/DevicePresenceUnitTest.cpp @@ -110,7 +110,7 @@ TEST_F(DevicePresenceTest,initializeDevicePresence_ErrorHandlingIfAbnormalResour MockingFunc(); mocks.OnCallFuncOverload(static_cast< subscribePresenceSig1 >(OC::OCPlatform::subscribePresence)).Return(OC_STACK_ERROR); - ASSERT_THROW(instance->initializeDevicePresence(pResource),PlatformException); + ASSERT_THROW(instance->initializeDevicePresence(pResource),RCSPlatformException); } diff --git a/service/resource-encapsulation/src/resourceClient/RCSDiscoveryManagerImpl.cpp b/service/resource-encapsulation/src/resourceClient/RCSDiscoveryManagerImpl.cpp index 660a126..0305d3e 100755 --- a/service/resource-encapsulation/src/resourceClient/RCSDiscoveryManagerImpl.cpp +++ b/service/resource-encapsulation/src/resourceClient/RCSDiscoveryManagerImpl.cpp @@ -81,7 +81,7 @@ namespace OIC { if (!cb) { - throw InvalidParameterException { "input Parameter(callback) is NULL" }; + throw RCSInvalidParameterException { "input Parameter(callback) is NULL" }; } DiscoverRequestInfo discoveryItem; diff --git a/service/resource-encapsulation/src/resourceClient/RCSRemoteResourceObject.cpp b/service/resource-encapsulation/src/resourceClient/RCSRemoteResourceObject.cpp index 0d5af4d..388ac21 100644 --- a/service/resource-encapsulation/src/resourceClient/RCSRemoteResourceObject.cpp +++ b/service/resource-encapsulation/src/resourceClient/RCSRemoteResourceObject.cpp @@ -157,13 +157,13 @@ namespace OIC if (!cb) { - throw InvalidParameterException{ "startMonitoring : Callback is NULL" }; + throw RCSInvalidParameterException{ "startMonitoring : Callback is NULL" }; } if (isMonitoring()) { OC_LOG(DEBUG, TAG, "startMonitoring : already started"); - throw BadRequestException{ "Monitoring already started." }; + throw RCSBadRequestException{ "Monitoring already started." }; } m_brokerId = ResourceBroker::getInstance()->hostResource(m_primitiveResource, @@ -209,7 +209,7 @@ namespace OIC if (isCaching()) { OC_LOG(DEBUG, TAG, "startCaching : already Started"); - throw BadRequestException{ "Caching already started." }; + throw RCSBadRequestException{ "Caching already started." }; } if (cb) @@ -271,12 +271,12 @@ namespace OIC if (!isCaching()) { - throw BadRequestException{ "Caching not started." }; + throw RCSBadRequestException{ "Caching not started." }; } if (!isCachedAvailable()) { - throw BadRequestException{ "Cache data is not available." }; + throw RCSBadRequestException{ "Cache data is not available." }; } return ResourceCacheManager::getInstance()->getCachedData(m_primitiveResource); @@ -316,7 +316,7 @@ namespace OIC if (!cb) { - throw InvalidParameterException{ "getRemoteAttributes : Callback is empty" }; + throw RCSInvalidParameterException{ "getRemoteAttributes : Callback is empty" }; } m_primitiveResource->requestGet( @@ -331,7 +331,7 @@ namespace OIC if (!cb) { - throw InvalidParameterException{ "setRemoteAttributes : Callback is empty" }; + throw RCSInvalidParameterException{ "setRemoteAttributes : Callback is empty" }; } m_primitiveResource->requestSet(attribute, diff --git a/service/resource-encapsulation/src/resourceContainer/src/DiscoverResourceUnit.cpp b/service/resource-encapsulation/src/resourceContainer/src/DiscoverResourceUnit.cpp index e34ff3b..a95f408 100644 --- a/service/resource-encapsulation/src/resourceContainer/src/DiscoverResourceUnit.cpp +++ b/service/resource-encapsulation/src/resourceContainer/src/DiscoverResourceUnit.cpp @@ -71,7 +71,7 @@ void DiscoverResourceUnit::startDiscover(DiscoverResourceInfo info, UpdatedCB up discoveryTask = RCSDiscoveryManager::getInstance()->discoverResourceByType( RCSAddress::multicast(), m_ResourceType, pDiscoveredCB); } - catch (InvalidParameterException &e) + catch (RCSInvalidParameterException &e) { // TODO Handle Exception return; @@ -112,7 +112,7 @@ void DiscoverResourceUnit::onUpdate(REMOTE_MSG msg, RCSRemoteResourceObject::Ptr { updatedResource->getCachedAttribute(m_AttrubuteName); } - catch (InvalidKeyException &e) + catch (RCSInvalidKeyException &e) { // TODO Handle Exception return; @@ -154,7 +154,7 @@ std::vector DiscoverResourceUnit::buildInputResour retVector.push_back(value); } - catch (InvalidKeyException &e) + catch (RCSInvalidKeyException &e) { // TODO Handle Exception } diff --git a/service/resource-encapsulation/src/serverBuilder/src/RCSResourceObject.cpp b/service/resource-encapsulation/src/serverBuilder/src/RCSResourceObject.cpp index 05b9268..261caf2 100644 --- a/service/resource-encapsulation/src/serverBuilder/src/RCSResourceObject.cpp +++ b/service/resource-encapsulation/src/serverBuilder/src/RCSResourceObject.cpp @@ -510,7 +510,7 @@ namespace OIC { autoNotify(!replaced.empty(), m_autoNotifyPolicy); return sendResponse(*this, request, response); - } catch (const PlatformException& e) { + } catch (const RCSPlatformException& e) { OC_LOG_V(ERROR, LOG_TAG, "Error : %s ", e.what()); return OC_EH_ERROR; } diff --git a/service/resource-encapsulation/src/serverBuilder/unittests/RCSResourceObjectTest.cpp b/service/resource-encapsulation/src/serverBuilder/unittests/RCSResourceObjectTest.cpp index 3e15bbc..223067d 100644 --- a/service/resource-encapsulation/src/serverBuilder/unittests/RCSResourceObjectTest.cpp +++ b/service/resource-encapsulation/src/serverBuilder/unittests/RCSResourceObjectTest.cpp @@ -42,7 +42,7 @@ constexpr int value{ 100 }; TEST(ResourceObjectBuilderCreateTest, ThrowIfUriIsInvalid) { - ASSERT_THROW(RCSResourceObject::Builder("", "", "").build(), PlatformException); + ASSERT_THROW(RCSResourceObject::Builder("", "", "").build(), RCSPlatformException); } class ResourceObjectBuilderTest: public TestWithMock diff --git a/service/resource-encapsulation/unittests/ResourceClientTest.cpp b/service/resource-encapsulation/unittests/ResourceClientTest.cpp index 64edc87..9f62ea6 100644 --- a/service/resource-encapsulation/unittests/ResourceClientTest.cpp +++ b/service/resource-encapsulation/unittests/ResourceClientTest.cpp @@ -146,7 +146,7 @@ private: TEST_F(RemoteResourceObjectTest, GetRemoteAttributesDoesNotAllowEmptyFunction) { - ASSERT_THROW(object->getRemoteAttributes({ }), InvalidParameterException); + ASSERT_THROW(object->getRemoteAttributes({ }), RCSInvalidParameterException); } TEST_F(RemoteResourceObjectTest, GetRemoteAttributesGetsAttributesOfServer) @@ -166,7 +166,7 @@ TEST_F(RemoteResourceObjectTest, GetRemoteAttributesGetsAttributesOfServer) TEST_F(RemoteResourceObjectTest, SetRemoteAttributesDoesNotAllowEmptyFunction) { - ASSERT_THROW(object->setRemoteAttributes({ }, { }), InvalidParameterException); + ASSERT_THROW(object->setRemoteAttributes({ }, { }), RCSInvalidParameterException); } TEST_F(RemoteResourceObjectTest, SetRemoteAttributesSetsAttributesOfServer) @@ -191,7 +191,7 @@ TEST_F(RemoteResourceObjectTest, MonitoringIsNotStartedByDefault) TEST_F(RemoteResourceObjectTest, StartMonitoringThrowsIfFunctionIsEmpty) { - ASSERT_THROW(object->startMonitoring({ }), InvalidParameterException); + ASSERT_THROW(object->startMonitoring({ }), RCSInvalidParameterException); } TEST_F(RemoteResourceObjectTest, IsMonitoringReturnsTrueAfterStartMonitoring) @@ -205,7 +205,7 @@ TEST_F(RemoteResourceObjectTest, StartMonitoringThrowsIfTryingToStartAgain) { object->startMonitoring(resourceStateChanged); - ASSERT_THROW(object->startMonitoring(resourceStateChanged), BadRequestException); + ASSERT_THROW(object->startMonitoring(resourceStateChanged), RCSBadRequestException); } TEST_F(RemoteResourceObjectTest, DefaultStateIsNone) @@ -229,7 +229,7 @@ TEST_F(RemoteResourceObjectTest, StartCachingThrowsIfTryingToStartAgain) { object->startCaching(cacheUpdatedCallback); - ASSERT_THROW(object->startCaching(), BadRequestException); + ASSERT_THROW(object->startCaching(), RCSBadRequestException); } TEST_F(RemoteResourceObjectTest, DefaultCacheStateIsNone) @@ -303,7 +303,7 @@ TEST_F(RemoteResourceObjectTest, DISABLED_CacheUpdatedCallbackBeCalledWithUpdate TEST_F(RemoteResourceObjectTest, GetCachedAttributesThrowsIfCachingIsNotStarted) { - ASSERT_THROW(object->getCachedAttributes(), BadRequestException); + ASSERT_THROW(object->getCachedAttributes(), RCSBadRequestException); } TEST_F(RemoteResourceObjectTest, CachedAttributesHasSameAttributesWithServer) @@ -320,7 +320,7 @@ TEST_F(RemoteResourceObjectTest, CachedAttributesHasSameAttributesWithServer) TEST_F(RemoteResourceObjectTest, GetCachedAttributeThrowsIfCachingIsNotStarted) { - ASSERT_THROW(object->getCachedAttribute(ATTR_KEY), BadRequestException); + ASSERT_THROW(object->getCachedAttribute(ATTR_KEY), RCSBadRequestException); } TEST_F(RemoteResourceObjectTest, GetCachedAttributeThrowsIfKeyIsInvalid) @@ -330,7 +330,7 @@ TEST_F(RemoteResourceObjectTest, GetCachedAttributeThrowsIfKeyIsInvalid) object->startCaching(cacheUpdatedCallback); Wait(); - ASSERT_THROW(object->getCachedAttribute(""), InvalidKeyException); + ASSERT_THROW(object->getCachedAttribute(""), RCSInvalidKeyException); } TEST_F(RemoteResourceObjectTest, HasSameUriWithServer) -- 2.7.4