]> source.dussan.org Git - sonarqube.git/commitdiff
correct wording (#1230)
authorStas Vilchik <vilchiks@gmail.com>
Fri, 9 Sep 2016 15:28:40 +0000 (17:28 +0200)
committerGitHub <noreply@github.com>
Fri, 9 Sep 2016 15:28:40 +0000 (17:28 +0200)
adress -> address
127.0.1 -> 127.0.0.1

it/it-tests/src/test/java/it/serverSystem/ServerSystemTest.java
server/sonar-server/src/main/java/org/sonar/server/serverid/ws/ShowAction.java
server/sonar-server/src/main/resources/org/sonar/server/serverid/ws/show-example.json
server/sonar-server/src/test/java/org/sonar/server/serverid/ws/ShowActionTest.java
server/sonar-web/src/main/js/apps/settings/serverId/ServerIdApp.js
sonar-ws/src/main/protobuf/ws-serverid.proto

index fe919bb7e7112a8fe0e0947cedb3127e70c53c21..31cc93a4c44f1133e7c37a9e16599b6e25940df8 100644 (file)
@@ -254,7 +254,7 @@ public class ServerSystemTest {
     WsClient adminWsClient = newAdminWsClient(orchestrator);
     ShowWsResponse response = ShowWsResponse.parseFrom(adminWsClient.wsConnector().call(
         new GetRequest("api/server_id/show").setMediaType(MediaTypes.PROTOBUF)).contentStream());
-    assertThat(response.getValidIpAdressesCount()).isGreaterThan(0);
-    return response.getValidIpAdresses(0);
+    assertThat(response.getValidIpAddressesCount()).isGreaterThan(0);
+    return response.getValidIpAddresses(0);
   }
 }
index e65bbcc22e15cc2036ebe4ec3df2dc84626f2307..5230714dda4efd18251c5fb87ff02944fdb84ab1 100644 (file)
@@ -86,9 +86,9 @@ public class ShowAction implements ServerIdWsAction {
 
   private ShowWsResponse doHandle(Map<String, PropertyDto> properties) {
     ShowWsResponse.Builder responseBuilder = ShowWsResponse.newBuilder();
-    List<String> validIpAdresses = serverIdGenerator.getAvailableAddresses().stream().map(InetAddress::getHostAddress).collect(toList());
-    if (!validIpAdresses.isEmpty()) {
-      responseBuilder.addAllValidIpAdresses(validIpAdresses);
+    List<String> validIpAddresses = serverIdGenerator.getAvailableAddresses().stream().map(InetAddress::getHostAddress).collect(toList());
+    if (!validIpAddresses.isEmpty()) {
+      responseBuilder.addAllValidIpAddresses(validIpAddresses);
     }
 
     Optional<String> serverId = getSettingValue(properties.get(PERMANENT_SERVER_ID));
index bd00b32b7685c40bf506ae4d1606ba9882ad6893..1f2f3c1140d4a047279cd96cd7cb7c28b167f4bc 100644 (file)
@@ -1,9 +1,9 @@
 {
   "serverId": "1818a1eefb26f9g",
   "organization": "home",
-  "ip": "127.0.1",
-  "validIpAdresses": [
+  "ip": "127.0.0.1",
+  "validIpAddresses": [
     "192.168.1.1",
-    "127.0.1"
+    "127.0.0.1"
   ]
 }
index fdbc861ae02acb4060534b50a9a6d720fbb91a92..e534a18373881e553f7e32c905f8c0cc0f6014a9 100644 (file)
@@ -70,23 +70,23 @@ public class ShowActionTest {
   @Test
   public void return_server_id_info() throws Exception {
     setUserAsSystemAdmin();
-    when(generator.validate("home", "127.0.1", "1818a1eefb26f9g")).thenReturn(true);
-    setAvailableIpAdresses("192.168.1.1", "127.0.1");
-    insertConfiguration("1818a1eefb26f9g", "home", "127.0.1");
+    when(generator.validate("home", "127.0.0.1", "1818a1eefb26f9g")).thenReturn(true);
+    setAvailableIpAdresses("192.168.1.1", "127.0.0.1");
+    insertConfiguration("1818a1eefb26f9g", "home", "127.0.0.1");
 
     ShowWsResponse response = executeRequest();
 
     assertThat(response.getServerId()).isEqualTo("1818a1eefb26f9g");
     assertThat(response.getOrganization()).isEqualTo("home");
-    assertThat(response.getIp()).isEqualTo("127.0.1");
-    assertThat(response.getValidIpAdressesList()).containsOnly("192.168.1.1", "127.0.1");
+    assertThat(response.getIp()).isEqualTo("127.0.0.1");
+    assertThat(response.getValidIpAddressesList()).containsOnly("192.168.1.1", "127.0.0.1");
     assertThat(response.hasInvalidServerId()).isFalse();
   }
 
   @Test
   public void return_invalid_server_id() throws Exception {
     setUserAsSystemAdmin();
-    when(generator.validate("home", "127.0.1", "1818a1eefb26f9g")).thenReturn(true);
+    when(generator.validate("home", "127.0.0.1", "1818a1eefb26f9g")).thenReturn(true);
     insertConfiguration("invalid", null, null);
 
     ShowWsResponse response = executeRequest();
@@ -95,7 +95,7 @@ public class ShowActionTest {
     assertThat(response.getServerId()).isEqualTo("invalid");
     assertThat(response.hasOrganization()).isFalse();
     assertThat(response.hasIp()).isFalse();
-    assertThat(response.getValidIpAdressesList()).isEmpty();
+    assertThat(response.getValidIpAddressesList()).isEmpty();
   }
 
   @Test
@@ -107,35 +107,35 @@ public class ShowActionTest {
     assertThat(response.hasServerId()).isFalse();
     assertThat(response.hasOrganization()).isFalse();
     assertThat(response.hasIp()).isFalse();
-    assertThat(response.getValidIpAdressesList()).isEmpty();
+    assertThat(response.getValidIpAddressesList()).isEmpty();
     assertThat(response.hasInvalidServerId()).isFalse();
   }
 
   @Test
   public void return_no_server_id_info_when_no_server_id_but_other_settings() throws Exception {
     setUserAsSystemAdmin();
-    insertConfiguration(null, "home", "127.0.1");
+    insertConfiguration(null, "home", "127.0.0.1");
 
     ShowWsResponse response = executeRequest();
 
     assertThat(response.hasServerId()).isFalse();
     assertThat(response.hasOrganization()).isFalse();
     assertThat(response.hasIp()).isFalse();
-    assertThat(response.getValidIpAdressesList()).isEmpty();
+    assertThat(response.getValidIpAddressesList()).isEmpty();
     assertThat(response.hasInvalidServerId()).isFalse();
   }
 
   @Test
   public void return_available_ips_even_if_no_settings() throws Exception {
     setUserAsSystemAdmin();
-    setAvailableIpAdresses("192.168.1.1", "127.0.1");
+    setAvailableIpAdresses("192.168.1.1", "127.0.0.1");
 
     ShowWsResponse response = executeRequest();
 
     assertThat(response.hasServerId()).isFalse();
     assertThat(response.hasOrganization()).isFalse();
     assertThat(response.hasIp()).isFalse();
-    assertThat(response.getValidIpAdressesList()).containsOnly("192.168.1.1", "127.0.1");
+    assertThat(response.getValidIpAddressesList()).containsOnly("192.168.1.1", "127.0.0.1");
     assertThat(response.hasInvalidServerId()).isFalse();
   }
 
@@ -161,9 +161,9 @@ public class ShowActionTest {
   @Test
   public void test_example_json_response() {
     setUserAsSystemAdmin();
-    when(generator.validate("home", "127.0.1", "1818a1eefb26f9g")).thenReturn(true);
-    setAvailableIpAdresses("192.168.1.1", "127.0.1");
-    insertConfiguration("1818a1eefb26f9g", "home", "127.0.1");
+    when(generator.validate("home", "127.0.0.1", "1818a1eefb26f9g")).thenReturn(true);
+    setAvailableIpAdresses("192.168.1.1", "127.0.0.1");
+    insertConfiguration("1818a1eefb26f9g", "home", "127.0.0.1");
 
     String result = ws.newRequest()
       .setMediaType(JSON)
index 3a5e9a8ec2cd23c18be49da47888343204292cff..afeeca6c566a9295d404f9248918ce0339a6de5f 100644 (file)
@@ -33,7 +33,7 @@ export default class ServerIdApp extends React.Component {
     loading: true,
     organization: '',
     ip: '',
-    validIpAdresses: []
+    validIpAddresses: []
   };
 
   componentDidMount () {
@@ -132,7 +132,7 @@ export default class ServerIdApp extends React.Component {
                 <div className="modal-field-description">
                   {translate('server_id_configuration.ip.desc')}
                   <ul className="list-styled">
-                    {this.state.validIpAdresses.map(ip => (
+                    {this.state.validIpAddresses.map(ip => (
                         <li key={ip} className="little-spacer-top">{ip}</li>
                     ))}
                   </ul>
index af02b223d868949eccc8ea0288df86a43a970016..855a93889dee9b877fc31aca65ef204873dceb4f 100644 (file)
@@ -29,7 +29,7 @@ message ShowWsResponse {
   optional string serverId = 1;
   optional string organization = 2;
   optional string ip = 3;
-  repeated string validIpAdresses = 4;
+  repeated string validIpAddresses = 4;
   optional bool invalidServerId = 5;
 }