</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>
<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>
<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>
</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>
getComponentByType(ResourcePersister.class).getSnapshot(module),
TimeMachineConfiguration.class,
- org.sonar.api.database.daos.MeasuresDao.class,
DefaultSensorContext.class,
BatchExtensionDictionnary.class,
DefaultTimeMachine.class,
<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>
<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>
+++ /dev/null
-/*
- * 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);
- }
-
-}
--- /dev/null
+/*
+ * 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.i18n;
+
+import org.sonar.api.BatchComponent;
+import org.sonar.api.ServerComponent;
+import org.sonar.api.rules.Rule;
+
+import javax.annotation.CheckForNull;
+
+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 {
+
+ /**
+ * Returns the localized name of the rule identified by its repository key and rule key.
+ * <br>
+ * If the name is not found in the given locale, then the default name is returned (the English one).
+ * This method could return null if no default name found. This is the cause for instance the copies rules.
+ *
+ * @param repositoryKey the repository key
+ * @param ruleKey the rule key
+ * @param locale not used
+ * @return the translated name of the rule, or the default English one if the given locale is not supported, or null
+ * @deprecated since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885
+ */
+ @Deprecated
+ @CheckForNull
+ String getName(String repositoryKey, String ruleKey, Locale locale);
+
+ /**
+ * Returns the name of the rule identified by its repository key and rule key.
+ * <br>
+ * This method could return null if no default name found. This is the cause for instance the copies rules.
+ *
+ * @param repositoryKey the repository key
+ * @param ruleKey the rule key
+ * @return the nullable name of the rule
+ * @since 4.1
+ */
+ @CheckForNull
+ String getName(String repositoryKey, String ruleKey);
+
+ /**
+ * Returns the localized name or the name of the rule.
+ * <br>
+ * If the name is not found in the given locale, then the default name is returned (the English one).
+ * It the default name is not found, then the rule name is returned.
+ *
+ * @param rule the rule
+ * @param locale the locale to translate into
+ * @return the translated name of the rule, or the default English one if the given locale is not supported, or the rule name.
+ * @deprecated since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885
+ */
+ @Deprecated
+ @CheckForNull
+ String getName(Rule rule, Locale locale);
+
+ /**
+ * Returns the name of the rule.
+ * <br>
+ * It the default name is not found, then the rule name is returned.
+ *
+ * @param rule the rule
+ * @return the nullable name of the rule
+ * @since 4.1
+ */
+ @CheckForNull
+ String getName(Rule rule);
+
+ /**
+ * Returns the localized description of the rule identified by its repository key and rule key.
+ * <br>
+ * If the description is not found in the given locale, then the default description is returned (the English one).
+ * As a rule must have a description (this is a constraint in Sonar), this method never returns null.
+ *
+ * @param repositoryKey the repository key
+ * @param ruleKey the rule key
+ * @param locale the locale to translate into
+ * @return the translated description of the rule, or the default English one if the given locale is not supported
+ * @deprecated since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885
+ */
+ @Deprecated
+ String getDescription(String repositoryKey, String ruleKey, Locale locale);
+
+ /**
+ * Returns the description of the rule identified by its repository key and rule key.
+ * <br>
+ * As a rule must have a description (this is a constraint in SonarQube), this method never returns null.
+ *
+ * @param repositoryKey the repository key
+ * @param ruleKey the rule key
+ * @return the description of the rule
+ * @since 4.1
+ */
+ String getDescription(String repositoryKey, String ruleKey);
+
+ /**
+ * Returns the localized name of the rule parameter identified by the rules's key and repository key, and by the parameter key.
+ * <br>
+ * If the name is not found in the given locale, then the English translation is searched and return if found. Otherwise,
+ * this method returns null (= if no translation can be found).
+ *
+ * @param repositoryKey the repository key
+ * @param ruleKey the rule key
+ * @param paramKey the parameter key
+ * @param locale the locale to translate into
+ * @return the translated name of the rule parameter, or the default English one if the given locale is not supported, or null if
+ * no translation can be found.
+ * @deprecated since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885
+ */
+ @Deprecated
+ @CheckForNull
+ String getParamDescription(String repositoryKey, String ruleKey, String paramKey, Locale locale);
+
+ /**
+ * Returns the name of the rule parameter identified by the rules's key and repository key, and by the parameter key.
+ *
+ * @param repositoryKey the repository key
+ * @param ruleKey the rule key
+ * @param paramKey the parameter key
+ * @return the nullable name of the rule parameter
+ * @since 4.1
+ */
+ @CheckForNull
+ String getParamDescription(String repositoryKey, String ruleKey, String paramKey);
+
+}
--- /dev/null
+/*
+ * 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.web;
+
+import org.sonar.api.ServerExtension;
+
+/**
+ * @since 1.10
+ * @deprecated in 3.7. Replaced by Ruby on Rails extensions
+ */
+@Deprecated
+public interface GwtExtension extends ServerExtension {
+ String getGwtId();
+}
--- /dev/null
+/*
+ * 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.web;
+
+/**
+ * @since 1.11
+ * @deprecated in 3.7. Replaced by Ruby on Rails pages.
+ */
+@Deprecated
+public abstract class GwtPage implements Page, GwtExtension {
+
+ public final String getId() {
+ return getGwtId();
+ }
+
+}
+++ /dev/null
-/*
- * 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.i18n;
-
-import org.sonar.api.BatchComponent;
-import org.sonar.api.ServerComponent;
-import org.sonar.api.rules.Rule;
-
-import javax.annotation.CheckForNull;
-
-import java.util.Locale;
-
-/**
- * {@link I18n}-companion component that provides translation facilities for rule names, descriptions and parameter names.
- *
- * @since 3.2
- */
-public interface RuleI18n extends ServerComponent, BatchComponent {
-
- /**
- * Returns the localized name of the rule identified by its repository key and rule key.
- * <br>
- * If the name is not found in the given locale, then the default name is returned (the English one).
- * This method could return null if no default name found. This is the cause for instance the copies rules.
- *
- * @param repositoryKey the repository key
- * @param ruleKey the rule key
- * @param locale not used
- * @return the translated name of the rule, or the default English one if the given locale is not supported, or null
- * @deprecated since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885
- */
- @Deprecated
- @CheckForNull
- String getName(String repositoryKey, String ruleKey, Locale locale);
-
- /**
- * Returns the name of the rule identified by its repository key and rule key.
- * <br>
- * This method could return null if no default name found. This is the cause for instance the copies rules.
- *
- * @param repositoryKey the repository key
- * @param ruleKey the rule key
- * @return the nullable name of the rule
- * @since 4.1
- */
- @CheckForNull
- String getName(String repositoryKey, String ruleKey);
-
- /**
- * Returns the localized name or the name of the rule.
- * <br>
- * If the name is not found in the given locale, then the default name is returned (the English one).
- * It the default name is not found, then the rule name is returned.
- *
- * @param rule the rule
- * @param locale the locale to translate into
- * @return the translated name of the rule, or the default English one if the given locale is not supported, or the rule name.
- * @deprecated since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885
- */
- @Deprecated
- @CheckForNull
- String getName(Rule rule, Locale locale);
-
- /**
- * Returns the name of the rule.
- * <br>
- * It the default name is not found, then the rule name is returned.
- *
- * @param rule the rule
- * @return the nullable name of the rule
- * @since 4.1
- */
- @CheckForNull
- String getName(Rule rule);
-
- /**
- * Returns the localized description of the rule identified by its repository key and rule key.
- * <br>
- * If the description is not found in the given locale, then the default description is returned (the English one).
- * As a rule must have a description (this is a constraint in Sonar), this method never returns null.
- *
- * @param repositoryKey the repository key
- * @param ruleKey the rule key
- * @param locale the locale to translate into
- * @return the translated description of the rule, or the default English one if the given locale is not supported
- * @deprecated since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885
- */
- @Deprecated
- String getDescription(String repositoryKey, String ruleKey, Locale locale);
-
- /**
- * Returns the description of the rule identified by its repository key and rule key.
- * <br>
- * As a rule must have a description (this is a constraint in SonarQube), this method never returns null.
- *
- * @param repositoryKey the repository key
- * @param ruleKey the rule key
- * @return the description of the rule
- * @since 4.1
- */
- String getDescription(String repositoryKey, String ruleKey);
-
- /**
- * Returns the localized name of the rule parameter identified by the rules's key and repository key, and by the parameter key.
- * <br>
- * If the name is not found in the given locale, then the English translation is searched and return if found. Otherwise,
- * this method returns null (= if no translation can be found).
- *
- * @param repositoryKey the repository key
- * @param ruleKey the rule key
- * @param paramKey the parameter key
- * @param locale the locale to translate into
- * @return the translated name of the rule parameter, or the default English one if the given locale is not supported, or null if
- * no translation can be found.
- * @deprecated since 4.1. Rules are not localized anymore. See http://jira.codehaus.org/browse/SONAR-4885
- */
- @Deprecated
- @CheckForNull
- String getParamDescription(String repositoryKey, String ruleKey, String paramKey, Locale locale);
-
- /**
- * Returns the name of the rule parameter identified by the rules's key and repository key, and by the parameter key.
- *
- * @param repositoryKey the repository key
- * @param ruleKey the rule key
- * @param paramKey the parameter key
- * @return the nullable name of the rule parameter
- * @since 4.1
- */
- @CheckForNull
- String getParamDescription(String repositoryKey, String ruleKey, String paramKey);
-
-}
+++ /dev/null
-/*
- * 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.web;
-
-import org.sonar.api.ServerExtension;
-
-/**
- * @since 1.10
- * @deprecated in 3.7. Replaced by Ruby on Rails extensions
- */
-@Deprecated
-public interface GwtExtension extends ServerExtension {
- String getGwtId();
-}
+++ /dev/null
-/*
- * 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.web;
-
-/**
- * @since 1.11
- * @deprecated in 3.7. Replaced by Ruby on Rails pages.
- */
-@Deprecated
-public abstract class GwtPage implements Page, GwtExtension {
-
- public final String getId() {
- return getGwtId();
- }
-
-}
<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>
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);
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;
*/
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;
}
import com.google.common.collect.Maps;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
-import org.sonar.core.i18n.RuleI18nManager;
import java.util.Map;
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"})
<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>