aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/notifications/alerts/NewAlerts.java3
-rw-r--r--plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/notifications/alerts/NewAlertsTest.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/IssueBulkChangeService.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/notification/ChangesOnMyIssueNotificationDispatcher.java3
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/notification/DoNotFixNotificationDispatcher.java3
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcher.java3
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/notification/NewIssuesNotificationDispatcher.java3
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/notifications/NotificationCenter.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/notifications/NotificationService.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/issue/notification/ChangesOnMyIssueNotificationDispatcherTest.java3
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/issue/notification/DoNotFixNotificationDispatcherTest.java6
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/issue/notification/IssueNotificationsTest.java169
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcherTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/issue/notification/NewIssuesNotificationDispatcherTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationCenterTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationServiceTest.java2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/qualitygate/GenerateQualityGateEvents.java4
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/qualitygate/GenerateQualityGateEventsTest.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/notification/DefaultNotificationManager.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/notification/NotificationDispatcher.java (renamed from sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationDispatcher.java)4
-rw-r--r--sonar-core/src/main/java/org/sonar/core/notification/NotificationDispatcherMetadata.java (renamed from sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationDispatcherMetadata.java)9
-rw-r--r--sonar-core/src/main/java/org/sonar/core/notification/NotificationManager.java (renamed from sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationManager.java)4
-rw-r--r--sonar-core/src/test/java/org/sonar/core/notification/DefaultNotificationManagerTest.java1
-rw-r--r--sonar-core/src/test/java/org/sonar/core/notification/NotificationChannelTest.java (renamed from sonar-plugin-api/src/test/java/org/sonar/api/notifications/NotificationChannelTest.java)4
-rw-r--r--sonar-core/src/test/java/org/sonar/core/notification/NotificationDispatcherMetadataTest.java (renamed from sonar-plugin-api/src/test/java/org/sonar/api/notifications/NotificationDispatcherMetadataTest.java)2
-rw-r--r--sonar-core/src/test/java/org/sonar/core/notification/NotificationDispatcherTest.java (renamed from sonar-plugin-api/src/test/java/org/sonar/api/notifications/NotificationDispatcherTest.java)4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/notifications/Notification.java5
28 files changed, 53 insertions, 205 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/notifications/alerts/NewAlerts.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/notifications/alerts/NewAlerts.java
index 4662dfb7fab..b6c4bd93d1a 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/notifications/alerts/NewAlerts.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/notifications/alerts/NewAlerts.java
@@ -24,6 +24,9 @@ import org.sonar.api.notifications.*;
import java.util.Collection;
import java.util.Map;
+import org.sonar.core.notification.NotificationDispatcher;
+import org.sonar.core.notification.NotificationDispatcherMetadata;
+import org.sonar.core.notification.NotificationManager;
/**
* This dispatcher means: "notify me each new alert event".
diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/notifications/alerts/NewAlertsTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/notifications/alerts/NewAlertsTest.java
index d2e921fd916..6a65353af0a 100644
--- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/notifications/alerts/NewAlertsTest.java
+++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/notifications/alerts/NewAlertsTest.java
@@ -24,8 +24,8 @@ import com.google.common.collect.Multimap;
import org.junit.Test;
import org.sonar.api.notifications.Notification;
import org.sonar.api.notifications.NotificationChannel;
-import org.sonar.api.notifications.NotificationDispatcher;
-import org.sonar.api.notifications.NotificationManager;
+import org.sonar.core.notification.NotificationDispatcher;
+import org.sonar.core.notification.NotificationManager;
import static org.mockito.Mockito.*;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueBulkChangeService.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueBulkChangeService.java
index 674b68ba43e..7c6b68cba55 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueBulkChangeService.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueBulkChangeService.java
@@ -28,7 +28,7 @@ import com.google.common.collect.Lists;
import org.sonar.api.issue.Issue;
import org.sonar.api.issue.internal.DefaultIssue;
import org.sonar.api.issue.internal.IssueChangeContext;
-import org.sonar.api.notifications.NotificationManager;
+import org.sonar.core.notification.NotificationManager;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.rules.Rule;
import org.sonar.api.utils.log.Logger;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java
index 5eccb7e9e4e..dae69ccf3f4 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java
@@ -27,7 +27,7 @@ import org.sonar.api.issue.ActionPlan;
import org.sonar.api.issue.Issue;
import org.sonar.api.issue.internal.DefaultIssue;
import org.sonar.api.issue.internal.IssueChangeContext;
-import org.sonar.api.notifications.NotificationManager;
+import org.sonar.core.notification.NotificationManager;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.rule.Severity;
import org.sonar.api.rules.Rule;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/ChangesOnMyIssueNotificationDispatcher.java b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/ChangesOnMyIssueNotificationDispatcher.java
index e12e2715864..b38eb2f855b 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/ChangesOnMyIssueNotificationDispatcher.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/ChangesOnMyIssueNotificationDispatcher.java
@@ -25,6 +25,9 @@ import org.sonar.api.notifications.*;
import javax.annotation.Nullable;
import java.util.Collection;
+import org.sonar.core.notification.NotificationDispatcher;
+import org.sonar.core.notification.NotificationDispatcherMetadata;
+import org.sonar.core.notification.NotificationManager;
/**
* This dispatcher means: "notify me when a change is done on an issue that is assigned to me or reported by me".
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/DoNotFixNotificationDispatcher.java b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/DoNotFixNotificationDispatcher.java
index 16b3de6fc05..e4f0a5f81d9 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/DoNotFixNotificationDispatcher.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/DoNotFixNotificationDispatcher.java
@@ -27,6 +27,9 @@ import org.sonar.api.notifications.*;
import java.util.Collection;
import java.util.Map;
+import org.sonar.core.notification.NotificationDispatcher;
+import org.sonar.core.notification.NotificationDispatcherMetadata;
+import org.sonar.core.notification.NotificationManager;
/**
* This dispatcher means: "notify me when an issue is resolved as false positive or won't fix".
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcher.java b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcher.java
index b5d3237ded5..3810279554f 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcher.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcher.java
@@ -24,6 +24,9 @@ import com.google.common.collect.Multimap;
import org.sonar.api.notifications.*;
import java.util.Collection;
+import org.sonar.core.notification.NotificationDispatcher;
+import org.sonar.core.notification.NotificationDispatcherMetadata;
+import org.sonar.core.notification.NotificationManager;
/**
* This dispatcher means: "notify me when new issues are introduced during project analysis"
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/NewIssuesNotificationDispatcher.java b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/NewIssuesNotificationDispatcher.java
index c8a9726b6b2..e346b1af744 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/NewIssuesNotificationDispatcher.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/NewIssuesNotificationDispatcher.java
@@ -24,6 +24,9 @@ import org.sonar.api.notifications.*;
import java.util.Collection;
import java.util.Map;
+import org.sonar.core.notification.NotificationDispatcher;
+import org.sonar.core.notification.NotificationDispatcherMetadata;
+import org.sonar.core.notification.NotificationManager;
/**
* This dispatcher means: "notify me when new issues are introduced during project analysis"
diff --git a/server/sonar-server/src/main/java/org/sonar/server/notifications/NotificationCenter.java b/server/sonar-server/src/main/java/org/sonar/server/notifications/NotificationCenter.java
index 976a97e652f..cf43dca0c31 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/notifications/NotificationCenter.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/notifications/NotificationCenter.java
@@ -22,7 +22,7 @@ package org.sonar.server.notifications;
import com.google.common.collect.Lists;
import org.sonar.api.server.ServerSide;
import org.sonar.api.notifications.NotificationChannel;
-import org.sonar.api.notifications.NotificationDispatcherMetadata;
+import org.sonar.core.notification.NotificationDispatcherMetadata;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/notifications/NotificationService.java b/server/sonar-server/src/main/java/org/sonar/server/notifications/NotificationService.java
index c4def6da424..e13137ebead 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/notifications/NotificationService.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/notifications/NotificationService.java
@@ -38,7 +38,7 @@ import org.sonar.api.server.ServerSide;
import org.sonar.api.config.Settings;
import org.sonar.api.notifications.Notification;
import org.sonar.api.notifications.NotificationChannel;
-import org.sonar.api.notifications.NotificationDispatcher;
+import org.sonar.core.notification.NotificationDispatcher;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
import org.sonar.core.notification.DefaultNotificationManager;
diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/ChangesOnMyIssueNotificationDispatcherTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/ChangesOnMyIssueNotificationDispatcherTest.java
index de0a0cd79e9..fdcefadb1ba 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/ChangesOnMyIssueNotificationDispatcherTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/ChangesOnMyIssueNotificationDispatcherTest.java
@@ -27,6 +27,9 @@ import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.sonar.api.notifications.*;
+import org.sonar.core.notification.NotificationDispatcher;
+import org.sonar.core.notification.NotificationDispatcherMetadata;
+import org.sonar.core.notification.NotificationManager;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.*;
diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/DoNotFixNotificationDispatcherTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/DoNotFixNotificationDispatcherTest.java
index 73b8979d22f..4f42809dfb7 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/DoNotFixNotificationDispatcherTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/DoNotFixNotificationDispatcherTest.java
@@ -25,9 +25,9 @@ import org.junit.Test;
import org.sonar.api.issue.Issue;
import org.sonar.api.notifications.Notification;
import org.sonar.api.notifications.NotificationChannel;
-import org.sonar.api.notifications.NotificationDispatcher;
-import org.sonar.api.notifications.NotificationDispatcherMetadata;
-import org.sonar.api.notifications.NotificationManager;
+import org.sonar.core.notification.NotificationDispatcher;
+import org.sonar.core.notification.NotificationDispatcherMetadata;
+import org.sonar.core.notification.NotificationManager;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.*;
diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/IssueNotificationsTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/IssueNotificationsTest.java
deleted file mode 100644
index 937da1b1398..00000000000
--- a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/IssueNotificationsTest.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-///*
-// * SonarQube, open source software quality management tool.
-// * Copyright (C) 2008-2014 SonarSource
-// * mailto:contact AT sonarsource DOT com
-// *
-// * SonarQube is free software; you can redistribute it and/or
-// * modify it under the terms of the GNU Lesser General Public
-// * License as published by the Free Software Foundation; either
-// * version 3 of the License, or (at your option) any later version.
-// *
-// * SonarQube is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// * Lesser General Public License for more details.
-// *
-// * You should have received a copy of the GNU Lesser General Public License
-// * along with this program; if not, write to the Free Software Foundation,
-// * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-// */
-//package org.sonar.server.issue.notification;
-//
-//import org.junit.Before;
-//import org.junit.Test;
-//import org.junit.runner.RunWith;
-//import org.mockito.Mock;
-//import org.mockito.Mockito;
-//import org.mockito.runners.MockitoJUnitRunner;
-//import org.sonar.api.issue.internal.DefaultIssue;
-//import org.sonar.api.issue.internal.IssueChangeContext;
-//import org.sonar.api.notifications.Notification;
-//import org.sonar.api.notifications.NotificationManager;
-//import org.sonar.api.resources.File;
-//import org.sonar.api.resources.Project;
-//import org.sonar.core.component.ResourceComponent;
-//import org.sonar.server.notifications.NotificationService;
-//
-//import java.util.Date;
-//
-//import static org.assertj.core.api.Assertions.assertThat;
-//import static org.mockito.Mockito.mock;
-//
-//@RunWith(MockitoJUnitRunner.class)
-//public class IssueNotificationsTest {
-//
-// @Mock
-// NotificationManager manager;
-//
-// IssueNotifications issueNotifications;
-//
-// @Before
-// public void setUp() throws Exception {
-// issueNotifications = new IssueNotifications(manager, mock(NotificationService.class));
-// }
-//
-// // @Test
-// // public void should_send_new_issues() throws Exception {
-// // Date date = DateUtils.parseDateTime("2013-05-18T13:00:03+0200");
-// // Project project = new Project("struts").setAnalysisDate(date);
-// // IssuesBySeverity issuesBySeverity = mock(IssuesBySeverity.class);
-// // when(issuesBySeverity.size()).thenReturn(42);
-// // when(issuesBySeverity.issues("MINOR")).thenReturn(10);
-// // Notification notification = issueNotifications.sendNewIssues(project, issuesBySeverity);
-// //
-// // assertThat(notification.getFieldValue("count")).isEqualTo("42");
-// // assertThat(notification.getFieldValue("count-MINOR")).isEqualTo("10");
-// // assertThat(DateUtils.parseDateTime(notification.getFieldValue("projectDate"))).isEqualTo(date);
-// // Mockito.verify(manager).scheduleForSending(notification);
-// // }
-//
-// @Test
-// public void should_send_changes() throws Exception {
-// IssueChangeContext context = IssueChangeContext.createScan(new Date());
-// DefaultIssue issue = new DefaultIssue()
-// .setMessage("the message")
-// .setKey("ABCDE")
-// .setAssignee("freddy")
-// .setFieldChange(context, "resolution", null, "FIXED")
-// .setFieldChange(context, "status", "OPEN", "RESOLVED")
-// .setFieldChange(context, "assignee", "simon", null)
-// .setSendNotifications(true)
-// .setComponentKey("struts:Action")
-// .setProjectKey("struts");
-//
-// Notification notification = issueNotifications.sendChanges(issue, "charlie", null, new Project("struts"), null, null, false);
-//
-// assertThat(notification.getFieldValue("message")).isEqualTo("the message");
-// assertThat(notification.getFieldValue("key")).isEqualTo("ABCDE");
-// assertThat(notification.getFieldValue("componentKey")).isEqualTo("struts:Action");
-// assertThat(notification.getFieldValue("componentName")).isNull();
-// assertThat(notification.getFieldValue("old.resolution")).isNull();
-// assertThat(notification.getFieldValue("new.resolution")).isEqualTo("FIXED");
-// assertThat(notification.getFieldValue("old.status")).isEqualTo("OPEN");
-// assertThat(notification.getFieldValue("new.status")).isEqualTo("RESOLVED");
-// assertThat(notification.getFieldValue("old.assignee")).isEqualTo("simon");
-// assertThat(notification.getFieldValue("new.assignee")).isNull();
-// Mockito.verify(manager).scheduleForSending(notification);
-// }
-//
-// @Test
-// public void should_send_changes_with_comment() throws Exception {
-// DefaultIssue issue = new DefaultIssue()
-// .setMessage("the message")
-// .setKey("ABCDE")
-// .setAssignee("freddy")
-// .setComponentKey("struts:Action")
-// .setProjectKey("struts");
-// Notification notification = issueNotifications.sendChanges(issue, "charlie", null, new Project("struts"), null, "I don't know how to fix it?", false);
-//
-// assertThat(notification.getFieldValue("message")).isEqualTo("the message");
-// assertThat(notification.getFieldValue("key")).isEqualTo("ABCDE");
-// assertThat(notification.getFieldValue("comment")).isEqualTo("I don't know how to fix it?");
-// Mockito.verify(manager).scheduleForSending(notification);
-// }
-//
-// @Test
-// public void should_send_changes_with_component_name() throws Exception {
-// IssueChangeContext context = IssueChangeContext.createScan(new Date());
-// DefaultIssue issue = new DefaultIssue()
-// .setMessage("the message")
-// .setKey("ABCDE")
-// .setAssignee("freddy")
-// .setFieldChange(context, "resolution", null, "FIXED")
-// .setSendNotifications(true)
-// .setComponentKey("struts:Action.java")
-// .setProjectKey("struts");
-// Notification notification = issueNotifications.sendChanges(issue, "charlie", null, new Project("struts"),
-// new ResourceComponent(File.create("Action.java", "Action.java", null, false).setEffectiveKey("struts:Action.java")), null, false);
-//
-// assertThat(notification.getFieldValue("message")).isEqualTo("the message");
-// assertThat(notification.getFieldValue("key")).isEqualTo("ABCDE");
-// assertThat(notification.getFieldValue("componentKey")).isEqualTo("struts:Action.java");
-// assertThat(notification.getFieldValue("componentName")).isEqualTo("Action.java");
-// assertThat(notification.getFieldValue("old.resolution")).isNull();
-// assertThat(notification.getFieldValue("new.resolution")).isEqualTo("FIXED");
-// Mockito.verify(manager).scheduleForSending(notification);
-// }
-//
-// @Test
-// public void should_not_send_changes_if_no_diffs() throws Exception {
-// DefaultIssue issue = new DefaultIssue()
-// .setMessage("the message")
-// .setKey("ABCDE")
-// .setComponentKey("struts:Action")
-// .setProjectKey("struts");
-// issueNotifications.sendChanges(issue, "charlie", null, new Project("struts"), null, null, false);
-//
-// Mockito.verifyZeroInteractions(manager);
-// }
-//}
-
diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcherTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcherTest.java
index 5bf25f7e65f..9173ef7227c 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcherTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcherTest.java
@@ -26,8 +26,8 @@ import org.junit.Before;
import org.junit.Test;
import org.sonar.api.notifications.Notification;
import org.sonar.api.notifications.NotificationChannel;
-import org.sonar.api.notifications.NotificationDispatcher;
-import org.sonar.api.notifications.NotificationManager;
+import org.sonar.core.notification.NotificationDispatcher;
+import org.sonar.core.notification.NotificationManager;
import static org.mockito.Mockito.*;
diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/NewIssuesNotificationDispatcherTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/NewIssuesNotificationDispatcherTest.java
index 53d13441758..656d3bb4231 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/NewIssuesNotificationDispatcherTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/NewIssuesNotificationDispatcherTest.java
@@ -25,8 +25,8 @@ import org.junit.Before;
import org.junit.Test;
import org.sonar.api.notifications.Notification;
import org.sonar.api.notifications.NotificationChannel;
-import org.sonar.api.notifications.NotificationDispatcher;
-import org.sonar.api.notifications.NotificationManager;
+import org.sonar.core.notification.NotificationDispatcher;
+import org.sonar.core.notification.NotificationManager;
import static org.mockito.Mockito.*;
diff --git a/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationCenterTest.java b/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationCenterTest.java
index 604efb86d35..ecd6ef52117 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationCenterTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationCenterTest.java
@@ -24,7 +24,7 @@ import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.sonar.api.notifications.NotificationChannel;
-import org.sonar.api.notifications.NotificationDispatcherMetadata;
+import org.sonar.core.notification.NotificationDispatcherMetadata;
import static org.assertj.core.api.Assertions.assertThat;
diff --git a/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationServiceTest.java
index 9534400e47a..c818dee6eac 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationServiceTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/notifications/NotificationServiceTest.java
@@ -26,7 +26,7 @@ import org.mockito.stubbing.Answer;
import org.sonar.api.config.Settings;
import org.sonar.api.notifications.Notification;
import org.sonar.api.notifications.NotificationChannel;
-import org.sonar.api.notifications.NotificationDispatcher;
+import org.sonar.core.notification.NotificationDispatcher;
import org.sonar.core.notification.DefaultNotificationManager;
import org.sonar.core.properties.PropertiesDao;
import org.sonar.jpa.session.DatabaseSessionFactory;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/qualitygate/GenerateQualityGateEvents.java b/sonar-batch/src/main/java/org/sonar/batch/qualitygate/GenerateQualityGateEvents.java
index 030571ce8d5..3b7c7a4b48d 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/qualitygate/GenerateQualityGateEvents.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/qualitygate/GenerateQualityGateEvents.java
@@ -30,7 +30,7 @@ import org.sonar.api.measures.Measure;
import org.sonar.api.measures.Metric;
import org.sonar.api.measures.Metric.Level;
import org.sonar.api.notifications.Notification;
-import org.sonar.api.notifications.NotificationManager;
+import org.sonar.core.notification.NotificationManager;
import org.sonar.api.resources.Project;
import org.sonar.api.resources.Resource;
import org.sonar.api.resources.ResourceUtils;
@@ -85,7 +85,7 @@ public class GenerateQualityGateEvents implements Decorator {
private void checkQualityGateStatusChange(Resource resource, DecoratorContext context, Measure currentStatus, Measure pastStatus) {
String alertText = currentStatus.getAlertText();
Level alertLevel = currentStatus.getDataAsLevel();
- String alertName = null;
+ String alertName;
boolean isNewAlert = true;
if (pastStatus != null && pastStatus.getDataAsLevel() != alertLevel) {
// The alert status has changed
diff --git a/sonar-batch/src/test/java/org/sonar/batch/qualitygate/GenerateQualityGateEventsTest.java b/sonar-batch/src/test/java/org/sonar/batch/qualitygate/GenerateQualityGateEventsTest.java
index 5cf93a9d419..ec10ba85a5c 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/qualitygate/GenerateQualityGateEventsTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/qualitygate/GenerateQualityGateEventsTest.java
@@ -28,7 +28,7 @@ import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.measures.Measure;
import org.sonar.api.measures.Metric;
import org.sonar.api.notifications.Notification;
-import org.sonar.api.notifications.NotificationManager;
+import org.sonar.core.notification.NotificationManager;
import org.sonar.api.resources.File;
import org.sonar.api.resources.Project;
import org.sonar.api.resources.Resource;
diff --git a/sonar-core/src/main/java/org/sonar/core/notification/DefaultNotificationManager.java b/sonar-core/src/main/java/org/sonar/core/notification/DefaultNotificationManager.java
index e6776438549..99dbf58c3e2 100644
--- a/sonar-core/src/main/java/org/sonar/core/notification/DefaultNotificationManager.java
+++ b/sonar-core/src/main/java/org/sonar/core/notification/DefaultNotificationManager.java
@@ -30,8 +30,6 @@ import org.slf4j.LoggerFactory;
import org.sonar.api.batch.RequiresDB;
import org.sonar.api.notifications.Notification;
import org.sonar.api.notifications.NotificationChannel;
-import org.sonar.api.notifications.NotificationDispatcher;
-import org.sonar.api.notifications.NotificationManager;
import org.sonar.api.utils.SonarException;
import org.sonar.core.notification.db.NotificationQueueDao;
import org.sonar.core.notification.db.NotificationQueueDto;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationDispatcher.java b/sonar-core/src/main/java/org/sonar/core/notification/NotificationDispatcher.java
index 1bffbee522a..33a127af77f 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationDispatcher.java
+++ b/sonar-core/src/main/java/org/sonar/core/notification/NotificationDispatcher.java
@@ -17,10 +17,12 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.api.notifications;
+package org.sonar.core.notification;
import org.apache.commons.lang.StringUtils;
import org.sonar.api.ExtensionPoint;
+import org.sonar.api.notifications.Notification;
+import org.sonar.api.notifications.NotificationChannel;
import org.sonar.api.server.ServerSide;
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationDispatcherMetadata.java b/sonar-core/src/main/java/org/sonar/core/notification/NotificationDispatcherMetadata.java
index 37f73510385..2eb04a59c21 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationDispatcherMetadata.java
+++ b/sonar-core/src/main/java/org/sonar/core/notification/NotificationDispatcherMetadata.java
@@ -17,13 +17,11 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.api.notifications;
+package org.sonar.core.notification;
import com.google.common.collect.Maps;
-import org.sonar.api.ExtensionPoint;
-import org.sonar.api.server.ServerSide;
-
import java.util.Map;
+import org.sonar.api.server.ServerSide;
/**
* <p>
@@ -35,7 +33,6 @@ import java.util.Map;
* @since 3.5
*/
@ServerSide
-@ExtensionPoint
public final class NotificationDispatcherMetadata {
public static final String GLOBAL_NOTIFICATION = "globalNotification";
@@ -53,7 +50,7 @@ public final class NotificationDispatcherMetadata {
* Creates a new metadata instance for the given dispatcher.
* <p/>
* By default the key is the class name without package. It can be changed by overriding
- * {@link org.sonar.api.notifications.NotificationDispatcher#getKey()}.
+ * {@link NotificationDispatcher#getKey()}.
*/
public static NotificationDispatcherMetadata create(String dispatcherKey) {
return new NotificationDispatcherMetadata(dispatcherKey);
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationManager.java b/sonar-core/src/main/java/org/sonar/core/notification/NotificationManager.java
index ce67d176fbf..f9b5e0a8489 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationManager.java
+++ b/sonar-core/src/main/java/org/sonar/core/notification/NotificationManager.java
@@ -17,10 +17,12 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.api.notifications;
+package org.sonar.core.notification;
import com.google.common.collect.Multimap;
import org.sonar.api.batch.BatchSide;
+import org.sonar.api.notifications.Notification;
+import org.sonar.api.notifications.NotificationChannel;
import org.sonar.api.server.ServerSide;
import org.sonar.api.batch.InstantiationStrategy;
diff --git a/sonar-core/src/test/java/org/sonar/core/notification/DefaultNotificationManagerTest.java b/sonar-core/src/test/java/org/sonar/core/notification/DefaultNotificationManagerTest.java
index 9e1dae9de30..c5e60e1afa5 100644
--- a/sonar-core/src/test/java/org/sonar/core/notification/DefaultNotificationManagerTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/notification/DefaultNotificationManagerTest.java
@@ -28,7 +28,6 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.sonar.api.notifications.Notification;
import org.sonar.api.notifications.NotificationChannel;
-import org.sonar.api.notifications.NotificationDispatcher;
import org.sonar.core.notification.db.NotificationQueueDao;
import org.sonar.core.notification.db.NotificationQueueDto;
import org.sonar.core.properties.PropertiesDao;
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/notifications/NotificationChannelTest.java b/sonar-core/src/test/java/org/sonar/core/notification/NotificationChannelTest.java
index 0d2efb28f65..dcd80b4c08d 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/notifications/NotificationChannelTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/notification/NotificationChannelTest.java
@@ -17,12 +17,14 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.api.notifications;
+package org.sonar.core.notification;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import org.junit.Test;
+import org.sonar.api.notifications.Notification;
+import org.sonar.api.notifications.NotificationChannel;
public class NotificationChannelTest {
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/notifications/NotificationDispatcherMetadataTest.java b/sonar-core/src/test/java/org/sonar/core/notification/NotificationDispatcherMetadataTest.java
index 7acb3059132..c19e5453be6 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/notifications/NotificationDispatcherMetadataTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/notification/NotificationDispatcherMetadataTest.java
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.api.notifications;
+package org.sonar.core.notification;
import org.junit.Before;
import org.junit.Test;
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/notifications/NotificationDispatcherTest.java b/sonar-core/src/test/java/org/sonar/core/notification/NotificationDispatcherTest.java
index 1925fed6e85..89296125536 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/notifications/NotificationDispatcherTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/notification/NotificationDispatcherTest.java
@@ -17,12 +17,14 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-package org.sonar.api.notifications;
+package org.sonar.core.notification;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import org.sonar.api.notifications.Notification;
+import org.sonar.api.notifications.NotificationChannel;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/notifications/Notification.java b/sonar-plugin-api/src/main/java/org/sonar/api/notifications/Notification.java
index 0666e7260f1..6f947a29299 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/notifications/Notification.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/notifications/Notification.java
@@ -28,11 +28,8 @@ import java.io.Serializable;
import java.util.Map;
/**
- * <p>
* This class represents a notification that will be delivered to users. This is a general concept and it has no
- * knowledge of the possible ways to be delivered (see {@link NotificationChannel}) or of the users who should
- * receive it (see {@link NotificationDispatcher}).
- * </p>
+ * knowledge of the possible ways to be delivered (see {@link NotificationChannel}).
* <p>
* When creating a new notification, it is strongly advised to give a default message that can be used by channels
* that don't want to specifically format messages for different notification types. You can use