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 13bfcb0 GEODE-5475: do not start http service by default (#2211) 13bfcb0 is described below commit 13bfcb0818d1f2488b90c41786e0733bc34c59d4 Author: jinmeiliao <jil...@pivotal.io> AuthorDate: Mon Aug 6 09:21:46 2018 -0700 GEODE-5475: do not start http service by default (#2211) --- .../geode/tools/pulse/PulseConnectivityTest.java | 2 +- .../geode/tools/pulse/PulseDataExportTest.java | 3 +- .../tools/pulse/PulseJmxPasswordFileTest.java | 2 +- .../geode/tools/pulse/PulseSecurityTest.java | 3 +- .../tools/pulse/PulseSecurityWithSSLTest.java | 2 +- .../tools/pulse/ui/PulseAcceptanceAuthTest.java | 3 +- .../tools/pulse/ui/PulseAcceptanceNoAuthTest.java | 2 +- .../management/ClientHealthStatsDUnitTest.java | 2 +- .../commands/ChangeLogLevelCommandDUnitTest.java | 3 +- .../internal/cli/commands/ExportLogsDUnitTest.java | 2 +- .../cli/commands/ExportLogsStatsDUnitTest.java | 2 +- .../cli/commands/FunctionCommandsDUnitTest.java | 2 +- .../internal/cli/commands/GcCommandDUnitTest.java | 3 +- .../cli/commands/ListIndexCommandDUnitTest.java | 2 +- .../cli/commands/QueryCommandDUnitTest.java | 3 +- .../commands/RebalanceCommandDistributedTest.java | 2 +- .../commands/RegionMembershipMBeanDUnitTest.java | 2 +- .../cli/commands/ShowLogCommandDUnitTest.java | 3 +- .../cli/commands/ShutdownCommandDUnitTest.java | 2 +- .../dunit/rules/tests/MemberStarterRuleTest.java | 15 +++- .../cli/commands/IndexCommandsIntegrationTest.java | 3 +- .../cli/commands/QueryCommandIntegrationTest.java | 4 +- .../GfshStatusCommandsIntegrationTest.java | 7 +- .../security/GfshCommandsSecurityTest.java | 3 +- .../geode/test/junit/rules/LocatorStarterRule.java | 14 ++-- .../geode/test/junit/rules/MemberStarterRule.java | 37 ++++++++-- .../geode/test/junit/rules/ServerStarterRule.java | 2 +- geode-web/build.gradle | 1 + .../cli/commands/AlterRuntimeCommandDUnitTest.java | 80 ++++++++++++++-------- .../commands/ClusterConfigurationDUnitTest.java | 2 +- .../cli/commands/ConnectCommandWithSSLTest.java | 2 +- .../commands/DescribeConfigCommandDUnitTest.java | 3 +- ...xecuteFunctionCommandWithSecurityDUnitTest.java | 6 +- .../cli/commands/ExportConfigCommandDUnitTest.java | 3 +- .../internal/cli/commands/CommandOverHttpTest.java | 4 +- .../commands/ConnectCommandIntegrationTest.java | 3 +- .../commands/ConnectCommandWithSecurityTest.java | 5 +- .../internal/security/LogNoPasswordTest.java | 3 +- .../HttpOperationInvokerMBeanOperationTest.java | 3 +- .../shell/HttpOperationInvokerSecurityTest.java | 3 +- 40 files changed, 159 insertions(+), 89 deletions(-) diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseConnectivityTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseConnectivityTest.java index 16d0880..63b5737 100644 --- a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseConnectivityTest.java +++ b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseConnectivityTest.java @@ -43,7 +43,7 @@ import org.apache.geode.tools.pulse.internal.data.Cluster; @Parameterized.UseParametersRunnerFactory(CategoryWithParameterizedRunnerFactory.class) public class PulseConnectivityTest { @Rule - public LocatorStarterRule locator = new LocatorStarterRule().withJMXManager(); + public LocatorStarterRule locator = new LocatorStarterRule().withHttpService(); @Rule public EmbeddedPulseRule pulse = new EmbeddedPulseRule(); diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseDataExportTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseDataExportTest.java index a7cd607..5fb6cfa 100644 --- a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseDataExportTest.java +++ b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseDataExportTest.java @@ -34,7 +34,8 @@ public class PulseDataExportTest { @Rule public ServerStarterRule server = - new ServerStarterRule().withJMXManager().withRegion(RegionShortcut.REPLICATE, "regionA"); + new ServerStarterRule().withJMXManager().withHttpService() + .withRegion(RegionShortcut.REPLICATE, "regionA"); @Rule public GeodeHttpClientRule client = new GeodeHttpClientRule(server::getHttpPort); diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseJmxPasswordFileTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseJmxPasswordFileTest.java index 4e6b091..38e02e3 100644 --- a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseJmxPasswordFileTest.java +++ b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseJmxPasswordFileTest.java @@ -36,7 +36,7 @@ import org.apache.geode.test.junit.rules.LocatorStarterRule; @Category({SecurityTest.class, PulseTest.class}) public class PulseJmxPasswordFileTest { @Rule - public LocatorStarterRule locator = new LocatorStarterRule(); + public LocatorStarterRule locator = new LocatorStarterRule().withHttpService(); @Rule public GeodeHttpClientRule client = new GeodeHttpClientRule(locator::getHttpPort); diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityTest.java index 57c53dd..d80702a 100644 --- a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityTest.java +++ b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityTest.java @@ -39,7 +39,8 @@ public class PulseSecurityTest { @ClassRule public static ServerStarterRule server = - new ServerStarterRule().withSecurityManager(SimpleTestSecurityManager.class).withJMXManager() + new ServerStarterRule().withSecurityManager(SimpleTestSecurityManager.class) + .withJMXManager().withHttpService() .withRegion(RegionShortcut.REPLICATE, "regionA"); @Rule diff --git a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityWithSSLTest.java b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityWithSSLTest.java index 6096b49..c5faaf2 100644 --- a/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityWithSSLTest.java +++ b/geode-assembly/src/integrationTest/java/org/apache/geode/tools/pulse/PulseSecurityWithSSLTest.java @@ -50,7 +50,7 @@ public class PulseSecurityWithSSLTest { new File(getResourcePath(PulseSecurityWithSSLTest.class, "/ssl/trusted.keystore")); @ClassRule - public static LocatorStarterRule locator = new LocatorStarterRule(); + public static LocatorStarterRule locator = new LocatorStarterRule().withHttpService(); @BeforeClass public static void beforeClass() throws Exception { diff --git a/geode-assembly/src/uiTest/java/org/apache/geode/tools/pulse/ui/PulseAcceptanceAuthTest.java b/geode-assembly/src/uiTest/java/org/apache/geode/tools/pulse/ui/PulseAcceptanceAuthTest.java index d8aab18..d57dea9 100644 --- a/geode-assembly/src/uiTest/java/org/apache/geode/tools/pulse/ui/PulseAcceptanceAuthTest.java +++ b/geode-assembly/src/uiTest/java/org/apache/geode/tools/pulse/ui/PulseAcceptanceAuthTest.java @@ -36,7 +36,8 @@ import org.apache.geode.tools.pulse.tests.rules.WebDriverRule; public class PulseAcceptanceAuthTest extends PulseAcceptanceTestBase { @ClassRule - public static LocatorStarterRule locator = new LocatorStarterRule().withJMXManager() + public static LocatorStarterRule locator = new LocatorStarterRule() + .withJMXManager().withHttpService() .withSecurityManager(SimpleSecurityManager.class).withAutoStart(); @ClassRule diff --git a/geode-assembly/src/uiTest/java/org/apache/geode/tools/pulse/ui/PulseAcceptanceNoAuthTest.java b/geode-assembly/src/uiTest/java/org/apache/geode/tools/pulse/ui/PulseAcceptanceNoAuthTest.java index 6ee6374..ac7ef57 100644 --- a/geode-assembly/src/uiTest/java/org/apache/geode/tools/pulse/ui/PulseAcceptanceNoAuthTest.java +++ b/geode-assembly/src/uiTest/java/org/apache/geode/tools/pulse/ui/PulseAcceptanceNoAuthTest.java @@ -34,7 +34,7 @@ public class PulseAcceptanceNoAuthTest extends PulseAcceptanceTestBase { @ClassRule public static LocatorStarterRule locator = - new LocatorStarterRule().withJMXManager().withAutoStart(); + new LocatorStarterRule().withJMXManager().withHttpService().withAutoStart(); @ClassRule public static ClusterStartupRule clusterRule = new ClusterStartupRule(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java index 2336940..99de6d4 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/management/ClientHealthStatsDUnitTest.java @@ -55,7 +55,7 @@ public class ClientHealthStatsDUnitTest implements Serializable { @Before public void before() { locator = - cluster.startLocatorVM(0, r -> r.withoutClusterConfigurationService().withoutHttpService()); + cluster.startLocatorVM(0, r -> r.withoutClusterConfigurationService()); server = cluster.startServerVM(1, s -> s.withRegion(RegionShortcut.REPLICATE, "regionA") .withConnectionToLocator(locator.getPort())); } 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 8062ddf..f832eb7 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 @@ -53,7 +53,8 @@ public class ChangeLogLevelCommandDUnitTest { Properties managerProps = new Properties(); managerProps.setProperty(NAME, MANAGER_NAME); managerProps.setProperty(GROUPS, GROUP0); - locator = clusterStartupRule.startLocatorVM(0, managerProps); + locator = + clusterStartupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(managerProps)); Properties server1Props = new Properties(); server1Props.setProperty(NAME, SERVER1_NAME); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExportLogsDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExportLogsDUnitTest.java index 6d81d27..d953b4e 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExportLogsDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExportLogsDUnitTest.java @@ -94,7 +94,7 @@ public class ExportLogsDUnitTest { Properties properties = new Properties(); properties.setProperty(ConfigurationProperties.LOG_LEVEL, "debug"); - locator = lsRule.startLocatorVM(0, properties); + locator = lsRule.startLocatorVM(0, l -> l.withProperties(properties).withHttpService()); server1 = lsRule.startServerVM(1, properties, locator.getPort()); server2 = lsRule.startServerVM(2, properties, locator.getPort()); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExportLogsStatsDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExportLogsStatsDUnitTest.java index eebfab3..e58f29c 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExportLogsStatsDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExportLogsStatsDUnitTest.java @@ -62,7 +62,7 @@ public class ExportLogsStatsDUnitTest { @BeforeClass public static void beforeClass() { // start the locator in vm0 and then connect to it over http - locator = lsRule.startLocatorVM(0); + locator = lsRule.startLocatorVM(0, l -> l.withHttpService()); Properties serverProperties = new Properties(); serverProperties.setProperty(ConfigurationProperties.STATISTIC_SAMPLING_ENABLED, "true"); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/FunctionCommandsDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/FunctionCommandsDUnitTest.java index 24441a5..456220a 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/FunctionCommandsDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/FunctionCommandsDUnitTest.java @@ -61,7 +61,7 @@ public class FunctionCommandsDUnitTest { @BeforeClass public static void before() throws Exception { - locator = lsRule.startLocatorVM(0); + locator = lsRule.startLocatorVM(0, l -> l.withHttpService()); Properties props = new Properties(); props.setProperty("groups", "group-1"); 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 c06f5d8..f1c7d83 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 @@ -57,7 +57,8 @@ public class GcCommandDUnitTest { managerProps.setProperty(NAME, MANAGER_NAME); managerProps.setProperty(GROUPS, GROUP0); managerProps.setProperty(LOG_FILE, "someLog.log"); - locator = clusterStartupRule.startLocatorVM(0, managerProps); + locator = + clusterStartupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(managerProps)); Properties server1Props = new Properties(); server1Props.setProperty(NAME, SERVER1_NAME); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ListIndexCommandDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ListIndexCommandDUnitTest.java index fbc9e0b..fb6702a 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ListIndexCommandDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ListIndexCommandDUnitTest.java @@ -48,7 +48,7 @@ public class ListIndexCommandDUnitTest { @Before public void before() throws Exception { - locator = lsRule.startLocatorVM(0); + locator = lsRule.startLocatorVM(0, l -> l.withHttpService()); server = lsRule.startServerVM(1, locator.getPort()); server.invoke(() -> { 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 dba72d5..660c385 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 @@ -84,7 +84,8 @@ public class QueryCommandDUnitTest { @Before public void before() throws Exception { - locator = cluster.startLocatorVM(0, locatorProperties()); + Properties locatorProps = locatorProperties(); + locator = cluster.startLocatorVM(0, l -> l.withHttpService().withProperties(locatorProps)); server1 = cluster.startServerVM(1, serverProperties(), locator.getPort()); server2 = cluster.startServerVM(2, serverProperties(), locator.getPort()); 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 5022539..e12d1b5 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 @@ -43,7 +43,7 @@ public class RebalanceCommandDistributedTest { @BeforeClass public static void beforeClass() { - locator = cluster.startLocatorVM(0); + locator = cluster.startLocatorVM(0, l -> l.withHttpService()); int locatorPort = locator.getPort(); server1 = cluster.startServerVM(1, "localhost", locatorPort); 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 69905a3..b3a8595 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 @@ -90,7 +90,7 @@ public class RegionMembershipMBeanDUnitTest { Properties serverProps = new Properties(); serverProps.setProperty(SERIALIZABLE_OBJECT_FILTER, SERIALIZATION_FILTER); - locator = cluster.startLocatorVM(0, props); + locator = cluster.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); server1 = cluster.startServerVM(1, serverProps, locator.getPort()); server2 = cluster.startServerVM(2, serverProps, locator.getPort()); 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 c725959..7e73f2d 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 @@ -69,7 +69,8 @@ public class ShowLogCommandDUnitTest implements Serializable { managerProps.setProperty(LOG_FILE, MANAGER_NAME + ".log"); managerProps.setProperty(LOG_LEVEL, "info"); - locator = clusterStartupRule.startLocatorVM(0, managerProps); + locator = + clusterStartupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(managerProps)); Properties server1Props = new Properties(); server1Props.setProperty(NAME, SERVER1_NAME); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ShutdownCommandDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ShutdownCommandDUnitTest.java index 99fd8bd..abe17c5 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ShutdownCommandDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ShutdownCommandDUnitTest.java @@ -49,7 +49,7 @@ public class ShutdownCommandDUnitTest { @Before public void setup() throws Exception { - locator = clusterStartupRule.startLocatorVM(0); + locator = clusterStartupRule.startLocatorVM(0, l -> l.withHttpService()); server1 = clusterStartupRule.startServerVM(1, locator.getPort()); server2 = clusterStartupRule.startServerVM(2, locator.getPort()); connect(locator); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/test/dunit/rules/tests/MemberStarterRuleTest.java b/geode-core/src/distributedTest/java/org/apache/geode/test/dunit/rules/tests/MemberStarterRuleTest.java index 05853ae..5c5ca7d 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/test/dunit/rules/tests/MemberStarterRuleTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/test/dunit/rules/tests/MemberStarterRuleTest.java @@ -78,11 +78,13 @@ public class MemberStarterRuleTest { locator = new LocatorStarterRule(); locator.before(); + // by default jmxManager is started assertThat(locator.getJmxPort()).isNotEqualTo(1099); assertThat(locator.getJmxPort()).isNotEqualTo(-1); + // by default we won't start http service assertThat(locator.getHttpPort()).isNotEqualTo(7070); - assertThat(locator.getHttpPort()).isNotEqualTo(-1); + assertThat(locator.getHttpPort()).isEqualTo(-1); } @Test @@ -112,10 +114,17 @@ public class MemberStarterRuleTest { } @Test - public void httpPort() { - locator = new LocatorStarterRule().withoutHttpService(); + public void httpPortBeforeStart() { + locator = new LocatorStarterRule(); locator.before(); + assertThat(locator.getHttpPort()).isEqualTo(-1); + assertThat(locator.getJmxPort()).isGreaterThan(0); + } + @Test + public void httpPortAfterStart() { + locator = new LocatorStarterRule().withAutoStart(); + locator.before(); assertThat(locator.getHttpPort()).isEqualTo(0); assertThat(locator.getJmxPort()).isGreaterThan(0); } diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/IndexCommandsIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/IndexCommandsIntegrationTest.java index e5913e0..0bd0cb3 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/IndexCommandsIntegrationTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/IndexCommandsIntegrationTest.java @@ -58,7 +58,8 @@ public class IndexCommandsIntegrationTest { @ClassRule public static ServerStarterRule server = - new ServerStarterRule().withProperty(GROUPS, groupName).withJMXManager().withAutoStart(); + new ServerStarterRule().withProperty(GROUPS, groupName).withJMXManager().withHttpService() + .withAutoStart(); @BeforeClass public static void beforeClass() throws Exception { diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/QueryCommandIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/QueryCommandIntegrationTest.java index 5125a43..726fa8e 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/QueryCommandIntegrationTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/QueryCommandIntegrationTest.java @@ -52,7 +52,9 @@ public class QueryCommandIntegrationTest { @ClassRule public static ServerStarterRule server = - new ServerStarterRule().withJMXManager().withRegion(RegionShortcut.REPLICATE, "simpleRegion") + new ServerStarterRule().withJMXManager() + .withHttpService() + .withRegion(RegionShortcut.REPLICATE, "simpleRegion") .withRegion(RegionShortcut.REPLICATE, "complexRegion"); @Rule diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/lifecycle/GfshStatusCommandsIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/lifecycle/GfshStatusCommandsIntegrationTest.java index 37b10c4..44198fc 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/lifecycle/GfshStatusCommandsIntegrationTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/lifecycle/GfshStatusCommandsIntegrationTest.java @@ -22,18 +22,15 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; -import org.junit.rules.TestName; import org.apache.geode.management.internal.cli.result.CommandResult; import org.apache.geode.test.junit.rules.GfshCommandRule; import org.apache.geode.test.junit.rules.LocatorStarterRule; public class GfshStatusCommandsIntegrationTest { - private static final String LOCATOR_NAME = "locator1"; @Rule - public LocatorStarterRule locator = - new LocatorStarterRule().withJMXManager().withName(LOCATOR_NAME).withAutoStart(); + public LocatorStarterRule locator = new LocatorStarterRule().withAutoStart(); @Rule public GfshCommandRule gfsh = new GfshCommandRule(); @@ -41,8 +38,6 @@ public class GfshStatusCommandsIntegrationTest { @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder(); - @Rule - public TestName testName = new TestName(); @Before public void connect() throws Exception { diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/GfshCommandsSecurityTest.java b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/GfshCommandsSecurityTest.java index 20ed01e..27d852a 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/GfshCommandsSecurityTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/security/GfshCommandsSecurityTest.java @@ -41,7 +41,8 @@ import org.apache.geode.test.junit.rules.ServerStarterRule; public class GfshCommandsSecurityTest { @ClassRule public static ServerStarterRule serverStarter = - new ServerStarterRule().withJMXManager().withSecurityManager(SimpleTestSecurityManager.class) + new ServerStarterRule().withJMXManager().withHttpService() + .withSecurityManager(SimpleTestSecurityManager.class) .withRegion(RegionShortcut.REPLICATE_PERSISTENT, "persistentRegion"); @Rule diff --git a/geode-core/src/integrationTest/java/org/apache/geode/test/junit/rules/LocatorStarterRule.java b/geode-core/src/integrationTest/java/org/apache/geode/test/junit/rules/LocatorStarterRule.java index 08e6fa4..6fc6442 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/test/junit/rules/LocatorStarterRule.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/test/junit/rules/LocatorStarterRule.java @@ -15,7 +15,6 @@ package org.apache.geode.test.junit.rules; import static org.apache.geode.distributed.ConfigurationProperties.ENABLE_CLUSTER_CONFIGURATION; -import static org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT; import static org.apache.geode.distributed.Locator.startLocatorAndDS; import static org.junit.Assert.assertTrue; @@ -44,9 +43,11 @@ import org.apache.geode.internal.cache.InternalCache; * information, working dir, name, and the InternalLocator it creates. * * <p> - * by default the rule starts a locator with jmx and http service and cluster configuration service - * you can turn off the http service and cluster configuration service to have your test + * by default the rule starts a locator with jmx and cluster configuration service + * you can turn off cluster configuration service to have your test * run faster if your test does not need them. + * + * http service can be started when needed in your test. * </p> * * <p> @@ -58,7 +59,7 @@ public class LocatorStarterRule extends MemberStarterRule<LocatorStarterRule> im @Override public void before() { - normalizeProperties(); + super.before(); // always use a random jmxPort/httpPort when using the rule to start the locator if (jmxPort < 0) { withJMXManager(false); @@ -101,11 +102,6 @@ public class LocatorStarterRule extends MemberStarterRule<LocatorStarterRule> im } } - public LocatorStarterRule withoutHttpService() { - properties.put(HTTP_SERVICE_PORT, "0"); - return this; - } - public LocatorStarterRule withoutClusterConfigurationService() { properties.put(ENABLE_CLUSTER_CONFIGURATION, "false"); return this; diff --git a/geode-core/src/integrationTest/java/org/apache/geode/test/junit/rules/MemberStarterRule.java b/geode-core/src/integrationTest/java/org/apache/geode/test/junit/rules/MemberStarterRule.java index 953429d..9629119 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/test/junit/rules/MemberStarterRule.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/test/junit/rules/MemberStarterRule.java @@ -108,6 +108,17 @@ public abstract class MemberStarterRule<T> extends SerializableExternalResource } @Override + public void before() { + normalizeProperties(); + if (httpPort < 0) { + // at this point, httpPort is not being configured by api, we assume they do not + // want to start the http service. + // use putIfAbsent if it was configured using withProperty + properties.putIfAbsent(HTTP_SERVICE_PORT, "0"); + } + } + + @Override public void after() { // invoke stop() first and then ds.disconnect stopMember(); @@ -218,20 +229,29 @@ public abstract class MemberStarterRule<T> extends SerializableExternalResource */ public T withJMXManager(boolean useProductDefaultPorts) { if (!useProductDefaultPorts) { - int[] randomPorts = AvailablePortHelper.getRandomAvailableTCPPorts(2); // do no override these properties if already exists - properties.putIfAbsent(JMX_MANAGER_PORT, randomPorts[0] + ""); - properties.putIfAbsent(HTTP_SERVICE_PORT, randomPorts[1] + ""); + properties.putIfAbsent(JMX_MANAGER_PORT, + AvailablePortHelper.getRandomAvailableTCPPort() + ""); this.jmxPort = Integer.parseInt(properties.getProperty(JMX_MANAGER_PORT)); - this.httpPort = Integer.parseInt(properties.getProperty(HTTP_SERVICE_PORT)); } else { // the real port numbers will be set after we started the server/locator. this.jmxPort = 0; - this.httpPort = 0; } properties.putIfAbsent(JMX_MANAGER, "true"); properties.putIfAbsent(JMX_MANAGER_START, "true"); - properties.putIfAbsent(HTTP_SERVICE_BIND_ADDRESS, "localhost"); + return (T) this; + } + + public T withHttpService(boolean useDefaultPort) { + properties.setProperty(HTTP_SERVICE_BIND_ADDRESS, "localhost"); + if (!useDefaultPort) { + httpPort = AvailablePortHelper.getRandomAvailableTCPPort(); + properties.putIfAbsent(HTTP_SERVICE_PORT, httpPort + ""); + } else { + // indicate start http service but with default port + // (different from Gemfire properties, 0 means do not start http service) + httpPort = 0; + } return (T) this; } @@ -242,6 +262,11 @@ public abstract class MemberStarterRule<T> extends SerializableExternalResource return withJMXManager(false); } + public T withHttpService() { + return withHttpService(false); + } + + protected void normalizeProperties() { // if name is set via property, not with API if (name == null) { diff --git a/geode-core/src/integrationTest/java/org/apache/geode/test/junit/rules/ServerStarterRule.java b/geode-core/src/integrationTest/java/org/apache/geode/test/junit/rules/ServerStarterRule.java index ca60fac..21b78fe 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/test/junit/rules/ServerStarterRule.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/test/junit/rules/ServerStarterRule.java @@ -73,7 +73,7 @@ public class ServerStarterRule extends MemberStarterRule<ServerStarterRule> impl @Override public void before() { - normalizeProperties(); + super.before(); if (autoStart) { startServer(); regions.forEach((regionName, regionType) -> { diff --git a/geode-web/build.gradle b/geode-web/build.gradle index 57ec93a..f8077a8 100755 --- a/geode-web/build.gradle +++ b/geode-web/build.gradle @@ -51,6 +51,7 @@ dependencies { compileOnly project(path: ':geode-core', configuration: 'classesOutput') testCompile project(path: ':geode-core', configuration: 'classesOutput') + testCompile project(':geode-core') testCompile project(':geode-junit') testRuntime project(':geode-common') testCompile files(project(':geode-core').sourceSets.test.output) diff --git a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/AlterRuntimeCommandDUnitTest.java b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/AlterRuntimeCommandDUnitTest.java index dce9573..5c3e062 100644 --- a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/AlterRuntimeCommandDUnitTest.java +++ b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/AlterRuntimeCommandDUnitTest.java @@ -78,7 +78,8 @@ public class AlterRuntimeCommandDUnitTest { "java.lang.IllegalArgumentException: Could not set \"log-disk-space-limit\""); MemberVM server0 = - startupRule.startServerVM(0, x -> x.withJMXManager().withProperty(LOG_LEVEL, "error")); + startupRule.startServerVM(0, + x -> x.withJMXManager().withHttpService().withProperty(LOG_LEVEL, "error")); if (connectOverHttp) { gfsh.connectAndVerify(server0.getHttpPort(), GfshCommandRule.PortType.http); @@ -130,7 +131,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -166,7 +168,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -214,7 +217,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withProperties(props).withHttpService()); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -256,7 +260,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); props.setProperty(GROUPS, "G1"); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -307,7 +312,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -345,7 +351,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -374,7 +381,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); props.setProperty(GROUPS, "G1"); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -416,7 +424,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -453,7 +462,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -497,7 +507,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); props.setProperty(GROUPS, "G1"); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -542,7 +553,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -578,7 +590,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -623,7 +636,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); props.setProperty(GROUPS, "G1"); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -671,7 +685,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -706,7 +721,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -745,7 +761,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -791,7 +808,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); props.setProperty(GROUPS, "G1"); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -840,7 +858,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -888,7 +907,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -927,7 +947,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -973,7 +994,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); props.setProperty(GROUPS, "G1"); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -1022,7 +1044,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -1057,7 +1080,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -1097,7 +1121,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); props.setProperty(GROUPS, "G1"); MemberVM server2 = startupRule.startServerVM(2, props, locator.getPort()); @@ -1145,7 +1170,8 @@ public class AlterRuntimeCommandDUnitTest { Properties props = new Properties(); props.setProperty(LOG_LEVEL, "error"); - MemberVM locator = startupRule.startLocatorVM(0, props); + MemberVM locator = + startupRule.startLocatorVM(0, l -> l.withHttpService().withProperties(props)); MemberVM server1 = startupRule.startServerVM(1, props, locator.getPort()); if (connectOverHttp) { @@ -1177,7 +1203,7 @@ public class AlterRuntimeCommandDUnitTest { @Test @Parameters({"true", "false"}) public void testAlterUpdatesSharedConfig(final boolean connectOverHttp) throws Exception { - MemberVM locator = startupRule.startLocatorVM(0); + MemberVM locator = startupRule.startLocatorVM(0, l -> l.withHttpService()); if (connectOverHttp) { gfsh.connectAndVerify(locator.getHttpPort(), GfshCommandRule.PortType.http); diff --git a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ClusterConfigurationDUnitTest.java b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ClusterConfigurationDUnitTest.java index e370806..a1c15ad 100644 --- a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ClusterConfigurationDUnitTest.java +++ b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ClusterConfigurationDUnitTest.java @@ -63,7 +63,7 @@ public class ClusterConfigurationDUnitTest { // TODO mark GEODE-1606 resolved after @Test public void testStartServerAndExecuteCommands() throws Exception { - MemberVM locator = startupRule.startLocatorVM(0); + MemberVM locator = startupRule.startLocatorVM(0, l -> l.withHttpService()); if (connectOverHttp) { gfsh.connectAndVerify(locator.getHttpPort(), GfshCommandRule.PortType.http); } else { diff --git a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandWithSSLTest.java b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandWithSSLTest.java index b2b679a..0131b93 100644 --- a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandWithSSLTest.java +++ b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandWithSSLTest.java @@ -164,7 +164,7 @@ public class ConnectCommandWithSSLTest { @Before public void before() throws Exception { - locator = lsRule.startLocatorVM(0, sslProperties); + locator = lsRule.startLocatorVM(0, l -> l.withProperties(sslProperties).withHttpService()); IgnoredException.addIgnoredException("javax.net.ssl.SSLException: Unrecognized SSL message"); sslConfigFile = temporaryFolder.newFile("ssl.properties"); out = new FileOutputStream(sslConfigFile); diff --git a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DescribeConfigCommandDUnitTest.java b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DescribeConfigCommandDUnitTest.java index 3d01222..0cc8dd5 100644 --- a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DescribeConfigCommandDUnitTest.java +++ b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DescribeConfigCommandDUnitTest.java @@ -58,7 +58,8 @@ public class DescribeConfigCommandDUnitTest { localProps.setProperty(ENABLE_TIME_STATISTICS, "true"); localProps.setProperty(GROUPS, "G1"); MemberVM server0 = - startupRule.startServerVM(0, x -> x.withProperties(localProps).withJMXManager()); + startupRule.startServerVM(0, + x -> x.withProperties(localProps).withJMXManager().withHttpService()); if (connectOverHttp) { gfsh.connectAndVerify(server0.getHttpPort(), GfshCommandRule.PortType.http); diff --git a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExecuteFunctionCommandWithSecurityDUnitTest.java b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExecuteFunctionCommandWithSecurityDUnitTest.java index ae2fea9..45fb534 100644 --- a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExecuteFunctionCommandWithSecurityDUnitTest.java +++ b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExecuteFunctionCommandWithSecurityDUnitTest.java @@ -15,7 +15,6 @@ package org.apache.geode.management.internal.cli.commands; -import static org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER; import static org.apache.geode.management.internal.security.TestFunctions.ReadFunction; import static org.apache.geode.test.junit.rules.GfshCommandRule.PortType.http; import static org.apache.geode.test.junit.rules.GfshCommandRule.PortType.jmxManager; @@ -50,9 +49,8 @@ public class ExecuteFunctionCommandWithSecurityDUnitTest { @BeforeClass public static void beforeClass() throws Exception { - Properties locatorProps = new Properties(); - locatorProps.setProperty(SECURITY_MANAGER, SimpleTestSecurityManager.class.getName()); - locator = lsRule.startLocatorVM(0, locatorProps); + locator = lsRule.startLocatorVM(0, + l -> l.withHttpService().withSecurityManager(SimpleTestSecurityManager.class)); Properties serverProps = new Properties(); serverProps.setProperty(ResourceConstants.USER_NAME, "clusterManage"); diff --git a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExportConfigCommandDUnitTest.java b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExportConfigCommandDUnitTest.java index 2ecfc5d..ba5df56 100644 --- a/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExportConfigCommandDUnitTest.java +++ b/geode-web/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/ExportConfigCommandDUnitTest.java @@ -53,7 +53,8 @@ public class ExportConfigCommandDUnitTest { @Parameters({"true", "false"}) public void testExportConfig(final boolean connectOverHttp) throws Exception { MemberVM server0 = startupRule.startServerVM(0, - x -> x.withProperty(GROUPS, "Group1").withJMXManager().withEmbeddedLocator()); + x -> x.withProperty(GROUPS, "Group1").withJMXManager().withHttpService() + .withEmbeddedLocator()); if (connectOverHttp) { gfsh.connectAndVerify(server0.getHttpPort(), GfshCommandRule.PortType.http); diff --git a/geode-web/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/CommandOverHttpTest.java b/geode-web/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/CommandOverHttpTest.java index 0416c65..6d57377 100644 --- a/geode-web/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/CommandOverHttpTest.java +++ b/geode-web/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/CommandOverHttpTest.java @@ -38,7 +38,9 @@ public class CommandOverHttpTest { @ClassRule public static ServerStarterRule server = - new ServerStarterRule().withWorkingDir().withLogFile().withJMXManager().withAutoStart(); + new ServerStarterRule().withWorkingDir().withLogFile().withJMXManager() + .withHttpService() + .withAutoStart(); @Rule public GfshCommandRule gfshRule = new GfshCommandRule(); diff --git a/geode-web/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandIntegrationTest.java b/geode-web/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandIntegrationTest.java index 0e64b8e..83354bc 100644 --- a/geode-web/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandIntegrationTest.java +++ b/geode-web/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandIntegrationTest.java @@ -28,7 +28,8 @@ import org.apache.geode.test.junit.rules.LocatorStarterRule; public class ConnectCommandIntegrationTest { @ClassRule - public static LocatorStarterRule locator = new LocatorStarterRule().withAutoStart(); + public static LocatorStarterRule locator = + new LocatorStarterRule().withHttpService().withAutoStart(); @Rule public GfshCommandRule gfsh = new GfshCommandRule(); diff --git a/geode-web/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandWithSecurityTest.java b/geode-web/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandWithSecurityTest.java index 1efd22b..5e7aa7b 100644 --- a/geode-web/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandWithSecurityTest.java +++ b/geode-web/src/integrationTest/java/org/apache/geode/management/internal/cli/commands/ConnectCommandWithSecurityTest.java @@ -30,8 +30,9 @@ import org.apache.geode.test.junit.rules.LocatorStarterRule; public class ConnectCommandWithSecurityTest { @ClassRule - public static LocatorStarterRule locator = - new LocatorStarterRule().withSecurityManager(SimpleTestSecurityManager.class).withAutoStart(); + public static LocatorStarterRule locator = new LocatorStarterRule() + .withHttpService() + .withSecurityManager(SimpleTestSecurityManager.class).withAutoStart(); @Rule public GfshCommandRule gfsh = new GfshCommandRule(); diff --git a/geode-web/src/integrationTest/java/org/apache/geode/management/internal/security/LogNoPasswordTest.java b/geode-web/src/integrationTest/java/org/apache/geode/management/internal/security/LogNoPasswordTest.java index 22eaa1d..fffe591 100644 --- a/geode-web/src/integrationTest/java/org/apache/geode/management/internal/security/LogNoPasswordTest.java +++ b/geode-web/src/integrationTest/java/org/apache/geode/management/internal/security/LogNoPasswordTest.java @@ -47,7 +47,8 @@ public class LogNoPasswordTest { Properties properties = new Properties(); properties.setProperty(LOG_LEVEL, "debug"); properties.setProperty(SECURITY_MANAGER, MySecurityManager.class.getName()); - MemberVM locator = lsRule.startLocatorVM(0, properties); + MemberVM locator = + lsRule.startLocatorVM(0, l -> l.withHttpService().withProperties(properties)); gfsh.secureConnectAndVerify(locator.getHttpPort(), GfshCommandRule.PortType.http, "any", PASSWORD); gfsh.executeAndAssertThat("list members").statusIsSuccess(); diff --git a/geode-web/src/integrationTest/java/org/apache/geode/management/internal/web/shell/HttpOperationInvokerMBeanOperationTest.java b/geode-web/src/integrationTest/java/org/apache/geode/management/internal/web/shell/HttpOperationInvokerMBeanOperationTest.java index 656578c..590cc61 100644 --- a/geode-web/src/integrationTest/java/org/apache/geode/management/internal/web/shell/HttpOperationInvokerMBeanOperationTest.java +++ b/geode-web/src/integrationTest/java/org/apache/geode/management/internal/web/shell/HttpOperationInvokerMBeanOperationTest.java @@ -39,7 +39,8 @@ public class HttpOperationInvokerMBeanOperationTest { @ClassRule public static LocatorStarterRule locator = - new LocatorStarterRule().withProperty(DISTRIBUTED_SYSTEM_ID, "100").withAutoStart(); + new LocatorStarterRule().withHttpService().withProperty(DISTRIBUTED_SYSTEM_ID, "100") + .withAutoStart(); private HttpOperationInvoker invoker; @Rule diff --git a/geode-web/src/integrationTest/java/org/apache/geode/management/internal/web/shell/HttpOperationInvokerSecurityTest.java b/geode-web/src/integrationTest/java/org/apache/geode/management/internal/web/shell/HttpOperationInvokerSecurityTest.java index 2f6cbd1..9a31e4f 100644 --- a/geode-web/src/integrationTest/java/org/apache/geode/management/internal/web/shell/HttpOperationInvokerSecurityTest.java +++ b/geode-web/src/integrationTest/java/org/apache/geode/management/internal/web/shell/HttpOperationInvokerSecurityTest.java @@ -42,7 +42,8 @@ public class HttpOperationInvokerSecurityTest { @ClassRule public static LocatorStarterRule locator = - new LocatorStarterRule().withSecurityManager(SimpleTestSecurityManager.class).withAutoStart(); + new LocatorStarterRule().withHttpService() + .withSecurityManager(SimpleTestSecurityManager.class).withAutoStart(); @ClassRule public static GfshCommandRule gfsh = new GfshCommandRule();