summaryrefslogtreecommitdiffstats
path: root/plugins/sonar-email-notifications-plugin
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-07-05 12:21:12 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2012-07-05 12:21:29 +0200
commitd963ab5619aa75d28b7cc981f0615c67f73d1fd5 (patch)
tree2fa201470cb7b01365e0ac4e77c6787190ffadd5 /plugins/sonar-email-notifications-plugin
parentd317fbde0e7df9159515f3f9f62246dac11e0f39 (diff)
downloadsonarqube-d963ab5619aa75d28b7cc981f0615c67f73d1fd5.tar.gz
sonarqube-d963ab5619aa75d28b7cc981f0615c67f73d1fd5.zip
SONAR-3593 move EmailSettings to org.sonar.api.conf
Diffstat (limited to 'plugins/sonar-email-notifications-plugin')
-rw-r--r--plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/EmailNotificationChannel.java8
-rw-r--r--plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/newviolations/NewViolationsEmailTemplate.java2
-rw-r--r--plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/reviews/ReviewEmailTemplate.java2
-rw-r--r--plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/EmailNotificationChannelTest.java4
-rw-r--r--plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/newviolations/NewViolationsEmailTemplateTest.java2
-rw-r--r--plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/reviews/ReviewEmailTemplateTest.java2
6 files changed, 10 insertions, 10 deletions
diff --git a/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/EmailNotificationChannel.java b/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/EmailNotificationChannel.java
index 382e9ce4f95..febacbd68bc 100644
--- a/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/EmailNotificationChannel.java
+++ b/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/EmailNotificationChannel.java
@@ -24,10 +24,10 @@ import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.SimpleEmail;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.sonar.api.config.EmailSettings;
import org.sonar.api.database.model.User;
import org.sonar.api.notifications.Notification;
import org.sonar.api.notifications.NotificationChannel;
-import org.sonar.api.platform.EmailSettings;
import org.sonar.api.security.UserFinder;
import org.sonar.api.utils.SonarException;
import org.sonar.plugins.emailnotifications.api.EmailMessage;
@@ -175,13 +175,13 @@ public class EmailNotificationChannel extends NotificationChannel {
email.setHostName(configuration.getSmtpHost());
if (StringUtils.equalsIgnoreCase(configuration.getSecureConnection(), "SSL")) {
email.setSSL(true);
- email.setSslSmtpPort(configuration.getSmtpPort());
+ email.setSslSmtpPort(String.valueOf(configuration.getSmtpPort()));
// this port is not used except in EmailException message, that's why it's set with the same value than SSL port.
// It prevents from getting bad message.
- email.setSmtpPort(Integer.parseInt(configuration.getSmtpPort()));
+ email.setSmtpPort(configuration.getSmtpPort());
} else if (StringUtils.isBlank(configuration.getSecureConnection())) {
- email.setSmtpPort(Integer.parseInt(configuration.getSmtpPort()));
+ email.setSmtpPort(configuration.getSmtpPort());
} else {
throw new SonarException("Unknown type of SMTP secure connection: " + configuration.getSecureConnection());
}
diff --git a/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/newviolations/NewViolationsEmailTemplate.java b/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/newviolations/NewViolationsEmailTemplate.java
index 8db4314562c..2294b368e34 100644
--- a/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/newviolations/NewViolationsEmailTemplate.java
+++ b/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/newviolations/NewViolationsEmailTemplate.java
@@ -20,7 +20,7 @@
package org.sonar.plugins.emailnotifications.newviolations;
import org.sonar.api.notifications.Notification;
-import org.sonar.api.platform.EmailSettings;
+import org.sonar.api.config.EmailSettings;
import org.sonar.plugins.emailnotifications.api.EmailMessage;
import org.sonar.plugins.emailnotifications.api.EmailTemplate;
diff --git a/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/reviews/ReviewEmailTemplate.java b/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/reviews/ReviewEmailTemplate.java
index 93a41c9b7c8..57da295f6eb 100644
--- a/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/reviews/ReviewEmailTemplate.java
+++ b/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/reviews/ReviewEmailTemplate.java
@@ -20,9 +20,9 @@
package org.sonar.plugins.emailnotifications.reviews;
import org.apache.commons.lang.StringUtils;
+import org.sonar.api.config.EmailSettings;
import org.sonar.api.database.model.User;
import org.sonar.api.notifications.Notification;
-import org.sonar.api.platform.EmailSettings;
import org.sonar.api.security.UserFinder;
import org.sonar.plugins.emailnotifications.api.EmailMessage;
import org.sonar.plugins.emailnotifications.api.EmailTemplate;
diff --git a/plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/EmailNotificationChannelTest.java b/plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/EmailNotificationChannelTest.java
index 3940b7d7809..3cba1e0fc0a 100644
--- a/plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/EmailNotificationChannelTest.java
+++ b/plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/EmailNotificationChannelTest.java
@@ -23,7 +23,7 @@ import org.apache.commons.mail.EmailException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.sonar.api.platform.EmailSettings;
+import org.sonar.api.config.EmailSettings;
import org.sonar.plugins.emailnotifications.api.EmailMessage;
import org.subethamail.wiser.Wiser;
import org.subethamail.wiser.WiserMessage;
@@ -187,7 +187,7 @@ public class EmailNotificationChannelTest {
private void configure() {
when(configuration.getSmtpHost()).thenReturn("localhost");
- when(configuration.getSmtpPort()).thenReturn(Integer.toString(port));
+ when(configuration.getSmtpPort()).thenReturn(port);
when(configuration.getFrom()).thenReturn("server@nowhere");
when(configuration.getPrefix()).thenReturn("[SONAR]");
when(configuration.getServerBaseURL()).thenReturn("http://nemo.sonarsource.org");
diff --git a/plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/newviolations/NewViolationsEmailTemplateTest.java b/plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/newviolations/NewViolationsEmailTemplateTest.java
index 43b0368e636..3bd32290422 100644
--- a/plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/newviolations/NewViolationsEmailTemplateTest.java
+++ b/plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/newviolations/NewViolationsEmailTemplateTest.java
@@ -21,8 +21,8 @@ package org.sonar.plugins.emailnotifications.newviolations;
import org.junit.Before;
import org.junit.Test;
+import org.sonar.api.config.EmailSettings;
import org.sonar.api.notifications.Notification;
-import org.sonar.api.platform.EmailSettings;
import org.sonar.plugins.emailnotifications.api.EmailMessage;
import static org.hamcrest.Matchers.is;
diff --git a/plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/reviews/ReviewEmailTemplateTest.java b/plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/reviews/ReviewEmailTemplateTest.java
index d9605a36935..3e52167e9d1 100644
--- a/plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/reviews/ReviewEmailTemplateTest.java
+++ b/plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/reviews/ReviewEmailTemplateTest.java
@@ -21,9 +21,9 @@ package org.sonar.plugins.emailnotifications.reviews;
import org.junit.Before;
import org.junit.Test;
+import org.sonar.api.config.EmailSettings;
import org.sonar.api.database.model.User;
import org.sonar.api.notifications.Notification;
-import org.sonar.api.platform.EmailSettings;
import org.sonar.api.security.UserFinder;
import org.sonar.plugins.emailnotifications.api.EmailMessage;