From 3e08dd56abe21d046c07ced2f475f0ae61baf81b Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Lesaint?= Date: Fri, 19 Aug 2016 17:48:20 +0200 Subject: [PATCH] SONAR-7825 rename ProcessCommands#systemInfoUrl to #httpUrl --- .../src/main/java/org/sonar/ce/httpd/CeHttpServer.java | 2 +- .../test/java/org/sonar/ce/httpd/CeHttpServerTest.java | 2 +- .../main/java/org/sonar/process/AllProcessesCommands.java | 4 ++-- .../java/org/sonar/process/DefaultProcessCommands.java | 8 ++++---- .../src/main/java/org/sonar/process/ProcessCommands.java | 4 ++-- .../platform/monitoring/ProcessSystemInfoClient.java | 2 +- .../platform/monitoring/ProcessSystemInfoClientTest.java | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/server/sonar-ce/src/main/java/org/sonar/ce/httpd/CeHttpServer.java b/server/sonar-ce/src/main/java/org/sonar/ce/httpd/CeHttpServer.java index 2a90c8192e6..7927ac8add5 100644 --- a/server/sonar-ce/src/main/java/org/sonar/ce/httpd/CeHttpServer.java +++ b/server/sonar-ce/src/main/java/org/sonar/ce/httpd/CeHttpServer.java @@ -81,7 +81,7 @@ public class CeHttpServer { File shareDir = new File(processProps.getProperty(PROPERTY_SHARED_PATH)); try (DefaultProcessCommands commands = DefaultProcessCommands.secondary(shareDir, processNumber)) { String url = getUrl(); - commands.setSystemInfoUrl(url); + commands.setHttpUrl(url); LoggerFactory.getLogger(getClass()).debug("System Info HTTP server listening at {}", url); } } diff --git a/server/sonar-ce/src/test/java/org/sonar/ce/httpd/CeHttpServerTest.java b/server/sonar-ce/src/test/java/org/sonar/ce/httpd/CeHttpServerTest.java index 2723279a291..fc327b5d2a4 100644 --- a/server/sonar-ce/src/test/java/org/sonar/ce/httpd/CeHttpServerTest.java +++ b/server/sonar-ce/src/test/java/org/sonar/ce/httpd/CeHttpServerTest.java @@ -69,7 +69,7 @@ public class CeHttpServerTest { @Test public void start_publishes_URL_in_IPC() throws Exception { try (DefaultProcessCommands commands = DefaultProcessCommands.secondary(this.sharedDir, 1)) { - assertThat(commands.getSystemInfoUrl()).startsWith("http://127.0.0.1:"); + assertThat(commands.getHttpUrl()).startsWith("http://127.0.0.1:"); } } diff --git a/server/sonar-process/src/main/java/org/sonar/process/AllProcessesCommands.java b/server/sonar-process/src/main/java/org/sonar/process/AllProcessesCommands.java index f5e0954f6ff..d9bb448c1d6 100644 --- a/server/sonar-process/src/main/java/org/sonar/process/AllProcessesCommands.java +++ b/server/sonar-process/src/main/java/org/sonar/process/AllProcessesCommands.java @@ -277,12 +277,12 @@ public class AllProcessesCommands implements AutoCloseable { } @Override - public void setSystemInfoUrl(String s) { + public void setHttpUrl(String s) { AllProcessesCommands.this.setSystemInfoUrl(processNumber, s); } @Override - public String getSystemInfoUrl() { + public String getHttpUrl() { return AllProcessesCommands.this.getSystemInfoUrl(processNumber); } diff --git a/server/sonar-process/src/main/java/org/sonar/process/DefaultProcessCommands.java b/server/sonar-process/src/main/java/org/sonar/process/DefaultProcessCommands.java index 7a4182d6cee..374a3509dc5 100644 --- a/server/sonar-process/src/main/java/org/sonar/process/DefaultProcessCommands.java +++ b/server/sonar-process/src/main/java/org/sonar/process/DefaultProcessCommands.java @@ -92,13 +92,13 @@ public class DefaultProcessCommands implements ProcessCommands { } @Override - public void setSystemInfoUrl(String s) { - delegate.setSystemInfoUrl(s); + public void setHttpUrl(String s) { + delegate.setHttpUrl(s); } @Override - public String getSystemInfoUrl() { - return delegate.getSystemInfoUrl(); + public String getHttpUrl() { + return delegate.getHttpUrl(); } @Override diff --git a/server/sonar-process/src/main/java/org/sonar/process/ProcessCommands.java b/server/sonar-process/src/main/java/org/sonar/process/ProcessCommands.java index 9c2f4a35a62..9a37cd316cb 100644 --- a/server/sonar-process/src/main/java/org/sonar/process/ProcessCommands.java +++ b/server/sonar-process/src/main/java/org/sonar/process/ProcessCommands.java @@ -55,9 +55,9 @@ public interface ProcessCommands extends AutoCloseable { long getLastPing(); - void setSystemInfoUrl(String s); + void setHttpUrl(String s); - String getSystemInfoUrl(); + String getHttpUrl(); /** * To be executed by monitor process to ask for child process termination diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/ProcessSystemInfoClient.java b/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/ProcessSystemInfoClient.java index 9e319f28651..ce919b9b40c 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/ProcessSystemInfoClient.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/ProcessSystemInfoClient.java @@ -49,7 +49,7 @@ public class ProcessSystemInfoClient { public Optional connect(ProcessId processId) { try (DefaultProcessCommands commands = DefaultProcessCommands.secondary(ipcSharedDir, processId.getIpcIndex())) { if (commands.isUp()) { - String url = commands.getSystemInfoUrl() + "/systemInfo"; + String url = commands.getHttpUrl() + "/systemInfo"; byte[] protobuf = IOUtils.toByteArray(new URI(url)); return Optional.of(ProtobufSystemInfo.SystemInfo.parseFrom(protobuf)); } diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/ProcessSystemInfoClientTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/ProcessSystemInfoClientTest.java index 8020168d493..0facb75502f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/ProcessSystemInfoClientTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/ProcessSystemInfoClientTest.java @@ -75,7 +75,7 @@ public class ProcessSystemInfoClientTest { // initialize registration of process try (DefaultProcessCommands processCommands = DefaultProcessCommands.secondary(ipcSharedDir, ProcessId.COMPUTE_ENGINE.getIpcIndex())) { processCommands.setUp(); - processCommands.setSystemInfoUrl(format("http://%s:%d", server.getHostName(), server.getPort())); + processCommands.setHttpUrl(format("http://%s:%d", server.getHostName(), server.getPort())); } Optional info = underTest.connect(ProcessId.COMPUTE_ENGINE); @@ -89,7 +89,7 @@ public class ProcessSystemInfoClientTest { // initialize registration of process try (DefaultProcessCommands processCommands = DefaultProcessCommands.secondary(ipcSharedDir, ProcessId.COMPUTE_ENGINE.getIpcIndex())) { processCommands.setUp(); - processCommands.setSystemInfoUrl(format("http://%s:%d", server.getHostName(), server.getPort())); + processCommands.setHttpUrl(format("http://%s:%d", server.getHostName(), server.getPort())); } expectedException.expect(IllegalStateException.class); -- 2.39.5