+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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.debt;
-
-import java.util.Collections;
-import java.util.List;
-import javax.annotation.CheckForNull;
-import org.sonar.api.server.debt.DebtCharacteristic;
-import org.sonar.api.server.debt.DebtModel;
-import org.sonar.api.utils.ValidationMessages;
-
-/**
- * Also used by SQALE plugin.
- */
-public class DebtModelService implements DebtModel {
-
- private final DebtModelBackup debtModelBackup;
-
- public DebtModelService(DebtModelBackup debtModelBackup) {
- this.debtModelBackup = debtModelBackup;
- }
-
- @Override
- public List<DebtCharacteristic> characteristics() {
- return Collections.emptyList();
- }
-
- @Override
- public List<DebtCharacteristic> allCharacteristics() {
- return Collections.emptyList();
- }
-
- @Override
- @CheckForNull
- public DebtCharacteristic characteristicByKey(String key) {
- return null;
- }
-
- /**
- * Reset model
- */
- public void reset() {
- debtModelBackup.reset();
- }
-
- /**
- * Restore from XML
- */
- public ValidationMessages restoreFromXml(String xml) {
- return debtModelBackup.restoreFromXml(xml);
- }
-
- /**
- * Restore from XML and a given language
- */
- public ValidationMessages restoreFromXmlAndLanguage(String xml, String languageKey) {
- return debtModelBackup.restoreFromXml(xml, languageKey);
- }
-
- public String backup() {
- return debtModelBackup.backup();
- }
-
- public String backupFromLanguage(String languageKey) {
- return debtModelBackup.backup(languageKey);
- }
-
-}
import org.sonar.server.component.ws.ComponentsWsModule;
import org.sonar.server.debt.DebtModelBackup;
import org.sonar.server.debt.DebtModelPluginRepository;
-import org.sonar.server.debt.DebtModelService;
import org.sonar.server.debt.DebtModelXMLExporter;
import org.sonar.server.debt.DebtRulesXMLImporter;
import org.sonar.server.duplication.ws.DuplicationsJsonWriter;
RemoveTagsAction.class,
// technical debt
- DebtModelService.class,
DebtModelBackup.class,
DebtModelPluginRepository.class,
DebtModelXMLExporter.class,
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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.debt;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import static org.mockito.Mockito.verify;
-
-@RunWith(MockitoJUnitRunner.class)
-public class DebtModelServiceTest {
-
- @Mock
- DebtModelBackup debtModelBackup;
-
- DebtModelService underTest;
-
- @Before
- public void setUp() {
- underTest = new DebtModelService(debtModelBackup);
- }
-
- @Test
- public void reset_model() {
- underTest.reset();
- verify(debtModelBackup).reset();
- }
-
- @Test
- public void restore_xml() {
- underTest.restoreFromXml("<xml/>");
- verify(debtModelBackup).restoreFromXml("<xml/>");
- }
-
- @Test
- public void restore_from_xml_and_language() {
- underTest.restoreFromXmlAndLanguage("<xml/>", "xoo");
- verify(debtModelBackup).restoreFromXml("<xml/>", "xoo");
- }
-
- @Test
- public void backup() {
- underTest.backup();
- verify(debtModelBackup).backup();
- }
-
- @Test
- public void backup_fom_language() {
- underTest.backupFromLanguage("xoo");
- verify(debtModelBackup).backup("xoo");
- }
-}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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.server.debt;
-
-import javax.annotation.CheckForNull;
-
-/**
- * @since 4.3
- * @deprecated in 5.2. It will be dropped in version 6.0 (see https://jira.sonarsource.com/browse/SONAR-6393)
- */
-@Deprecated
-public interface DebtCharacteristic {
-
- /**
- * Only used when a characteristic is disabled (id is -1 in dto) by the user.
- */
- String NONE = "NONE";
-
- String key();
-
- String name();
-
- @CheckForNull
- Integer order();
-
- boolean isSub();
-}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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.server.debt;
-
-import java.util.List;
-import javax.annotation.CheckForNull;
-import org.sonar.api.ce.ComputeEngineSide;
-import org.sonar.api.server.ServerSide;
-
-/**
- * @since 4.3
- * @deprecated in 5.2. It will be dropped in version 6.0 (see https://jira.sonarsource.com/browse/SONAR-6393)
- */
-@ServerSide
-@ComputeEngineSide
-@Deprecated
-public interface DebtModel {
-
- /**
- * @return an empty list since 5.5.
- */
- List<DebtCharacteristic> allCharacteristics();
-
- /**
- * @return an empty list since 5.5.
- */
- List<DebtCharacteristic> characteristics();
-
- /**
- * @return null since 5.5.
- */
- @CheckForNull
- DebtCharacteristic characteristicByKey(String key);
-
-}