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 5cdf4c7 GEODE-3530 Added command tests using http connection (#2177)
5cdf4c7 is described below
commit 5cdf4c7c2f890e508f7a0b3c9315a75c8a64ffa0
Author: FSOUTHERLAND <[email protected]>
AuthorDate: Tue Jul 24 08:23:52 2018 -0700
GEODE-3530 Added command tests using http connection (#2177)
---
.../commands/ChangeLogLevelCommandDUnitTest.java | 43 ++++++++-----------
.../internal/cli/commands/GcCommandDUnitTest.java | 39 +++++++-----------
.../cli/commands/GemfireDataCommandsDUnitTest.java | 7 +++-
.../cli/commands/QueryCommandDUnitTest.java | 9 +++-
.../commands/RebalanceCommandDistributedTest.java | 28 ++++---------
.../commands/RegionMembershipMBeanDUnitTest.java | 10 ++++-
.../cli/commands/ShowLogCommandDUnitTest.java | 48 +++++++++-------------
.../ChangeLogLevelCommandOverHttpDUnitTest.java | 24 +++++++++++
.../cli/commands/CommandOverHttpDUnitTest.java | 37 -----------------
.../cli/commands/GcCommandOverHttpDUnitTest.java | 24 +++++++++++
.../GemfireDataCommandsOverHttpDUnitTest.java | 24 +++++++++++
.../commands/QueryCommandOverHttpDUnitTest.java | 25 +++++++++++
.../RebalanceCommandOverHttpDistributedTest.java | 24 +++++++++++
.../RegionMembershipMBeanOverHttpDUnitTest.java | 25 +++++++++++
.../commands/ShowLogComandOverHttpDUnitTest.java | 31 ++++++++++++++
15 files changed, 256 insertions(+), 142 deletions(-)
diff --git
a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ChangeLogLevelCommandDUnitTest.java
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ChangeLogLevelCommandDUnitTest.java
index bca5b30..8062ddf 100644
---
a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ChangeLogLevelCommandDUnitTest.java
+++
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ChangeLogLevelCommandDUnitTest.java
@@ -16,28 +16,22 @@ package org.apache.geode.management.internal.cli.commands;
import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
import static org.apache.geode.distributed.ConfigurationProperties.NAME;
-import static org.apache.geode.test.junit.rules.GfshCommandRule.PortType.http;
import static
org.apache.geode.test.junit.rules.GfshCommandRule.PortType.jmxManager;
import java.util.Properties;
+import org.junit.After;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.dunit.rules.MemberVM;
-import org.apache.geode.test.junit.categories.LoggingTest;
import org.apache.geode.test.junit.rules.GfshCommandRule;
-import
org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactory;
-@Category({LoggingTest.class})
-@RunWith(Parameterized.class)
[email protected](CategoryWithParameterizedRunnerFactory.class)
+
public class ChangeLogLevelCommandDUnitTest {
private static final String MANAGER_NAME = "Manager";
private static final String SERVER1_NAME = "Server1";
@@ -46,43 +40,40 @@ public class ChangeLogLevelCommandDUnitTest {
private static final String GROUP1 = "Group1";
private static final String GROUP2 = "Group2";
+ protected static MemberVM locator;
+
@ClassRule
public static ClusterStartupRule clusterStartupRule = new
ClusterStartupRule();
@ClassRule
public static GfshCommandRule gfsh = new GfshCommandRule();
-
- @Parameterized.Parameter
- public static boolean useHttp;
-
- @Parameterized.Parameters
- public static Object[] data() {
- return new Object[] {true, false};
- }
-
@BeforeClass
public static void setup() throws Exception {
Properties managerProps = new Properties();
managerProps.setProperty(NAME, MANAGER_NAME);
managerProps.setProperty(GROUPS, GROUP0);
- MemberVM manager = clusterStartupRule.startLocatorVM(0, managerProps);
+ locator = clusterStartupRule.startLocatorVM(0, managerProps);
Properties server1Props = new Properties();
server1Props.setProperty(NAME, SERVER1_NAME);
server1Props.setProperty(GROUPS, GROUP1);
- clusterStartupRule.startServerVM(1, server1Props, manager.getPort());
+ clusterStartupRule.startServerVM(1, server1Props, locator.getPort());
Properties server2Props = new Properties();
server2Props.setProperty(NAME, SERVER2_NAME);
server2Props.setProperty(GROUPS, GROUP2);
- clusterStartupRule.startServerVM(2, server2Props, manager.getPort());
+ clusterStartupRule.startServerVM(2, server2Props, locator.getPort());
+ }
+
+ @Before
+ public void before() throws Exception {
+ gfsh.connectAndVerify(locator.getJmxPort(), jmxManager);
+ }
- if (useHttp) {
- gfsh.connectAndVerify(manager.getHttpPort(), http);
- } else {
- gfsh.connectAndVerify(manager.getJmxPort(), jmxManager);
- }
+ @After
+ public void after() throws Exception {
+ gfsh.disconnect();
}
diff --git
a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/GcCommandDUnitTest.java
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/GcCommandDUnitTest.java
index ef0fffa..c06f5d8 100644
---
a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/GcCommandDUnitTest.java
+++
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/GcCommandDUnitTest.java
@@ -17,29 +17,24 @@ package org.apache.geode.management.internal.cli.commands;
import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
import static org.apache.geode.distributed.ConfigurationProperties.LOG_FILE;
import static org.apache.geode.distributed.ConfigurationProperties.NAME;
-import static org.apache.geode.test.junit.rules.GfshCommandRule.PortType.http;
import static
org.apache.geode.test.junit.rules.GfshCommandRule.PortType.jmxManager;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.Properties;
+import org.junit.After;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
import org.apache.geode.management.cli.Result;
import org.apache.geode.management.internal.cli.result.CommandResult;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.dunit.rules.MemberVM;
import org.apache.geode.test.junit.rules.GfshCommandRule;
-import
org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactory;
-
-@RunWith(Parameterized.class)
[email protected](CategoryWithParameterizedRunnerFactory.class)
public class GcCommandDUnitTest {
private static final String MANAGER_NAME = "Manager";
private static final String SERVER1_NAME = "Server1";
@@ -48,14 +43,7 @@ public class GcCommandDUnitTest {
private static final String GROUP1 = "Group1";
private static final String GROUP2 = "Group2";
- @Parameterized.Parameter
- public static boolean useHttp;
-
- @Parameterized.Parameters(name = "Use http: {0}")
- public static Object[] data() {
- return new Object[] {true, false};
- }
-
+ protected static MemberVM locator;
@ClassRule
public static ClusterStartupRule clusterStartupRule = new
ClusterStartupRule();
@@ -69,24 +57,27 @@ public class GcCommandDUnitTest {
managerProps.setProperty(NAME, MANAGER_NAME);
managerProps.setProperty(GROUPS, GROUP0);
managerProps.setProperty(LOG_FILE, "someLog.log");
-
- MemberVM manager = clusterStartupRule.startLocatorVM(0, managerProps);
+ locator = clusterStartupRule.startLocatorVM(0, managerProps);
Properties server1Props = new Properties();
server1Props.setProperty(NAME, SERVER1_NAME);
server1Props.setProperty(GROUPS, GROUP1);
- clusterStartupRule.startServerVM(1, server1Props, manager.getPort());
+ clusterStartupRule.startServerVM(1, server1Props, locator.getPort());
Properties server2Props = new Properties();
server2Props.setProperty(NAME, SERVER2_NAME);
server2Props.setProperty(GROUPS, GROUP2);
- clusterStartupRule.startServerVM(2, server2Props, manager.getPort());
+ clusterStartupRule.startServerVM(2, server2Props, locator.getPort());
+ }
+
+ @Before
+ public void before() throws Exception {
+ gfsh.connectAndVerify(locator.getJmxPort(), jmxManager);
+ }
- if (useHttp) {
- gfsh.connectAndVerify(manager.getHttpPort(), http);
- } else {
- gfsh.connectAndVerify(manager.getJmxPort(), jmxManager);
- }
+ @After
+ public void after() throws Exception {
+ gfsh.disconnect();
}
@Test
diff --git
a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
index 9df40e9..7ce158c 100644
---
a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
+++
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/GemfireDataCommandsDUnitTest.java
@@ -89,13 +89,18 @@ public class GemfireDataCommandsDUnitTest {
@Rule
public ClusterStartupRule cluster = new ClusterStartupRule();
- private MemberVM locator, server1, server2;
+ protected MemberVM locator, server1, server2;
public void before() throws Exception {
locator = cluster.startLocatorVM(0, locatorProperties());
server1 = cluster.startServerVM(1, locator.getPort());
server2 = cluster.startServerVM(2, locator.getPort());
+ connectToLocator();
+ }
+ // extracted for convenience overriding in
GemfireDataCommandsOverHttpDUnitTest to connect via
+ // http
+ public void connectToLocator() throws Exception {
gfsh.connectAndVerify(locator);
}
diff --git
a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/QueryCommandDUnitTest.java
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/QueryCommandDUnitTest.java
index 4cbaa97..dba72d5 100644
---
a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/QueryCommandDUnitTest.java
+++
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/QueryCommandDUnitTest.java
@@ -18,6 +18,7 @@ import static
org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
import static
org.apache.geode.distributed.ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER;
import static org.apache.geode.test.dunit.IgnoredException.addIgnoredException;
+import static
org.apache.geode.test.junit.rules.GfshCommandRule.PortType.jmxManager;
import static org.assertj.core.api.Java6Assertions.assertThat;
import static org.junit.Assert.fail;
@@ -79,7 +80,7 @@ public class QueryCommandDUnitTest {
@Rule
public ClusterStartupRule cluster = new ClusterStartupRule();
- private MemberVM locator, server1, server2;
+ protected MemberVM locator, server1, server2;
@Before
public void before() throws Exception {
@@ -94,7 +95,11 @@ public class QueryCommandDUnitTest {
locator.waitUntilRegionIsReadyOnExactlyThisManyServers(DATA_REGION_NAME_PATH,
2);
locator.waitUntilRegionIsReadyOnExactlyThisManyServers(DATA_PAR_REGION_NAME_PATH,
1);
- gfsh.connectAndVerify(locator);
+ connectToLocator();
+ }
+
+ public void connectToLocator() throws Exception {
+ gfsh.connectAndVerify(locator.getJmxPort(), jmxManager);
}
@Test
diff --git
a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/RebalanceCommandDistributedTest.java
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/RebalanceCommandDistributedTest.java
index 6cdd514..5022539 100644
---
a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/RebalanceCommandDistributedTest.java
+++
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/RebalanceCommandDistributedTest.java
@@ -15,14 +15,12 @@
package org.apache.geode.management.internal.cli.commands;
-import static org.apache.geode.test.junit.rules.GfshCommandRule.PortType.http;
import static
org.apache.geode.test.junit.rules.GfshCommandRule.PortType.jmxManager;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
import org.apache.geode.cache.Cache;
import org.apache.geode.cache.Region;
@@ -31,10 +29,7 @@ import org.apache.geode.cache.RegionShortcut;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.dunit.rules.MemberVM;
import org.apache.geode.test.junit.rules.GfshCommandRule;
-import
org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactory;
-@RunWith(Parameterized.class)
[email protected](CategoryWithParameterizedRunnerFactory.class)
@SuppressWarnings("serial")
public class RebalanceCommandDistributedTest {
@@ -44,18 +39,10 @@ public class RebalanceCommandDistributedTest {
@ClassRule
public static GfshCommandRule gfsh = new GfshCommandRule();
- private static MemberVM locator, server1, server2;
-
- @Parameterized.Parameter
- public static boolean useHttp;
-
- @Parameterized.Parameters(name = "useHttp={0}")
- public static Object[] data() {
- return new Object[] {true, false};
- }
+ protected static MemberVM locator, server1, server2;
@BeforeClass
- public static void before() throws Exception {
+ public static void beforeClass() {
locator = cluster.startLocatorVM(0);
int locatorPort = locator.getPort();
@@ -63,12 +50,11 @@ public class RebalanceCommandDistributedTest {
server2 = cluster.startServerVM(2, "localhost", locatorPort);
setUpRegions();
+ }
- if (useHttp) {
- gfsh.connectAndVerify(locator.getHttpPort(), http);
- } else {
- gfsh.connectAndVerify(locator.getJmxPort(), jmxManager);
- }
+ @Before
+ public void before() throws Exception {
+ gfsh.connect(locator.getJmxPort(), jmxManager);
}
@Test
diff --git
a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/RegionMembershipMBeanDUnitTest.java
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/RegionMembershipMBeanDUnitTest.java
index 4709bef..6a09119 100644
---
a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/RegionMembershipMBeanDUnitTest.java
+++
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/RegionMembershipMBeanDUnitTest.java
@@ -18,6 +18,7 @@ import static
org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
import static org.apache.geode.distributed.ConfigurationProperties.NAME;
import static
org.apache.geode.distributed.ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER;
+import static
org.apache.geode.test.junit.rules.GfshCommandRule.PortType.jmxManager;
import static org.assertj.core.api.Java6Assertions.assertThat;
import java.util.Properties;
@@ -79,7 +80,7 @@ public class RegionMembershipMBeanDUnitTest {
@Rule
public ClusterStartupRule cluster = new ClusterStartupRule();
- private MemberVM locator, server1, server2;
+ protected MemberVM locator, server1, server2;
@Before
public void before() throws Exception {
@@ -93,7 +94,12 @@ public class RegionMembershipMBeanDUnitTest {
server1 = cluster.startServerVM(1, serverProps, locator.getPort());
server2 = cluster.startServerVM(2, serverProps, locator.getPort());
- gfsh.connectAndVerify(locator);
+ connectToLocator();
+ }
+
+ // extracted in order to override in RegionMembershipMBeanOverHttpDUnitTest
to use http connection
+ public void connectToLocator() throws Exception {
+ gfsh.connectAndVerify(locator.getJmxPort(), jmxManager);
}
private static void setupDataRegionAndSubregions() {
diff --git
a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ShowLogCommandDUnitTest.java
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ShowLogCommandDUnitTest.java
index baa2cde..c725959 100644
---
a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ShowLogCommandDUnitTest.java
+++
b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ShowLogCommandDUnitTest.java
@@ -18,7 +18,6 @@ import static
org.apache.geode.distributed.ConfigurationProperties.GROUPS;
import static org.apache.geode.distributed.ConfigurationProperties.LOG_FILE;
import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
import static org.apache.geode.distributed.ConfigurationProperties.NAME;
-import static org.apache.geode.test.junit.rules.GfshCommandRule.PortType.http;
import static
org.apache.geode.test.junit.rules.GfshCommandRule.PortType.jmxManager;
import static org.assertj.core.api.Assertions.assertThat;
@@ -27,12 +26,11 @@ import java.util.Properties;
import java.util.concurrent.TimeUnit;
import org.awaitility.Awaitility;
+import org.junit.After;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.internal.logging.LogService;
@@ -41,13 +39,9 @@ import org.apache.geode.management.internal.cli.CliUtil;
import org.apache.geode.management.internal.cli.result.CommandResult;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.dunit.rules.MemberVM;
-import org.apache.geode.test.junit.categories.LoggingTest;
import org.apache.geode.test.junit.rules.GfshCommandRule;
-import
org.apache.geode.test.junit.runners.CategoryWithParameterizedRunnerFactory;
-@Category({LoggingTest.class})
-@RunWith(Parameterized.class)
[email protected](CategoryWithParameterizedRunnerFactory.class)
+
public class ShowLogCommandDUnitTest implements Serializable {
private static final String MANAGER_NAME = "Manager";
private static final String SERVER1_NAME = "Server1";
@@ -58,7 +52,7 @@ public class ShowLogCommandDUnitTest implements Serializable {
private static final String MESSAGE_ON_MANAGER = "someLogMessageOnManager";
private static final String MESSAGE_ON_SERVER1 = "someLogMessageOnServer1";
private static final String MESSAGE_ON_SERVER2 = "someLogMessageOnServer2";
- private static MemberVM manager;
+ protected static MemberVM locator;
private static MemberVM server1;
private static MemberVM server2;
@ClassRule
@@ -67,14 +61,6 @@ public class ShowLogCommandDUnitTest implements Serializable
{
@ClassRule
public static GfshCommandRule gfsh = new GfshCommandRule();
- @Parameterized.Parameter
- public static boolean useHttp;
-
- @Parameterized.Parameters
- public static Object[] data() {
- return new Object[] {true, false};
- }
-
@BeforeClass
public static void setup() throws Exception {
Properties managerProps = new Properties();
@@ -83,7 +69,7 @@ public class ShowLogCommandDUnitTest implements Serializable {
managerProps.setProperty(LOG_FILE, MANAGER_NAME + ".log");
managerProps.setProperty(LOG_LEVEL, "info");
- manager = clusterStartupRule.startLocatorVM(0, managerProps);
+ locator = clusterStartupRule.startLocatorVM(0, managerProps);
Properties server1Props = new Properties();
server1Props.setProperty(NAME, SERVER1_NAME);
@@ -91,7 +77,7 @@ public class ShowLogCommandDUnitTest implements Serializable {
server1Props.setProperty(LOG_FILE, SERVER1_NAME + ".log");
managerProps.setProperty(LOG_LEVEL, "info");
- server1 = clusterStartupRule.startServerVM(1, server1Props,
manager.getPort());
+ server1 = clusterStartupRule.startServerVM(1, server1Props,
locator.getPort());
Properties server2Props = new Properties();
server2Props.setProperty(NAME, SERVER2_NAME);
@@ -99,20 +85,24 @@ public class ShowLogCommandDUnitTest implements
Serializable {
server2Props.setProperty(LOG_FILE, SERVER2_NAME + ".log");
managerProps.setProperty(LOG_LEVEL, "info");
- server2 = clusterStartupRule.startServerVM(2, server2Props,
manager.getPort());
+ server2 = clusterStartupRule.startServerVM(2, server2Props,
locator.getPort());
+ }
- if (useHttp) {
- gfsh.connectAndVerify(manager.getHttpPort(), http);
- } else {
- gfsh.connectAndVerify(manager.getJmxPort(), jmxManager);
- }
+ @Before
+ public void before() throws Exception {
+ gfsh.connectAndVerify(locator.getJmxPort(), jmxManager);
Awaitility.await().atMost(2, TimeUnit.MINUTES)
.until(ShowLogCommandDUnitTest::allMembersAreConnected);
}
+ @After
+ public void after() throws Exception {
+ gfsh.disconnect();
+ }
+
private void writeLogMessages() {
- manager.invoke(() -> LogService.getLogger().info(MESSAGE_ON_MANAGER));
+ locator.invoke(() -> LogService.getLogger().info(MESSAGE_ON_MANAGER));
server1.invoke(() -> LogService.getLogger().info(MESSAGE_ON_SERVER1));
server2.invoke(() -> LogService.getLogger().info(MESSAGE_ON_SERVER2));
@@ -158,8 +148,8 @@ public class ShowLogCommandDUnitTest implements
Serializable {
assertThat(output).contains("Member NotAValidMember could not be found");
}
- private static boolean allMembersAreConnected() {
- return manager.getVM().invoke(() -> {
+ protected static boolean allMembersAreConnected() {
+ return locator.getVM().invoke(() -> {
DistributedMember server1 =
CliUtil.getDistributedMemberByNameOrId(SERVER1_NAME,
ClusterStartupRule.getCache());
DistributedMember server2 =
diff --git
a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ChangeLogLevelCommandOverHttpDUnitTest.java
b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ChangeLogLevelCommandOverHttpDUnitTest.java
new file mode 100644
index 0000000..99fd27b
--- /dev/null
+++
b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ChangeLogLevelCommandOverHttpDUnitTest.java
@@ -0,0 +1,24 @@
+/*
+ * 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.apache.geode.test.junit.rules.GfshCommandRule.PortType.http;
+
+public class ChangeLogLevelCommandOverHttpDUnitTest extends
ChangeLogLevelCommandDUnitTest {
+ @Override
+ public void before() throws Exception {
+ gfsh.connect(locator.getHttpPort(), http);
+ }
+}
diff --git
a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/CommandOverHttpDUnitTest.java
b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/CommandOverHttpDUnitTest.java
deleted file mode 100644
index e0bdec2..0000000
---
a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/CommandOverHttpDUnitTest.java
+++ /dev/null
@@ -1,37 +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 org.junit.ClassRule;
-import org.junit.contrib.java.lang.system.ProvideSystemProperty;
-import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-import org.apache.geode.internal.lang.SystemPropertyHelper;
-import org.apache.geode.test.junit.categories.GfshTest;
-import org.apache.geode.test.junit.categories.SecurityTest;
-import org.apache.geode.test.junit.runners.SuiteRunner;
-
-@Category({SecurityTest.class, GfshTest.class})
-@RunWith(SuiteRunner.class)
[email protected]({GemfireDataCommandsDUnitTest.class,
- RebalanceCommandDUnitTest.class, RegionMembershipMBeanDUnitTest.class,
- QueryCommandDUnitTest.class})
-public class CommandOverHttpDUnitTest {
- @ClassRule
- public static ProvideSystemProperty provideSystemProperty =
- new ProvideSystemProperty(SystemPropertyHelper.USE_HTTP_SYSTEM_PROPERTY,
"true");
-}
diff --git
a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/GcCommandOverHttpDUnitTest.java
b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/GcCommandOverHttpDUnitTest.java
new file mode 100644
index 0000000..6055043
--- /dev/null
+++
b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/GcCommandOverHttpDUnitTest.java
@@ -0,0 +1,24 @@
+/*
+ * 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 org.apache.geode.test.junit.rules.GfshCommandRule;
+
+public class GcCommandOverHttpDUnitTest extends GcCommandDUnitTest {
+ @Override
+ public void before() throws Exception {
+ gfsh.connectAndVerify(locator.getHttpPort(),
GfshCommandRule.PortType.http);
+ }
+}
diff --git
a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/GemfireDataCommandsOverHttpDUnitTest.java
b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/GemfireDataCommandsOverHttpDUnitTest.java
new file mode 100644
index 0000000..3fbea74
--- /dev/null
+++
b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/GemfireDataCommandsOverHttpDUnitTest.java
@@ -0,0 +1,24 @@
+/*
+ * 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 org.apache.geode.test.junit.rules.GfshCommandRule;
+
+public class GemfireDataCommandsOverHttpDUnitTest extends
GemfireDataCommandsDUnitTest {
+ @Override
+ public void connectToLocator() throws Exception {
+ gfsh.connectAndVerify(locator.getHttpPort(),
GfshCommandRule.PortType.http);
+ }
+}
diff --git
a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/QueryCommandOverHttpDUnitTest.java
b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/QueryCommandOverHttpDUnitTest.java
new file mode 100644
index 0000000..feb799c
--- /dev/null
+++
b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/QueryCommandOverHttpDUnitTest.java
@@ -0,0 +1,25 @@
+/*
+ * 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 org.apache.geode.test.junit.rules.GfshCommandRule;
+
+public class QueryCommandOverHttpDUnitTest extends QueryCommandDUnitTest {
+ @Override
+ public void connectToLocator() throws Exception {
+ gfsh.connectAndVerify(locator.getHttpPort(),
GfshCommandRule.PortType.http);
+ }
+}
diff --git
a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/RebalanceCommandOverHttpDistributedTest.java
b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/RebalanceCommandOverHttpDistributedTest.java
new file mode 100644
index 0000000..e0228b8
--- /dev/null
+++
b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/RebalanceCommandOverHttpDistributedTest.java
@@ -0,0 +1,24 @@
+/*
+ * 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.apache.geode.test.junit.rules.GfshCommandRule.PortType.http;
+
+public class RebalanceCommandOverHttpDistributedTest extends
RebalanceCommandDistributedTest {
+ @Override
+ public void before() throws Exception {
+ gfsh.connectAndVerify(locator.getHttpPort(), http);
+ }
+}
diff --git
a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/RegionMembershipMBeanOverHttpDUnitTest.java
b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/RegionMembershipMBeanOverHttpDUnitTest.java
new file mode 100644
index 0000000..be0297e
--- /dev/null
+++
b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/RegionMembershipMBeanOverHttpDUnitTest.java
@@ -0,0 +1,25 @@
+/*
+ * 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 org.apache.geode.test.junit.rules.GfshCommandRule;
+
+public class RegionMembershipMBeanOverHttpDUnitTest extends
RegionMembershipMBeanDUnitTest {
+ @Override
+ public void connectToLocator() throws Exception {
+ gfsh.connectAndVerify(locator.getHttpPort(),
GfshCommandRule.PortType.http);
+ }
+
+}
diff --git
a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ShowLogComandOverHttpDUnitTest.java
b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ShowLogComandOverHttpDUnitTest.java
new file mode 100644
index 0000000..0d5d701
--- /dev/null
+++
b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ShowLogComandOverHttpDUnitTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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 java.util.concurrent.TimeUnit;
+
+import org.awaitility.Awaitility;
+
+import org.apache.geode.test.junit.rules.GfshCommandRule;
+
+public class ShowLogComandOverHttpDUnitTest extends ShowLogCommandDUnitTest {
+ @Override
+ public void before() throws Exception {
+ gfsh.connectAndVerify(locator.getHttpPort(),
GfshCommandRule.PortType.http);
+ Awaitility.await().atMost(2, TimeUnit.MINUTES)
+ .until(ShowLogCommandDUnitTest::allMembersAreConnected);
+ }
+
+}