aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2014-03-20 12:34:40 +0100
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2014-03-20 12:35:42 +0100
commit77e103ed19bd216665ad3804c49bd483306b6a21 (patch)
tree772511ada238c4d5430f55c2039d57c1af4b787c
parentb9be7782fa7e316f682b6eca0843610584d70c29 (diff)
downloadsonarqube-77e103ed19bd216665ad3804c49bd483306b6a21.tar.gz
sonarqube-77e103ed19bd216665ad3804c49bd483306b6a21.zip
SONAR-4366 Move a core plugin component to batch (remove server dependency on batch component)
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java3
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/qualitygate/GenerateQualityGateEvents.java (renamed from plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/GenerateAlertEvents.java)7
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/ModuleScanContainer.java3
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/qualitygate/GenerateQualityGateEventsTest.java (renamed from plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/GenerateAlertEventsTest.java)10
4 files changed, 14 insertions, 9 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
index 3b4d49268d3..463c7cc3243 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
@@ -19,6 +19,8 @@
*/
package org.sonar.plugins.core;
+import org.sonar.batch.qualitygate.GenerateQualityGateEvents;
+
import com.google.common.collect.ImmutableList;
import org.sonar.api.*;
import org.sonar.api.checks.NoSonarFilter;
@@ -300,7 +302,6 @@ public final class CorePlugin extends SonarPlugin {
ProjectLinksSensor.class,
UnitTestDecorator.class,
VersionEventsSensor.class,
- GenerateAlertEvents.class,
LineCoverageDecorator.class,
CoverageDecorator.class,
BranchCoverageDecorator.class,
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/GenerateAlertEvents.java b/sonar-batch/src/main/java/org/sonar/batch/qualitygate/GenerateQualityGateEvents.java
index 4d6a8550dbe..2d99ed9015f 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/GenerateAlertEvents.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/qualitygate/GenerateQualityGateEvents.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.plugins.core.sensors;
+package org.sonar.batch.qualitygate;
import org.sonar.api.batch.*;
import org.sonar.api.measures.CoreMetrics;
@@ -30,17 +30,16 @@ import org.sonar.api.profiles.RulesProfile;
import org.sonar.api.resources.Project;
import org.sonar.api.resources.Resource;
import org.sonar.api.resources.ResourceUtils;
-import org.sonar.batch.qualitygate.QualityGate;
import java.util.List;
-public class GenerateAlertEvents implements Decorator {
+public class GenerateQualityGateEvents implements Decorator {
private final QualityGate qualityGate;
private final TimeMachine timeMachine;
private NotificationManager notificationManager;
- public GenerateAlertEvents(QualityGate qualityGate, TimeMachine timeMachine, NotificationManager notificationManager) {
+ public GenerateQualityGateEvents(QualityGate qualityGate, TimeMachine timeMachine, NotificationManager notificationManager) {
this.qualityGate = qualityGate;
this.timeMachine = timeMachine;
this.notificationManager = notificationManager;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleScanContainer.java b/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleScanContainer.java
index 73c2f6803bd..835aa9be91f 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleScanContainer.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleScanContainer.java
@@ -19,6 +19,8 @@
*/
package org.sonar.batch.scan;
+import org.sonar.batch.qualitygate.GenerateQualityGateEvents;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonar.api.BatchExtension;
@@ -125,6 +127,7 @@ public class ModuleScanContainer extends ComponentContainer {
// quality gates
new QualityGateProvider(),
QualityGateVerifier.class,
+ GenerateQualityGateEvents.class,
// rules
ModuleQProfiles.class,
diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/GenerateAlertEventsTest.java b/sonar-batch/src/test/java/org/sonar/batch/qualitygate/GenerateQualityGateEventsTest.java
index 8d6b8a10b22..edf86e96729 100644
--- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/GenerateAlertEventsTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/qualitygate/GenerateQualityGateEventsTest.java
@@ -17,7 +17,9 @@
* 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.plugins.core.sensors;
+package org.sonar.batch.qualitygate;
+
+import org.sonar.batch.qualitygate.GenerateQualityGateEvents;
import org.junit.Before;
import org.junit.Test;
@@ -42,8 +44,8 @@ import static org.fest.assertions.Assertions.assertThat;
import static org.mockito.Matchers.*;
import static org.mockito.Mockito.*;
-public class GenerateAlertEventsTest {
- private GenerateAlertEvents decorator;
+public class GenerateQualityGateEventsTest {
+ private GenerateQualityGateEvents decorator;
private DecoratorContext context;
private QualityGate qualityGate;
private TimeMachine timeMachine;
@@ -56,7 +58,7 @@ public class GenerateAlertEventsTest {
timeMachine = mock(TimeMachine.class);
qualityGate = mock(QualityGate.class);
notificationManager = mock(NotificationManager.class);
- decorator = new GenerateAlertEvents(qualityGate, timeMachine, notificationManager);
+ decorator = new GenerateQualityGateEvents(qualityGate, timeMachine, notificationManager);
project = new ProjectTestBuilder().build();
}