From: Simon Brandhof Date: Mon, 23 Feb 2015 17:48:51 +0000 (+0100) Subject: SONAR-5716 drop documentation of api/server/system X-Git-Tag: 5.1-RC1~88 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1b2791924ef45c4b6a09d405deb3b1cfd5076798;p=sonarqube.git SONAR-5716 drop documentation of api/server/system --- diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/ws/ServerWs.java b/server/sonar-server/src/main/java/org/sonar/server/platform/ws/ServerWs.java index b6e8ddf66f3..f2c5a591c0a 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/ws/ServerWs.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/ws/ServerWs.java @@ -33,7 +33,6 @@ public class ServerWs implements WebService { .setSince("2.10"); defineIndexAction(controller); - defineSystemAction(controller); defineSetupAction(controller); controller.done(); @@ -55,16 +54,6 @@ public class ServerWs implements WebService { RailsHandler.addFormatParam(action); } - private void defineSystemAction(NewController controller) { - NewAction action = controller.createAction("system") - .setDescription("Get the system properties, server info (Java, OS), database configuration, JVM statistics and installed plugins. Requires Administer System permission") - .setSince("2.10") - .setHandler(RailsHandler.INSTANCE) - .setResponseExample(Resources.getResource(this.getClass(), "example-system.json")); - - RailsHandler.addFormatParam(action); - } - private void defineSetupAction(NewController controller) { NewAction action = controller.createAction("setup") .setDescription("Upgrade the SonarQube database") diff --git a/server/sonar-server/src/main/resources/org/sonar/server/platform/ws/example-system.json b/server/sonar-server/src/main/resources/org/sonar/server/platform/ws/example-system.json deleted file mode 100644 index dadcadb8747..00000000000 --- a/server/sonar-server/src/main/resources/org/sonar/server/platform/ws/example-system.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "system_info": { - "System date": "Wed Oct 10 19:15:20 CEST 2012", - "JVM Vendor": "Sun Microsystems Inc.", - "JVM Name": "Java HotSpot(TM) Client VM" - }, - "system_statistics": { - "Total Memory": "316 MB", - "Free Memory": "195 MB" - }, - "sonar_info": { - "Version": "4.3", - "Started at": "Mon May 05 09:06:52 CEST 2014", - "Database": "PostgreSQL 9.1.9" - }, - "sonar_plugins": { - "JaCoCo": "2.1", - "Java": "2.1" - }, - "system_properties": { - "LANG": "en_US.UTF-8", - "LC_ALL": "en_US.UTF-8", - "LC_CTYPE": "UTF-8" - } - } -] diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/ws/ServerWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/ws/ServerWsTest.java index 2328a9ac435..7fcfceda62b 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/ws/ServerWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/ws/ServerWsTest.java @@ -20,7 +20,6 @@ package org.sonar.server.platform.ws; -import org.junit.Before; import org.junit.Test; import org.sonar.api.server.ws.RailsHandler; import org.sonar.api.server.ws.WebService; @@ -30,12 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat; public class ServerWsTest { - WsTester tester; - - @Before - public void setUp() throws Exception { - tester = new WsTester(new ServerWs()); - } + WsTester tester = new WsTester(new ServerWs()); @Test public void define_controller() throws Exception { @@ -43,7 +37,7 @@ public class ServerWsTest { assertThat(controller).isNotNull(); assertThat(controller.since()).isEqualTo("2.10"); assertThat(controller.description()).isNotEmpty(); - assertThat(controller.actions()).hasSize(3); + assertThat(controller.actions()).hasSize(2); } @Test @@ -57,17 +51,6 @@ public class ServerWsTest { assertThat(action.params()).hasSize(1); } - @Test - public void define_system_action() throws Exception { - WebService.Controller controller = tester.controller("api/server"); - - WebService.Action action = controller.action("system"); - assertThat(action).isNotNull(); - assertThat(action.handler()).isInstanceOf(RailsHandler.class); - assertThat(action.responseExampleAsString()).isNotEmpty(); - assertThat(action.params()).hasSize(1); - } - @Test public void define_setup_action() throws Exception { WebService.Controller controller = tester.controller("api/server");