You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by sa...@apache.org on 2018/01/22 18:15:26 UTC
[geode] branch develop updated: GEODE-4332: Gfsh start locator
should not retrieve cluster status when --connect=false (#1315)
This is an automated email from the ASF dual-hosted git repository.
sai_boorlagadda pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push:
new 8d02247 GEODE-4332: Gfsh start locator should not retrieve cluster status when --connect=false (#1315)
8d02247 is described below
commit 8d0224742c5308a13df0e2e344df9e6f9ed2ea94
Author: Sai Boorlagadda <sa...@gmail.com>
AuthorDate: Mon Jan 22 10:15:23 2018 -0800
GEODE-4332: Gfsh start locator should not retrieve cluster status when --connect=false (#1315)
---
.../cli/commands/StartLocatorAcceptanceTest.java | 51 ++++++++++++++++++++++
.../internal/cli/commands/StartLocatorCommand.java | 10 ++---
2 files changed, 56 insertions(+), 5 deletions(-)
diff --git a/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StartLocatorAcceptanceTest.java b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StartLocatorAcceptanceTest.java
new file mode 100644
index 0000000..2fb904f
--- /dev/null
+++ b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/StartLocatorAcceptanceTest.java
@@ -0,0 +1,51 @@
+/*
+ * 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 static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.test.junit.categories.AcceptanceTest;
+import org.apache.geode.test.junit.rules.gfsh.GfshExecution;
+import org.apache.geode.test.junit.rules.gfsh.GfshRule;
+import org.apache.geode.test.junit.rules.gfsh.GfshScript;
+
+@Category(AcceptanceTest.class)
+public class StartLocatorAcceptanceTest {
+ @Rule
+ public GfshRule gfshRule = new GfshRule();
+
+ @Test
+ public void startLocatorWithAutoConnectShouldBeConnectedAndRetrieveClusterConfigurationStatus()
+ throws Exception {
+ GfshExecution execution = GfshScript.of("start locator --name=locator1").execute(gfshRule);
+ assertThat(execution.getOutputText()).contains("Successfully connected to: JMX Manager");
+ assertThat(execution.getOutputText())
+ .contains("Cluster configuration service is up and running.");
+ }
+
+ @Test
+ public void startLocatorWithConnectFalseShouldNotBeConnectedAndNotRetrieveClusterConfigurationStatus()
+ throws Exception {
+ GfshExecution execution =
+ GfshScript.of("start locator --name=locator1 --connect=false").execute(gfshRule);
+ assertThat(execution.getOutputText()).doesNotContain("Successfully connected to: JMX Manager");
+ assertThat(execution.getOutputText())
+ .doesNotContain("Cluster configuration service is up and running.");
+ }
+}
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StartLocatorCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StartLocatorCommand.java
index 4d54323..60c8c50 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StartLocatorCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StartLocatorCommand.java
@@ -294,12 +294,12 @@ public class StartLocatorCommand implements GfshCommand {
// Else, ask the user to use the "connect" command to connect to the Locator.
if (shouldAutoConnect(connect)) {
doAutoConnect(locatorHostName, locatorPort, configProperties, infoResultData);
- }
- // Report on the state of the Shared Configuration service if enabled...
- if (enableSharedConfiguration) {
- infoResultData.addLine(ClusterConfigurationStatusRetriever.fromLocator(locatorHostName,
- locatorPort, configProperties));
+ // Report on the state of the Shared Configuration service if enabled...
+ if (enableSharedConfiguration) {
+ infoResultData.addLine(ClusterConfigurationStatusRetriever.fromLocator(locatorHostName,
+ locatorPort, configProperties));
+ }
}
return ResultBuilder.buildResult(infoResultData);
--
To stop receiving notification emails like this one, please contact
sai_boorlagadda@apache.org.