import org.sonar.db.DatabaseChecker;
import org.sonar.db.DbClient;
import org.sonar.db.DefaultDatabase;
+import org.sonar.db.MyBatis;
import org.sonar.db.purge.PurgeProfiler;
import org.sonar.process.NetworkUtilsImpl;
import org.sonar.process.Props;
import org.sonar.server.config.ConfigurationProvider;
import org.sonar.server.debt.DebtModelPluginRepository;
import org.sonar.server.debt.DebtRulesXMLImporter;
+import org.sonar.server.es.EsModule;
import org.sonar.server.es.ProjectIndexersImpl;
import org.sonar.server.event.NewAlerts;
import org.sonar.server.favorite.FavoriteUpdater;
import org.sonar.server.rule.DeprecatedRulesDefinitionLoader;
import org.sonar.server.rule.RuleDefinitionsLoader;
import org.sonar.server.rule.index.RuleIndex;
-import org.sonar.server.es.EsModule;
import org.sonar.server.setting.DatabaseSettingLoader;
import org.sonar.server.setting.DatabaseSettingsEnabler;
import org.sonar.server.setting.ThreadLocalSettings;
LogbackHelper.class,
DefaultDatabase.class,
DatabaseChecker.class,
- // must instantiate deprecated class in 5.2 and only this one (and not its replacement)
- // to avoid having two SqlSessionFactory instances
- org.sonar.core.persistence.MyBatis.class,
+ MyBatis.class,
PurgeProfiler.class,
ServerFileSystemImpl.class,
new TempFolderProvider(),
import java.util.Map;
import org.sonar.api.utils.System2;
-import org.sonar.core.properties.PropertiesDao;
import org.sonar.db.DbSession;
import org.sonar.db.MyBatis;
+import org.sonar.db.property.PropertiesDao;
import org.sonar.db.property.PropertyDto;
/**
// do nothing
}
- @Override
- public void setProperty(org.sonar.core.properties.PropertyDto property) {
- // do nothing
- }
-
}
private MyBatis myBatis = mock(MyBatis.class);
private DbSession dbSession = mock(DbSession.class);
private PropertyDto propertyDto = mock(PropertyDto.class);
- private org.sonar.core.properties.PropertyDto oldPropertyDto = mock(org.sonar.core.properties.PropertyDto.class);
+ private PropertyDto oldPropertyDto = mock(PropertyDto.class);
private ReadOnlyPropertiesDao underTest = new ReadOnlyPropertiesDao(myBatis, System2.INSTANCE);
@Test
underTest.deleteProjectProperties(null, null, dbSession);
assertNoInteraction();
-
}
@Test
underTest.deleteGlobalProperty(null);
assertNoInteraction();
-
}
@Test
underTest.deleteGlobalProperty(null, dbSession);
assertNoInteraction();
-
}
@Test
underTest.saveGlobalProperties(null);
assertNoInteraction();
-
}
@Test
underTest.renamePropertyKey(null, null);
assertNoInteraction();
-
}
@Test
assertNoInteraction();
}
- @Test
- public void setProperty() {
- underTest.setProperty(oldPropertyDto);
-
- assertNoInteraction();
- }
-
private void assertNoInteraction() {
verifyNoMoreInteractions(myBatis, dbSession, propertyDto);
}
/**
* Holds the constants representing the various component permissions that can be assigned to users & groups
- *
*/
public final class ProjectPermissions {
/**
/**
* All the component permissions values, ordered from {@link UserRole#USER} to {@link GlobalPermissions#SCAN_EXECUTION}.
*/
- public static final List<String> ALL = ImmutableList.of(UserRole.ADMIN, UserRole.CODEVIEWER, UserRole.ISSUE_ADMIN, GlobalPermissions.SCAN_EXECUTION, UserRole.USER);
+ public static final List<String> ALL = ImmutableList.of(UserRole.ADMIN, UserRole.CODEVIEWER, UserRole.ISSUE_ADMIN, GlobalPermissions.SCAN_EXECUTION, UserRole.USER);
public static final String ALL_ON_ONE_LINE = Joiner.on(", ").join(ProjectPermissions.ALL);
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info 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.core.persistence;
-
-import org.sonar.db.Database;
-
-/**
- * Kept for backward compatibility of plugins/libs (like sonar-license) that are directly calling classes from the core
- *
- * @deprecated since 5.2, should be replaced by {@link org.sonar.db.MyBatis}
- */
-@Deprecated
-public class MyBatis extends org.sonar.db.MyBatis {
-
- public MyBatis(Database database) {
- super(database);
- }
-
-}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info 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.
- */
-@ParametersAreNonnullByDefault
-package org.sonar.core.persistence;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info 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.core.properties;
-
-import org.sonar.api.utils.System2;
-import org.sonar.db.MyBatis;
-
-/**
- * Kept for backward compatibility of plugins/libs (like sonar-license) that are directly calling classes from the core
- *
- * @deprecated since 5.2, should be replaced by {@link org.sonar.db.property.PropertiesDao}
- */
-@Deprecated
-public class PropertiesDao extends org.sonar.db.property.PropertiesDao {
-
- public PropertiesDao(MyBatis mybatis, System2 system2) {
- super(mybatis, system2);
- }
-
- public void setProperty(PropertyDto property) {
- super.saveProperty(property);
- }
-}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info 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.core.properties;
-
-/**
- * Kept for backward compatibility of plugins/libs (like sonar-license) that are directly calling classes from the core
- *
- * @deprecated since 5.2, should be replaced by {@link org.sonar.db.property.PropertyDto}
- */
-@Deprecated
-public class PropertyDto extends org.sonar.db.property.PropertyDto {
-
- @Override
- public PropertyDto setKey(String key) {
- super.setKey(key);
- return this;
- }
-
- @Override
- public PropertyDto setValue(String value) {
- super.setValue(value);
- return this;
- }
-}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2018 SonarSource SA
- * mailto:info 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.
- */
-@ParametersAreNonnullByDefault
-package org.sonar.core.properties;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
import org.sonar.api.utils.System2;
import org.sonar.api.utils.Version;
import org.sonar.api.utils.internal.TempFolderCleaner;
-import org.sonar.server.config.ConfigurationProvider;
import org.sonar.core.config.CorePropertyDefinitions;
import org.sonar.core.util.UuidFactoryImpl;
import org.sonar.db.DBSessionsImpl;
import org.sonar.db.DatabaseChecker;
import org.sonar.db.DbClient;
import org.sonar.db.DefaultDatabase;
+import org.sonar.db.MyBatis;
import org.sonar.db.purge.PurgeProfiler;
import org.sonar.process.NetworkUtilsImpl;
import org.sonar.process.logging.LogbackHelper;
import org.sonar.server.app.ProcessCommandWrapperImpl;
import org.sonar.server.app.RestartFlagHolderImpl;
import org.sonar.server.app.WebServerProcessLogging;
+import org.sonar.server.config.ConfigurationProvider;
import org.sonar.server.es.EsModule;
import org.sonar.server.issue.index.IssueIndex;
import org.sonar.server.platform.LogServerVersion;
WebServerProcessLogging.class,
DefaultDatabase.class,
DatabaseChecker.class,
- // must instantiate deprecated class in 5.2 and only this one (and not its replacement)
- // to avoid having two SqlSessionFactory instances
- org.sonar.core.persistence.MyBatis.class,
+ MyBatis.class,
PurgeProfiler.class,
ServerFileSystemImpl.class,
TempFolderCleaner.class,
// issues
IssueIndex.class,
- new OkHttpClientProvider(),
- // Classes kept for backward compatibility of plugins/libs (like sonar-license) that are directly calling classes from the core
- org.sonar.core.properties.PropertiesDao.class);
+ new OkHttpClientProvider());
addAll(CorePropertyDefinitions.all());
// cluster