You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kh...@apache.org on 2017/09/20 21:37:37 UTC

[geode] 02/02: Added test, ran spotless

This is an automated email from the ASF dual-hosted git repository.

khowe pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 6c2d90089ff29e68d236303aa27d9a8e4c583718
Author: Patrick Rhomberg <pr...@pivotal.io>
AuthorDate: Thu Sep 14 16:15:29 2017 -0700

    Added test, ran spotless
---
 .../cli/shell/GfshDisconnectWithinScript.java      | 41 ++++++++++++++++++++++
 .../internal/cli/commands/ShellCommands.java       |  2 +-
 2 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/shell/GfshDisconnectWithinScript.java b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/shell/GfshDisconnectWithinScript.java
new file mode 100644
index 0000000..d25b23e
--- /dev/null
+++ b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/shell/GfshDisconnectWithinScript.java
@@ -0,0 +1,41 @@
+/*
+ * 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.shell;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.test.dunit.rules.gfsh.GfshRule;
+import org.apache.geode.test.junit.categories.AcceptanceTest;
+
+@Category(AcceptanceTest.class)
+public class GfshDisconnectWithinScript {
+
+  @Rule
+  public GfshRule gfsh = new GfshRule();
+
+
+  @Before
+  public void setup() {
+    gfsh.execute("start locator");
+  }
+
+  @Test
+  public void disconnectInScriptDoesNotRaiseNPE() {
+    gfsh.execute("connect", "disconnect", "echo \"Disconnect command resolved without issue.\"");
+  }
+}
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShellCommands.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShellCommands.java
index f28e989..399b2d9 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShellCommands.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShellCommands.java
@@ -196,7 +196,7 @@ public class ShellCommands implements GfshCommand {
               operationInvoker.toString()));
           LogWrapper.getInstance().info(CliStrings.format(CliStrings.DISCONNECT__MSG__DISCONNECTED,
               operationInvoker.toString()));
-          if (!gfshInstance.isHeadlessMode()){
+          if (!gfshInstance.isHeadlessMode()) {
             gfshInstance.setPromptPath(RegionPathConverter.DEFAULT_APP_CONTEXT_PATH);
           }
         } else {

-- 
To stop receiving notification emails like this one, please contact
"commits@geode.apache.org" <co...@geode.apache.org>.