]> source.dussan.org Git - sonarqube.git/commitdiff
Rename some remaining "Sonar" to "SonarQube"
authorSimon Brandhof <simon.brandhof@gmail.com>
Sun, 2 Jun 2013 09:12:41 +0000 (11:12 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Sun, 2 Jun 2013 09:12:41 +0000 (11:12 +0200)
plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/EmailNotificationChannel.java
plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/EmailNotificationChannelTest.java
sonar-plugin-api/src/main/java/org/sonar/api/config/EmailSettings.java
sonar-plugin-api/src/test/java/org/sonar/api/config/EmailSettingsTest.java
sonar-server/src/main/webapp/WEB-INF/app/views/measures/manage.html.erb

index eeff054a52d602d29b723ef9e60657f39e4a2f42..21c3b4fcd2990ecb50eec32cf4c3005ace6c4a81 100644 (file)
@@ -80,7 +80,7 @@ public class EmailNotificationChannel extends NotificationChannel {
    */
   private static final String REFERENCES_HEADER = "References";
 
-  private static final String FROM_NAME_DEFAULT = "Sonar";
+  private static final String FROM_NAME_DEFAULT = "SonarQube";
   private static final String SUBJECT_DEFAULT = "Notification";
 
   private EmailSettings configuration;
@@ -159,12 +159,12 @@ public class EmailNotificationChannel extends NotificationChannel {
           email.addHeader(REFERENCES_HEADER, messageId);
         }
         // Set headers for proper filtering
-        email.addHeader(LIST_ID_HEADER, "Sonar <sonar." + host + ">");
+        email.addHeader(LIST_ID_HEADER, "SonarQube <sonar." + host + ">");
         email.addHeader(LIST_ARCHIVE_HEADER, configuration.getServerBaseURL());
       }
       // Set general information
       email.setCharset("UTF-8");
-      String from = StringUtils.isBlank(emailMessage.getFrom()) ? FROM_NAME_DEFAULT : emailMessage.getFrom() + " (Sonar)";
+      String from = StringUtils.isBlank(emailMessage.getFrom()) ? FROM_NAME_DEFAULT : emailMessage.getFrom() + " (SonarQube)";
       email.setFrom(configuration.getFrom(), from);
       email.addTo(emailMessage.getTo(), " ");
       String subject = StringUtils.defaultIfBlank(StringUtils.trimToEmpty(configuration.getPrefix()) + " ", "")
index 8e4dc24ada81159f8929189e1fdf840f99d5cfa5..057bba86441d4db490bfbb426476f992e12b09f0 100644 (file)
@@ -29,16 +29,12 @@ import org.subethamail.wiser.Wiser;
 import org.subethamail.wiser.WiserMessage;
 
 import javax.mail.internet.MimeMessage;
-
 import java.io.IOException;
 import java.net.ServerSocket;
 import java.util.List;
 
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.nullValue;
-import static org.hamcrest.Matchers.startsWith;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
+import static org.fest.assertions.Assertions.assertThat;
+import static org.fest.assertions.Fail.fail;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
@@ -79,17 +75,17 @@ public class EmailNotificationChannelTest {
   @Test
   public void shouldSendTestEmail() throws Exception {
     configure();
-    channel.sendTestEmail("user@nowhere", "Test Message from Sonar", "This is a test message from Sonar.");
+    channel.sendTestEmail("user@nowhere", "Test Message from SonarQube", "This is a test message from SonarQube.");
 
     List<WiserMessage> messages = server.getMessages();
-    assertThat(messages.size(), is(1));
+    assertThat(messages).hasSize(1);
 
     MimeMessage email = messages.get(0).getMimeMessage();
-    assertThat(email.getHeader("Content-Type", null), is("text/plain; charset=UTF-8"));
-    assertThat(email.getHeader("From", ","), is("Sonar <server@nowhere>"));
-    assertThat(email.getHeader("To", null), is("<user@nowhere>"));
-    assertThat(email.getHeader("Subject", null), is("[SONAR] Test Message from Sonar"));
-    assertThat((String) email.getContent(), startsWith("This is a test message from Sonar."));
+    assertThat(email.getHeader("Content-Type", null)).isEqualTo("text/plain; charset=UTF-8");
+    assertThat(email.getHeader("From", ",")).isEqualTo("SonarQube <server@nowhere>");
+    assertThat(email.getHeader("To", null)).isEqualTo("<user@nowhere>");
+    assertThat(email.getHeader("Subject", null)).isEqualTo("[SONARQUBE] Test Message from SonarQube");
+    assertThat((String) email.getContent()).startsWith("This is a test message from SonarQube.");
   }
 
   @Test
@@ -98,7 +94,7 @@ public class EmailNotificationChannelTest {
     server.stop();
 
     try {
-      channel.sendTestEmail("user@nowhere", "Test Message from Sonar", "This is a test message from Sonar.");
+      channel.sendTestEmail("user@nowhere", "Test Message from SonarQube", "This is a test message from SonarQube.");
       fail();
     } catch (EmailException e) {
       // expected
@@ -112,7 +108,7 @@ public class EmailNotificationChannelTest {
       .setSubject("Foo")
       .setMessage("Bar");
     channel.deliver(emailMessage);
-    assertThat(server.getMessages().size(), is(0));
+    assertThat(server.getMessages()).isEmpty();
   }
 
   @Test
@@ -127,22 +123,22 @@ public class EmailNotificationChannelTest {
     channel.deliver(emailMessage);
 
     List<WiserMessage> messages = server.getMessages();
-    assertThat(messages.size(), is(1));
+    assertThat(messages).hasSize(1);
 
     MimeMessage email = messages.get(0).getMimeMessage();
 
-    assertThat(email.getHeader("Content-Type", null), is("text/plain; charset=UTF-8"));
+    assertThat(email.getHeader("Content-Type", null)).isEqualTo("text/plain; charset=UTF-8");
 
-    assertThat(email.getHeader("In-Reply-To", null), is("<reviews/view/1@nemo.sonarsource.org>"));
-    assertThat(email.getHeader("References", null), is("<reviews/view/1@nemo.sonarsource.org>"));
+    assertThat(email.getHeader("In-Reply-To", null)).isEqualTo("<reviews/view/1@nemo.sonarsource.org>");
+    assertThat(email.getHeader("References", null)).isEqualTo("<reviews/view/1@nemo.sonarsource.org>");
 
-    assertThat(email.getHeader("List-ID", null), is("Sonar <sonar.nemo.sonarsource.org>"));
-    assertThat(email.getHeader("List-Archive", null), is("http://nemo.sonarsource.org"));
+    assertThat(email.getHeader("List-ID", null)).isEqualTo("SonarQube <sonar.nemo.sonarsource.org>");
+    assertThat(email.getHeader("List-Archive", null)).isEqualTo("http://nemo.sonarsource.org");
 
-    assertThat(email.getHeader("From", ","), is("\"Full Username (Sonar)\" <server@nowhere>"));
-    assertThat(email.getHeader("To", null), is("<user@nowhere>"));
-    assertThat(email.getHeader("Subject", null), is("[SONAR] Review #3"));
-    assertThat((String) email.getContent(), startsWith("I'll take care of this violation."));
+    assertThat(email.getHeader("From", ",")).isEqualTo("\"Full Username (SonarQube)\" <server@nowhere>");
+    assertThat(email.getHeader("To", null)).isEqualTo("<user@nowhere>");
+    assertThat(email.getHeader("Subject", null)).isEqualTo("[SONARQUBE] Review #3");
+    assertThat((String) email.getContent()).startsWith("I'll take care of this violation.");
   }
 
   @Test
@@ -155,22 +151,22 @@ public class EmailNotificationChannelTest {
     channel.deliver(emailMessage);
 
     List<WiserMessage> messages = server.getMessages();
-    assertThat(messages.size(), is(1));
+    assertThat(messages).hasSize(1);
 
     MimeMessage email = messages.get(0).getMimeMessage();
 
-    assertThat(email.getHeader("Content-Type", null), is("text/plain; charset=UTF-8"));
+    assertThat(email.getHeader("Content-Type", null)).isEqualTo("text/plain; charset=UTF-8");
 
-    assertThat(email.getHeader("In-Reply-To", null), nullValue());
-    assertThat(email.getHeader("References", null), nullValue());
+    assertThat(email.getHeader("In-Reply-To", null)).isNull();
+    assertThat(email.getHeader("References", null)).isNull();
 
-    assertThat(email.getHeader("List-ID", null), is("Sonar <sonar.nemo.sonarsource.org>"));
-    assertThat(email.getHeader("List-Archive", null), is("http://nemo.sonarsource.org"));
+    assertThat(email.getHeader("List-ID", null)).isEqualTo("SonarQube <sonar.nemo.sonarsource.org>");
+    assertThat(email.getHeader("List-Archive", null)).isEqualTo("http://nemo.sonarsource.org");
 
-    assertThat(email.getHeader("From", null), is("Sonar <server@nowhere>"));
-    assertThat(email.getHeader("To", null), is("<user@nowhere>"));
-    assertThat(email.getHeader("Subject", null), is("[SONAR] Foo"));
-    assertThat((String) email.getContent(), startsWith("Bar"));
+    assertThat(email.getHeader("From", null)).isEqualTo("SonarQube <server@nowhere>");
+    assertThat(email.getHeader("To", null)).isEqualTo("<user@nowhere>");
+    assertThat(email.getHeader("Subject", null)).isEqualTo("[SONARQUBE] Foo");
+    assertThat((String) email.getContent()).startsWith("Bar");
   }
 
   @Test
@@ -189,7 +185,7 @@ public class EmailNotificationChannelTest {
     when(configuration.getSmtpHost()).thenReturn("localhost");
     when(configuration.getSmtpPort()).thenReturn(port);
     when(configuration.getFrom()).thenReturn("server@nowhere");
-    when(configuration.getPrefix()).thenReturn("[SONAR]");
+    when(configuration.getPrefix()).thenReturn("[SONARQUBE]");
     when(configuration.getServerBaseURL()).thenReturn("http://nemo.sonarsource.org");
   }
 
index 463f3510b81093cb8076056efecbd88f441d8dd3..26d65f5d483172d1bcbf837b59fafe614d4ce8b2 100644 (file)
@@ -44,7 +44,7 @@ public class EmailSettings implements BatchComponent, ServerComponent {
   public static final String FROM = "email.from";
   public static final String FROM_DEFAULT = "noreply@nowhere";
   public static final String PREFIX = "email.prefix";
-  public static final String PREFIX_DEFAULT = "[SONAR]";
+  public static final String PREFIX_DEFAULT = "[SONARQUBE]";
 
   private final Settings settings;
 
index 139eda6a87f8ea2b37595525119e6ddfba575103..672199d5542f069a921acf6c6394ea6cf49d0ef7 100644 (file)
@@ -43,7 +43,7 @@ public class EmailSettingsTest {
     assertThat(emailSettings.getSmtpPassword()).isEmpty();
     assertThat(emailSettings.getSecureConnection()).isEmpty();
     assertThat(emailSettings.getFrom()).isEqualTo("noreply@nowhere");
-    assertThat(emailSettings.getPrefix()).isEqualTo("[SONAR]");
+    assertThat(emailSettings.getPrefix()).isEqualTo("[SONARQUBE]");
     assertThat(emailSettings.getServerBaseURL()).isEqualTo(CoreProperties.SERVER_BASE_URL_DEFAULT_VALUE);
   }
 }
index 30810c5d2ada191b75964bc3185f17aab1e4100f..1de3960a5f7414eb2a84bb7e8238984485c3e3b6 100644 (file)
                 <% end %>
               </td>
               <td>
-                <%= filter.user ? h(filter.user.name) : '[Sonar]' -%>
+                <%= filter.user ? h(filter.user.name) : '[SonarQube]' -%>
               </td>
               <td class="thin nowrap right">
                 <a id="copy-<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/measures/copy_form/<%= filter.id -%>" class="link-action open-modal"><%= message('copy') -%></a>