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

jinmeiliao 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 26328f7  GEODE-4963: rework ConnectCommandDUnitTest to be an 
acceptance test (#1851)
26328f7 is described below

commit 26328f706ddfe2a6f0cc83f5ffc574d251c540a0
Author: jinmeiliao <[email protected]>
AuthorDate: Wed Apr 25 09:28:19 2018 -0700

    GEODE-4963: rework ConnectCommandDUnitTest to be an acceptance test (#1851)
---
 .../cli/commands/ConnectCommandAcceptanceTest.java | 49 +++++++++++++++++++++
 .../cli/commands/ConnectCommandDUnitTest.java      | 51 ----------------------
 2 files changed, 49 insertions(+), 51 deletions(-)

diff --git 
a/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/ConnectCommandAcceptanceTest.java
 
b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/ConnectCommandAcceptanceTest.java
new file mode 100644
index 0000000..758d308
--- /dev/null
+++ 
b/geode-assembly/src/test/java/org/apache/geode/management/internal/cli/commands/ConnectCommandAcceptanceTest.java
@@ -0,0 +1,49 @@
+/*
+ * 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.dunit.standalone.VersionManager;
+import org.apache.geode.test.junit.categories.AcceptanceTest;
+import org.apache.geode.test.junit.categories.GfshTest;
+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, GfshTest.class})
+public class ConnectCommandAcceptanceTest {
+  @Rule
+  public GfshRule gfsh130 = new GfshRule(VersionManager.GEODE_130);
+
+  @Rule
+  public GfshRule gfshDefault = new GfshRule();
+
+  @Test
+  public void useCurrentGfshToConnectToOlderLocator() throws Exception {
+    GfshScript.of("start locator").execute(gfsh130);
+    GfshExecution connect = 
GfshScript.of("connect").expectFailure().execute(gfshDefault);
+
+    assertThat(connect.getOutputText()).contains("Cannot use a")
+        .contains("gfsh client to connect to this cluster.");
+  }
+}
diff --git 
a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ConnectCommandDUnitTest.java
 
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ConnectCommandDUnitTest.java
deleted file mode 100644
index caad879..0000000
--- 
a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ConnectCommandDUnitTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import org.apache.geode.test.dunit.rules.ClusterStartupRule;
-import org.apache.geode.test.dunit.rules.MemberVM;
-import org.apache.geode.test.dunit.standalone.VersionManager;
-import org.apache.geode.test.junit.categories.DistributedTest;
-import org.apache.geode.test.junit.categories.GfshTest;
-import org.apache.geode.test.junit.rules.GfshCommandRule;
-
-@Ignore("GEODE-4963")
-@Category({DistributedTest.class, GfshTest.class})
-public class ConnectCommandDUnitTest {
-
-  @Rule
-  public ClusterStartupRule cluster = new ClusterStartupRule();
-
-  @Rule
-  public GfshCommandRule gfsh = new GfshCommandRule();
-
-  @Test
-  public void useCurrentGfshToConnectToOlderLocator() throws Exception {
-    MemberVM locator = cluster.startLocatorVM(0, VersionManager.GEODE_130);
-
-    gfsh.executeAndAssertThat("connect --jmx-manager=localhost[" + 
locator.getJmxPort() + "]")
-        .statusIsError().containsOutput("Cannot use a")
-        .containsOutput("gfsh client to connect to this cluster");
-    assertThat(gfsh.getGfsh().getOperationInvoker().isConnected()).isFalse();
-  }
-}

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to