diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2015-05-13 13:52:21 +0200 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2015-05-27 12:16:02 +0200 |
commit | b1ebe7217250cb9f4fc767b0df9f8d626c14f513 (patch) | |
tree | b94fe4730ed00e540d8bfdcdbf223458d88eb5f8 /server | |
parent | 982931e48eafa9df8b5181729ae40bccd6ea0e9e (diff) | |
download | sonarqube-b1ebe7217250cb9f4fc767b0df9f8d626c14f513.tar.gz sonarqube-b1ebe7217250cb9f4fc767b0df9f8d626c14f513.zip |
add module for Batch WS
Diffstat (limited to 'server')
3 files changed, 75 insertions, 16 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/batch/BatchWsModule.java b/server/sonar-server/src/main/java/org/sonar/server/batch/BatchWsModule.java new file mode 100644 index 00000000000..ebc0445137c --- /dev/null +++ b/server/sonar-server/src/main/java/org/sonar/server/batch/BatchWsModule.java @@ -0,0 +1,38 @@ +/* + * 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.batch; + +import org.sonar.core.component.Module; +import org.sonar.server.computation.ws.SubmitReportAction; + +public class BatchWsModule extends Module { + @Override + protected void configureModule() { + add( + BatchIndex.class, + GlobalAction.class, + ProjectAction.class, + ProjectRepositoryLoader.class, + SubmitReportAction.class, + IssuesAction.class, + UsersAction.class, + BatchWs.class); + } +} diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java b/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java index 5fee29e8167..e98c4798ac3 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java @@ -56,13 +56,7 @@ import org.sonar.server.activity.index.ActivityIndexer; import org.sonar.server.activity.ws.ActivitiesWs; import org.sonar.server.activity.ws.ActivityMapping; import org.sonar.server.authentication.ws.AuthenticationWs; -import org.sonar.server.batch.BatchIndex; -import org.sonar.server.batch.BatchWs; -import org.sonar.server.batch.GlobalAction; -import org.sonar.server.batch.IssuesAction; -import org.sonar.server.batch.ProjectAction; -import org.sonar.server.batch.ProjectRepositoryLoader; -import org.sonar.server.batch.UsersAction; +import org.sonar.server.batch.BatchWsModule; import org.sonar.server.charts.ChartFactory; import org.sonar.server.component.ComponentCleanerService; import org.sonar.server.component.ComponentService; @@ -77,7 +71,6 @@ import org.sonar.server.computation.ws.ComputationWs; import org.sonar.server.computation.ws.HistoryAction; import org.sonar.server.computation.ws.IsQueueEmptyWs; import org.sonar.server.computation.ws.QueueAction; -import org.sonar.server.computation.ws.SubmitReportAction; import org.sonar.server.config.ws.PropertiesWs; import org.sonar.server.dashboard.ws.DashboardsWs; import org.sonar.server.debt.DebtCharacteristicsXMLImporter; @@ -323,14 +316,7 @@ public class PlatformLevel4 extends PlatformLevel { ActivityIndex.class, // batch - BatchIndex.class, - GlobalAction.class, - ProjectAction.class, - ProjectRepositoryLoader.class, - SubmitReportAction.class, - IssuesAction.class, - UsersAction.class, - BatchWs.class, + BatchWsModule.class, // Dashboard DashboardsWs.class, diff --git a/server/sonar-server/src/test/java/org/sonar/server/batch/BatchWsModuleTest.java b/server/sonar-server/src/test/java/org/sonar/server/batch/BatchWsModuleTest.java new file mode 100644 index 00000000000..6c992f9219b --- /dev/null +++ b/server/sonar-server/src/test/java/org/sonar/server/batch/BatchWsModuleTest.java @@ -0,0 +1,35 @@ +/* + * 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.batch; + +import org.junit.Test; +import org.sonar.core.platform.ComponentContainer; + +import static org.assertj.core.api.Assertions.assertThat; + +public class BatchWsModuleTest { + @Test + public void verify_count_of_added_components() throws Exception { + ComponentContainer container = new ComponentContainer(); + new BatchWsModule().configure(container); + assertThat(container.size()).isEqualTo(10); + } + +} |