Browse Source

Remove org.sonar.api.database.daos.MeasuresDao, deprecated since v2.3 and move some deprecated classes from sonar-plugin-api to sonar-deprecated

tags/4.2
Simon Brandhof 10 years ago
parent
commit
87ecfc8080

+ 7
- 0
plugins/sonar-core-plugin/pom.xml View File

@@ -57,6 +57,13 @@
</dependency>

<!-- unit tests -->
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-testing-harness</artifactId>

+ 5
- 0
plugins/sonar-dbcleaner-plugin/pom.xml View File

@@ -20,6 +20,11 @@
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-plugin-api</artifactId>

+ 4
- 0
plugins/sonar-design-plugin/pom.xml View File

@@ -22,6 +22,10 @@
<artifactId>sonar-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-deprecated</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-plugin-api</artifactId>

+ 7
- 0
sonar-batch/pom.xml View File

@@ -88,6 +88,13 @@
</dependency>

<!-- unit tests -->
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-core</artifactId>
<type>test-jar</type>
<scope>test</scope>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-testing-harness</artifactId>

+ 0
- 1
sonar-batch/src/main/java/org/sonar/batch/scan/ModuleScanContainer.java View File

@@ -121,7 +121,6 @@ public class ModuleScanContainer extends ComponentContainer {
getComponentByType(ResourcePersister.class).getSnapshot(module),

TimeMachineConfiguration.class,
org.sonar.api.database.daos.MeasuresDao.class,
DefaultSensorContext.class,
BatchExtensionDictionnary.class,
DefaultTimeMachine.class,

+ 4
- 0
sonar-core/pom.xml View File

@@ -33,6 +33,10 @@
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-deprecated</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-update-center-common</artifactId>

+ 0
- 4
sonar-deprecated/pom.xml View File

@@ -10,10 +10,6 @@
<name>SonarQube :: Deprecated</name>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-core</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-plugin-api</artifactId>

+ 0
- 79
sonar-deprecated/src/main/java/org/sonar/api/database/daos/MeasuresDao.java View File

@@ -1,79 +0,0 @@
/*
* SonarQube, open source software quality management tool.
* Copyright (C) 2008-2013 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.api.database.daos;

import org.sonar.api.measures.Metric;

import java.util.Collection;
import java.util.List;

/**
* @deprecated since 2.3
*/
@Deprecated
public class MeasuresDao {

private org.sonar.jpa.dao.MeasuresDao target;

public MeasuresDao(org.sonar.jpa.dao.MeasuresDao target) {
this.target = target;
}

public Metric getMetric(Metric metric) {
return target.getMetric(metric);
}

public List<Metric> getMetrics(List<Metric> metrics) {
return target.getMetrics(metrics);
}

public Metric getMetric(String metricName) {
return target.getMetric(metricName);
}

public Collection<Metric> getMetrics() {
return target.getMetrics();
}

public Collection<Metric> getEnabledMetrics() {
return target.getEnabledMetrics();
}

public Collection<Metric> getUserDefinedMetrics() {
return target.getUserDefinedMetrics();
}

public void disableAutomaticMetrics() {
target.disableAutomaticMetrics();
}

public void registerMetrics(Collection<Metric> metrics) {
target.registerMetrics(metrics);
}

public void persistMetric(Metric metric) {
target.persistMetric(metric);
}

public void disabledMetrics(Collection<Metric> metrics) {
target.disabledMetrics(metrics);
}

}

sonar-plugin-api/src/main/java/org/sonar/api/i18n/RuleI18n.java → sonar-deprecated/src/main/java/org/sonar/api/i18n/RuleI18n.java View File

@@ -31,7 +31,9 @@ import java.util.Locale;
* {@link I18n}-companion component that provides translation facilities for rule names, descriptions and parameter names.
*
* @since 3.2
* @deprecated in 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885
*/
@Deprecated
public interface RuleI18n extends ServerComponent, BatchComponent {

/**

sonar-plugin-api/src/main/java/org/sonar/api/web/GwtExtension.java → sonar-deprecated/src/main/java/org/sonar/api/web/GwtExtension.java View File


sonar-plugin-api/src/main/java/org/sonar/api/web/GwtPage.java → sonar-deprecated/src/main/java/org/sonar/api/web/GwtPage.java View File


+ 7
- 0
sonar-server/pom.xml View File

@@ -149,6 +149,13 @@
<scope>provided</scope>
</dependency>
<!-- unit tests -->
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>

+ 0
- 1
sonar-server/src/main/java/org/sonar/server/platform/Platform.java View File

@@ -245,7 +245,6 @@ public final class Platform {
servicesContainer.addSingleton(CodeColorizers.class);
servicesContainer.addComponent(RulesDao.class, false);
servicesContainer.addComponent(MeasuresDao.class, false);
servicesContainer.addComponent(org.sonar.api.database.daos.MeasuresDao.class, false);
servicesContainer.addComponent(ProfilesDao.class, false);
servicesContainer.addComponent(ProfilesManager.class, false);
servicesContainer.addSingleton(SecurityRealmFactory.class);

+ 1
- 4
sonar-server/src/main/java/org/sonar/server/rule/RubyRuleService.java View File

@@ -23,7 +23,6 @@ import com.google.common.collect.Maps;
import org.apache.commons.lang.StringUtils;
import org.picocontainer.Startable;
import org.sonar.api.ServerComponent;
import org.sonar.core.i18n.RuleI18nManager;

import java.util.Map;

@@ -32,14 +31,12 @@ import java.util.Map;
*/
public class RubyRuleService implements ServerComponent, Startable {

private final RuleI18nManager i18n;
private final RuleRegistry ruleRegistry;

private static final String OPTIONS_STATUS = "status";
private static final String OPTIONS_LANGUAGE = "language";

public RubyRuleService(RuleI18nManager i18n, RuleRegistry ruleRegistry) {
this.i18n = i18n;
public RubyRuleService(RuleRegistry ruleRegistry) {
this.ruleRegistry = ruleRegistry;
}


+ 1
- 3
sonar-server/src/test/java/org/sonar/server/rule/RubyRuleServiceTest.java View File

@@ -22,7 +22,6 @@ package org.sonar.server.rule;
import com.google.common.collect.Maps;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.sonar.core.i18n.RuleI18nManager;

import java.util.Map;

@@ -32,9 +31,8 @@ import static org.mockito.Mockito.verify;

public class RubyRuleServiceTest {

RuleI18nManager i18n = mock(RuleI18nManager.class);
RuleRegistry ruleRegistry = mock(RuleRegistry.class);
RubyRuleService facade = new RubyRuleService(i18n, ruleRegistry);
RubyRuleService facade = new RubyRuleService(ruleRegistry);

@Test
@SuppressWarnings({"unchecked", "rawtypes"})

+ 0
- 7
sonar-testing-harness/pom.xml View File

@@ -69,13 +69,6 @@
<scope>compile</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-core</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>

Loading…
Cancel
Save