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

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

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



##########
File path: cppcache/integration/test/CachingProxyTest.cpp
##########
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <list>
+#include <thread>
+
+#include <gtest/gtest.h>
+
+#include <geode/Cache.hpp>
+#include <geode/CacheFactory.hpp>
+#include <geode/RegionFactory.hpp>
+#include <geode/RegionShortcut.hpp>
+#include <geode/Serializable.hpp>
+
+#include "framework/Cluster.h"
+
+using apache::geode::client::Cacheable;
+using apache::geode::client::CacheableString;
+using apache::geode::client::CacheFactory;
+using apache::geode::client::RegionShortcut;
+using apache::geode::client::Serializable;
+
+namespace CachingProxy {
+
+class CachingProxyTest : public ::testing::Test {
+ protected:
+  CachingProxyTest() {
+    cluster.start();
+
+    cluster.getGfsh()
+        .create()
+        .region()
+        .withName("region")
+        .withType("PARTITION")
+        .execute();
+  }
+
+  ~CachingProxyTest() override = default;
+
+  void SetUp() override {}
+
+  void TearDown() override {}
+
+  Cluster cluster = Cluster{LocatorCount{1}, ServerCount{1}};
+  std::string key = std::string("scharles");
+  std::string value = std::string("Sylvia Charles");
+};
+
+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");
+

Review comment:
       Good catch.




-- 
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:
us...@infra.apache.org


> 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