You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/12/01 18:47:20 UTC

[GitHub] [geode] DonalEvans commented on a change in pull request #5790: GEODE-8748: Prevents NPE on alter expiry on proxy regions

DonalEvans commented on a change in pull request #5790:
URL: https://github.com/apache/geode/pull/5790#discussion_r533641921



##########
File path: geode-gfsh/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/AlterTimeToLiveExpirationOnProxyRegionDUnitTest.java
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.
+ */
+package org.apache.geode.management.internal.cli.commands;
+
+import junitparams.JUnitParamsRunner;
+import junitparams.Parameters;
+import junitparams.naming.TestCaseName;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.categories.EvictionTest;
+import org.apache.geode.test.junit.rules.GfshCommandRule;
+
+@Category({EvictionTest.class})
+@RunWith(JUnitParamsRunner.class)
+public class AlterTimeToLiveExpirationOnProxyRegionDUnitTest {
+  @Rule
+  public ClusterStartupRule clusterStartupRule = new ClusterStartupRule();
+  @Rule
+  public GfshCommandRule gfsh = new GfshCommandRule();
+
+  public Object[] getRegionTypePairs() {
+    return new Object[] {
+        new Object[] {"REPLICATE", "REPLICATE_PROXY"},
+        new Object[] {"PARTITION", "PARTITION_PROXY"},
+        new Object[] {"PARTITION_REDUNDANT", "PARTITION_PROXY_REDUNDANT"}
+    };
+  }
+
+  @Test
+  @Parameters(method = "getRegionTypePairs")
+  @TestCaseName("[{index}] {method} Non Proxy Region Type:{0}; Proxy Region Type:{1}")
+  public void whenExpirationIsSetUsingAlterOnProxyRegionThenItShouldNotThrowException(
+      String nonProxyRegionType, String proxyRegionType) throws Exception {
+    MemberVM locator = clusterStartupRule.startLocatorVM(0);
+    MemberVM server1 = clusterStartupRule.startServerVM(1, "non-proxy", locator.getPort());
+    MemberVM server2 = clusterStartupRule.startServerVM(2, "proxy", locator.getPort());

Review comment:
       These variables are assigned but never used.




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