From e0bd950e4c896f413eed02e9d1105a24b44e1dc0 Mon Sep 17 00:00:00 2001 From: YounghyunJoo Date: Mon, 27 Jul 2015 16:41:22 +0900 Subject: [PATCH] Update ResourceCache Unittest code files Change-Id: Ic5dab8f0f90fad94f464c68b5ae608415547ed2b Signed-off-by: YounghyunJoo Reviewed-on: https://gerrit.iotivity.org/gerrit/1931 Tested-by: jenkins-iotivity Reviewed-by: Madan Lanka --- .../src/resourceCache/unittests/DataCacheTest.cpp | 20 ++++++++++---------- .../resourceCache/unittests/ResourceCacheTest.cpp | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/service/resource-encapsulation/src/resourceCache/unittests/DataCacheTest.cpp b/service/resource-encapsulation/src/resourceCache/unittests/DataCacheTest.cpp index c93fe6b..3dca911 100644 --- a/service/resource-encapsulation/src/resourceCache/unittests/DataCacheTest.cpp +++ b/service/resource-encapsulation/src/resourceCache/unittests/DataCacheTest.cpp @@ -58,7 +58,7 @@ TEST_F(DataCacheTest, initializeDataCache_normalCase) mocks.ExpectCall(pResource.get(), PrimitiveResource::requestGet); mocks.ExpectCall(pResource.get(), PrimitiveResource::isObservable).Return(true); mocks.ExpectCall(pResource.get(), PrimitiveResource::requestObserve); - mocks.ExpectCall(pResource.get(), PrimitiveResource::cancelObserve); + mocks.OnCall(pResource.get(), PrimitiveResource::cancelObserve); cacheHandler->initializeDataCache(pResource); } @@ -122,7 +122,7 @@ TEST_F(DataCacheTest, initializeDataCache_normalCaseTimeOut) mocks.ExpectCall(pResource.get(), PrimitiveResource::requestGet); mocks.ExpectCall(pResource.get(), PrimitiveResource::isObservable).Return(true); mocks.ExpectCall(pResource.get(), PrimitiveResource::requestObserve); - mocks.ExpectCall(pResource.get(), PrimitiveResource::cancelObserve); + mocks.OnCall(pResource.get(), PrimitiveResource::cancelObserve); cacheHandler->initializeDataCache(pResource); @@ -135,7 +135,7 @@ TEST_F(DataCacheTest, addSubscriber_normalCase) mocks.ExpectCall(pResource.get(), PrimitiveResource::requestGet); mocks.ExpectCall(pResource.get(), PrimitiveResource::isObservable).Return(true); mocks.ExpectCall(pResource.get(), PrimitiveResource::requestObserve); - mocks.ExpectCall(pResource.get(), PrimitiveResource::cancelObserve); + mocks.OnCall(pResource.get(), PrimitiveResource::cancelObserve); cacheHandler->initializeDataCache(pResource); REPORT_FREQUENCY rf = REPORT_FREQUENCY::UPTODATE; @@ -150,7 +150,7 @@ TEST_F(DataCacheTest, deleteSubsciber_normalCase) mocks.ExpectCall(pResource.get(), PrimitiveResource::requestGet); mocks.ExpectCall(pResource.get(), PrimitiveResource::isObservable).Return(true); mocks.ExpectCall(pResource.get(), PrimitiveResource::requestObserve); - mocks.ExpectCall(pResource.get(), PrimitiveResource::cancelObserve); + mocks.OnCall(pResource.get(), PrimitiveResource::cancelObserve); cacheHandler->initializeDataCache(pResource); @@ -168,7 +168,7 @@ TEST_F(DataCacheTest, getCacheState_normalCase) mocks.ExpectCall(pResource.get(), PrimitiveResource::requestGet); mocks.ExpectCall(pResource.get(), PrimitiveResource::isObservable).Return(true); mocks.ExpectCall(pResource.get(), PrimitiveResource::requestObserve); - mocks.ExpectCall(pResource.get(), PrimitiveResource::cancelObserve); + mocks.OnCall(pResource.get(), PrimitiveResource::cancelObserve); cacheHandler->initializeDataCache(pResource); @@ -181,7 +181,7 @@ TEST_F(DataCacheTest, getCachedData_normalCase) mocks.ExpectCall(pResource.get(), PrimitiveResource::requestGet); mocks.ExpectCall(pResource.get(), PrimitiveResource::isObservable).Return(true); mocks.ExpectCall(pResource.get(), PrimitiveResource::requestObserve); - mocks.ExpectCall(pResource.get(), PrimitiveResource::cancelObserve); + mocks.OnCall(pResource.get(), PrimitiveResource::cancelObserve); cacheHandler->initializeDataCache(pResource); @@ -194,7 +194,7 @@ TEST_F(DataCacheTest, getPrimitiveResource_normalCase) mocks.ExpectCall(pResource.get(), PrimitiveResource::requestGet); mocks.ExpectCall(pResource.get(), PrimitiveResource::isObservable).Return(true); mocks.ExpectCall(pResource.get(), PrimitiveResource::requestObserve); - mocks.ExpectCall(pResource.get(), PrimitiveResource::cancelObserve); + mocks.OnCall(pResource.get(), PrimitiveResource::cancelObserve); cacheHandler->initializeDataCache(pResource); @@ -208,7 +208,7 @@ TEST_F(DataCacheTest, requestGet_normalCase) mocks.ExpectCall(pResource.get(), PrimitiveResource::isObservable).Return(true); mocks.ExpectCall(pResource.get(), PrimitiveResource::requestObserve); mocks.ExpectCall(pResource.get(), PrimitiveResource::requestGet); - mocks.ExpectCall(pResource.get(), PrimitiveResource::cancelObserve); + mocks.OnCall(pResource.get(), PrimitiveResource::cancelObserve); cacheHandler->initializeDataCache(pResource); @@ -221,7 +221,7 @@ TEST_F(DataCacheTest, isEmptySubscriber_normalCase) mocks.ExpectCall(pResource.get(), PrimitiveResource::requestGet); mocks.ExpectCall(pResource.get(), PrimitiveResource::isObservable).Return(true); mocks.ExpectCall(pResource.get(), PrimitiveResource::requestObserve); - mocks.ExpectCall(pResource.get(), PrimitiveResource::cancelObserve); + mocks.OnCall(pResource.get(), PrimitiveResource::cancelObserve); cacheHandler->initializeDataCache(pResource); @@ -250,7 +250,7 @@ TEST_F(DataCacheTest, requestGet_normalCasetest) return; } ); - mocks.ExpectCall(pResource.get(), PrimitiveResource::cancelObserve); + mocks.OnCall(pResource.get(), PrimitiveResource::cancelObserve); cacheHandler->initializeDataCache(pResource); diff --git a/service/resource-encapsulation/src/resourceCache/unittests/ResourceCacheTest.cpp b/service/resource-encapsulation/src/resourceCache/unittests/ResourceCacheTest.cpp index 3f82f03..f966d6f 100644 --- a/service/resource-encapsulation/src/resourceCache/unittests/ResourceCacheTest.cpp +++ b/service/resource-encapsulation/src/resourceCache/unittests/ResourceCacheTest.cpp @@ -68,7 +68,7 @@ TEST_F(ResourceCacheManagerTest, requestResourceCache_reportTimeIsNULL) mocks.ExpectCall(pResource.get(), PrimitiveResource::requestGet); mocks.ExpectCall(pResource.get(), PrimitiveResource::isObservable).Return(true); mocks.ExpectCall(pResource.get(), PrimitiveResource::requestObserve); - mocks.ExpectCall(pResource.get(), PrimitiveResource::cancelObserve); + mocks.OnCall(pResource.get(), PrimitiveResource::cancelObserve); CacheCB func = cb; REPORT_FREQUENCY rf = REPORT_FREQUENCY::UPTODATE; @@ -86,7 +86,7 @@ TEST_F(ResourceCacheManagerTest, requestResourceCache_normalCase) mocks.ExpectCall(pResource.get(), PrimitiveResource::requestGet); mocks.ExpectCall(pResource.get(), PrimitiveResource::isObservable).Return(true); mocks.ExpectCall(pResource.get(), PrimitiveResource::requestObserve); - mocks.ExpectCall(pResource.get(), PrimitiveResource::cancelObserve); + mocks.OnCall(pResource.get(), PrimitiveResource::cancelObserve); CacheCB func = cb; REPORT_FREQUENCY rf = REPORT_FREQUENCY::UPTODATE; @@ -111,7 +111,7 @@ TEST_F(ResourceCacheManagerTest, cancelResourceCache_normalCase) mocks.ExpectCall(pResource.get(), PrimitiveResource::requestGet); mocks.ExpectCall(pResource.get(), PrimitiveResource::isObservable).Return(true); mocks.ExpectCall(pResource.get(), PrimitiveResource::requestObserve); - mocks.ExpectCall(pResource.get(), PrimitiveResource::cancelObserve); + mocks.OnCall(pResource.get(), PrimitiveResource::cancelObserve); CacheCB func = cb; REPORT_FREQUENCY rf = REPORT_FREQUENCY::UPTODATE; -- 2.7.4