[ 
https://issues.apache.org/jira/browse/GEODE-9249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17343571#comment-17343571
 ] 

ASF GitHub Bot commented on GEODE-9249:
---------------------------------------

pivotal-jbarrett commented on a change in pull request #804:
URL: https://github.com/apache/geode-native/pull/804#discussion_r631382687



##########
File path: cppcache/integration/test/CachingProxyTest.cpp
##########
@@ -51,86 +53,67 @@ class CachingProxyTest : public ::testing::Test {
 
   ~CachingProxyTest() override = default;
 
-  void SetUp() override {}
+  void SetUp() override {
+    cache.getPoolManager()
+        .createFactory()
+        .addLocator("localhost", cluster.getLocatorPort())
+        .create("pool");
+
+    region = cache.createRegionFactory(RegionShortcut::CACHING_PROXY)
+                 .setPoolName("pool")
+                 .create("region");
+  }
 
   void TearDown() override {}
 
   Cluster cluster = Cluster{LocatorCount{1}, ServerCount{1}};
+  Cache cache = CacheFactory().create();
   std::string key = std::string("scharles");
   std::string value = std::string("Sylvia Charles");
+  std::shared_ptr<Region> region;
 };
 
 TEST_F(CachingProxyTest, LocalRemoveAfterLocalInvalidate) {
-  auto cache = CacheFactory().create();
-
-  cache.getPoolManager()
-      .createFactory()
-      .addLocator("localhost", cluster.getLocatorPort())
-      .create("pool");
-
-  auto region = cache.createRegionFactory(RegionShortcut::CACHING_PROXY)
-                    .setPoolName("pool")
-                    .create("region");
-
   region->put(key, value);
 
   auto user = region->get(key);
 
   region->localInvalidate(key);
 
-  bool resultLocalRemove = region->localRemove(key, value);
+  auto resultLocalRemove = region->localRemove(key, value);
   ASSERT_FALSE(resultLocalRemove);
 
   resultLocalRemove = region->localRemove(
-      key, static_cast<std::shared_ptr<Cacheable>>(nullptr));
+      // key, static_cast<std::shared_ptr<Cacheable>>(nullptr));

Review comment:
       Delete commented out code and format. Repeated in a few other places.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


> Remove(key, nullptr) Not Working Properly
> -----------------------------------------
>
>                 Key: GEODE-9249
>                 URL: https://issues.apache.org/jira/browse/GEODE-9249
>             Project: Geode
>          Issue Type: Bug
>          Components: native client
>            Reporter: Michael Martell
>            Priority: Major
>              Labels: pull-request-available
>
> The Region API supports both local and remote operations. Local operations 
> apply to CACHING_PROXY regions and are supposed to affect only the local 
> cache. However, localInvalidate(key, value) invalidates both local and remote 
> entry.
>  
> This is actually a but in remove(key, nullptr), not localInvalidate.
>  
> Note: Invalidate operations sets the value for the given key to null.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to