geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kh...@apache.org
Subject geode git commit: GEODE-2737: Change Pulse UI tests to use random port for JMX connections
Date Mon, 10 Apr 2017 21:47:12 GMT
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-2737 [created] e1de5dd50


GEODE-2737: Change Pulse UI tests to use random port for JMX connections


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/e1de5dd5
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/e1de5dd5
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/e1de5dd5

Branch: refs/heads/feature/GEODE-2737
Commit: e1de5dd501f08644ff4b859abdc71840eeb847da
Parents: 669d3ed
Author: Ken Howe <khowe@pivotal.io>
Authored: Mon Apr 10 14:45:28 2017 -0700
Committer: Ken Howe <khowe@pivotal.io>
Committed: Mon Apr 10 14:45:28 2017 -0700

----------------------------------------------------------------------
 .../geode/tools/pulse/tests/rules/ServerRule.java      | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/e1de5dd5/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/rules/ServerRule.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/rules/ServerRule.java
b/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/rules/ServerRule.java
index af3d64b..3183f87 100644
--- a/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/rules/ServerRule.java
+++ b/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/rules/ServerRule.java
@@ -17,6 +17,7 @@
 package org.apache.geode.tools.pulse.tests.rules;
 
 
+import org.apache.geode.tools.pulse.internal.data.PulseConstants;
 import org.awaitility.Awaitility;
 import org.apache.geode.internal.AvailablePort;
 import org.apache.geode.internal.admin.SSLConfig;
@@ -40,15 +41,17 @@ public class ServerRule extends ExternalResource {
   public ServerRule(String jsonAuthFile) {
     ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
     String jmxPropertiesFile = classLoader.getResource("test.properties").getPath();
-    server = Server.createServer(9999, jmxPropertiesFile, jsonAuthFile);
 
-    int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+    int jmxPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+    server = Server.createServer(jmxPort, jmxPropertiesFile, jsonAuthFile);
+    System.setProperty(PulseConstants.SYSTEM_PROPERTY_PULSE_HOST, LOCALHOST);
+    System.setProperty(PulseConstants.SYSTEM_PROPERTY_PULSE_PORT, Integer.toString(jmxPort));
 
-    jetty = JettyHelper.initJetty(LOCALHOST, port, new SSLConfig());
+    int httpPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+    jetty = JettyHelper.initJetty(LOCALHOST, httpPort, new SSLConfig());
     JettyHelper.addWebApplication(jetty, PULSE_CONTEXT, getPulseWarPath());
-    pulseURL = "http://" + LOCALHOST + ":" + port + PULSE_CONTEXT;
+    pulseURL = "http://" + LOCALHOST + ":" + httpPort + PULSE_CONTEXT;
     System.out.println("Pulse started at " + pulseURL);
-
   }
 
   public String getPulseURL() {


Mime
View raw message