Browse Source

add MetricsWsModule

tags/5.2-RC1
Teryk Bellahsene 9 years ago
parent
commit
1401fcc179

+ 36
- 0
server/sonar-server/src/main/java/org/sonar/server/metric/ws/MetricsWsModule.java View File

@@ -0,0 +1,36 @@
/*
* 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.metric.ws;

import org.sonar.core.component.Module;

public class MetricsWsModule extends Module {
@Override
protected void configureModule() {
add(
MetricsWs.class,
CreateAction.class,
DeleteAction.class,
DomainsAction.class,
SearchAction.class,
TypesAction.class);
}
}

+ 2
- 8
server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java View File

@@ -169,8 +169,7 @@ import org.sonar.server.measure.template.ProjectFilter;
import org.sonar.server.measure.ws.ManualMeasuresWs;
import org.sonar.server.measure.ws.TimeMachineWs;
import org.sonar.server.metric.CoreCustomMetrics;
import org.sonar.server.metric.ws.MetricsWs;
import org.sonar.server.metric.ws.SearchAction;
import org.sonar.server.metric.ws.MetricsWsModule;
import org.sonar.server.notifications.NotificationCenter;
import org.sonar.server.notifications.NotificationService;
import org.sonar.server.permission.InternalPermissionService;
@@ -494,13 +493,8 @@ public class PlatformLevel4 extends PlatformLevel {
DefaultMetricFinder.class,
TimeMachineWs.class,
ManualMeasuresWs.class,
MetricsWs.class,
SearchAction.class,
org.sonar.server.metric.ws.TypesAction.class,
org.sonar.server.metric.ws.DomainsAction.class,
org.sonar.server.metric.ws.DeleteAction.class,
org.sonar.server.metric.ws.CreateAction.class,

MetricsWsModule.class,

// quality gates
QualityGateDao.class,

+ 35
- 0
server/sonar-server/src/test/java/org/sonar/server/metric/ws/MetricsWsModuleTest.java View File

@@ -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.metric.ws;

import org.junit.Test;
import org.sonar.core.platform.ComponentContainer;

import static org.assertj.core.api.Assertions.assertThat;

public class MetricsWsModuleTest {
@Test
public void verify_count_of_added_components() {
ComponentContainer container = new ComponentContainer();
new MetricsWsModule().configure(container);
assertThat(container.size()).isEqualTo(8);
}
}

Loading…
Cancel
Save