@@ -31,9 +31,7 @@ public final class CreateSubProjects extends ProjectBuilder { | |||
private Settings settings; | |||
public CreateSubProjects(ProjectReactor reactor, Settings settings) { | |||
super(reactor); | |||
public CreateSubProjects(Settings settings) { | |||
// A real implementation should for example use the configuration | |||
this.settings = settings; | |||
} |
@@ -1,3 +1,4 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
@@ -28,9 +29,8 @@ import org.sonar.api.config.Settings; | |||
public final class RenameProject extends ProjectBuilder { | |||
private Settings settings; | |||
public RenameProject(ProjectReactor reactor, Settings settings) { | |||
super(reactor); | |||
public RenameProject(Settings settings) { | |||
this.settings = settings; | |||
} | |||
@@ -19,15 +19,6 @@ | |||
*/ | |||
package org.sonar.ce.container; | |||
import static java.lang.String.valueOf; | |||
import static org.assertj.core.api.Assertions.assertThat; | |||
import static org.sonar.process.ProcessEntryPoint.PROPERTY_PROCESS_INDEX; | |||
import static org.sonar.process.ProcessEntryPoint.PROPERTY_SHARED_PATH; | |||
import static org.sonar.process.ProcessProperties.PATH_DATA; | |||
import static org.sonar.process.ProcessProperties.PATH_HOME; | |||
import static org.sonar.process.ProcessProperties.PATH_TEMP; | |||
import static org.sonar.process.ProcessProperties.STARTED_AT; | |||
import java.io.File; | |||
import java.io.IOException; | |||
import java.util.Date; | |||
@@ -43,6 +34,15 @@ import org.sonar.db.DbTester; | |||
import org.sonar.process.ProcessId; | |||
import org.sonar.process.Props; | |||
import static java.lang.String.valueOf; | |||
import static org.assertj.core.api.Assertions.assertThat; | |||
import static org.sonar.process.ProcessEntryPoint.PROPERTY_PROCESS_INDEX; | |||
import static org.sonar.process.ProcessEntryPoint.PROPERTY_SHARED_PATH; | |||
import static org.sonar.process.ProcessProperties.PATH_DATA; | |||
import static org.sonar.process.ProcessProperties.PATH_HOME; | |||
import static org.sonar.process.ProcessProperties.PATH_TEMP; | |||
import static org.sonar.process.ProcessProperties.STARTED_AT; | |||
public class ComputeEngineContainerImplTest { | |||
private static final int CONTAINER_ITSELF = 1; | |||
private static final int COMPONENTS_IN_LEVEL_1_AT_CONSTRUCTION = CONTAINER_ITSELF + 1; | |||
@@ -102,7 +102,7 @@ public class ComputeEngineContainerImplTest { | |||
+ 22 // level 1 | |||
+ 46 // content of DaoModule | |||
+ 1 // content of EsSearchModule | |||
+ 56 // content of CorePropertyDefinitions | |||
+ 55 // content of CorePropertyDefinitions | |||
+ 1 // content of CePropertyDefinitions | |||
); | |||
assertThat(picoContainer.getParent().getParent().getParent().getParent()).isNull(); |
@@ -19,8 +19,6 @@ | |||
*/ | |||
package org.sonar.core.config; | |||
import static org.sonar.api.database.DatabaseProperties.PROP_PASSWORD; | |||
import com.google.common.collect.ImmutableList; | |||
import com.google.common.collect.Lists; | |||
import java.util.Arrays; | |||
@@ -30,6 +28,8 @@ import org.sonar.api.PropertyType; | |||
import org.sonar.api.config.PropertyDefinition; | |||
import org.sonar.api.resources.Qualifiers; | |||
import static org.sonar.api.database.DatabaseProperties.PROP_PASSWORD; | |||
public class CorePropertyDefinitions { | |||
/* Time machine periods */ | |||
@@ -212,13 +212,6 @@ public class CorePropertyDefinitions { | |||
// BATCH | |||
PropertyDefinition.builder(CoreProperties.CORE_VIOLATION_LOCALE_PROPERTY) | |||
.defaultValue("en") | |||
.name("Locale used for issue messages") | |||
.description("Deprecated property. Keep default value for backward compatibility.") | |||
.hidden() | |||
.build(), | |||
PropertyDefinition.builder(TIMEMACHINE_PERIOD_PREFIX + 1) | |||
.name("Leak Period") | |||
.description("Period used to compare measures and track new issues. Values are : <ul class='bullet'><li>Number of days before " + |
@@ -74,40 +74,18 @@ public interface CoreProperties { | |||
*/ | |||
String CATEGORY_CODE_COVERAGE = "codeCoverage"; | |||
/** | |||
* @see #SUBCATEGORY_DUPLICATIONS | |||
* @since 2.11 | |||
* @deprecated since 4.0. See http://jira.sonarsource.com/browse/SONAR-4660. Do not forget to remove the properties from core bundles | |||
*/ | |||
@Deprecated | |||
String CATEGORY_DUPLICATIONS = "duplications"; | |||
/** | |||
* @since 2.11 | |||
*/ | |||
String CATEGORY_SECURITY = "security"; | |||
/** | |||
* @see #SUBCATEGORY_L10N | |||
* @since 2.11 | |||
* @deprecated since 4.0. See http://jira.sonarsource.com/browse/SONAR-4660. Do not forget to remove the properties from core bundles | |||
* @deprecated since 6.0 | |||
*/ | |||
@Deprecated | |||
String CATEGORY_L10N = "localization"; | |||
/** | |||
* @since 2.11 | |||
*/ | |||
String CATEGORY_JAVA = "java"; | |||
/** | |||
* @see #SUBCATEGORY_DIFFERENTIAL_VIEWS | |||
* @since 2.11 | |||
* @deprecated since 4.0. See http://jira.sonarsource.com/browse/SONAR-4660. Do not forget to remove the properties from core bundles | |||
*/ | |||
@Deprecated | |||
String CATEGORY_DIFFERENTIAL_VIEWS = "differentialViews"; | |||
/** | |||
* @since 3.3 | |||
*/ | |||
@@ -176,12 +154,6 @@ public interface CoreProperties { | |||
@Deprecated | |||
String PROJECT_LANGUAGE_PROPERTY = "sonar.language"; | |||
/** | |||
* @deprecated since 4.3. See http://jira.sonarsource.com/browse/SONAR-5185 | |||
*/ | |||
@Deprecated | |||
String DYNAMIC_ANALYSIS_PROPERTY = "sonar.dynamicAnalysis"; | |||
/* Exclusions */ | |||
String PROJECT_INCLUSIONS_PROPERTY = "sonar.inclusions"; | |||
String PROJECT_EXCLUSIONS_PROPERTY = "sonar.exclusions"; | |||
@@ -199,14 +171,6 @@ public interface CoreProperties { | |||
/* Sonar Core */ | |||
/** | |||
* @deprecated since 4.1. See http://jira.sonarsource.com/browse/SONAR-4875 | |||
*/ | |||
@Deprecated | |||
String CORE_VIOLATION_LOCALE_PROPERTY = "sonar.violationLocale"; | |||
String CORE_VIOLATION_LOCALE_DEFAULT_VALUE = "en"; | |||
String CORE_FORCE_AUTHENTICATION_PROPERTY = "sonar.forceAuthentication"; | |||
boolean CORE_FORCE_AUTHENTICATION_DEFAULT_VALUE = false; | |||
String CORE_ALLOW_USERS_TO_SIGNUP_PROPERTY = "sonar.allowUsersToSignUp"; | |||
@@ -371,20 +335,6 @@ public interface CoreProperties { | |||
*/ | |||
String PROFILING_LOG_PROPERTY = "sonar.showProfiling"; | |||
/** | |||
* @deprecated replaced in v3.4 by properties specific to languages, for example sonar.java.coveragePlugin | |||
* See http://jira.sonarsource.com/browse/SONARJAVA-39 for more details. | |||
*/ | |||
@Deprecated | |||
String CORE_COVERAGE_PLUGIN_PROPERTY = "sonar.core.codeCoveragePlugin"; | |||
/** | |||
* @since 3.7 | |||
* @deprecated in 4.0 no more used | |||
*/ | |||
@Deprecated | |||
String DRY_RUN_READ_TIMEOUT_SEC = "sonar.dryRun.readTimeout"; | |||
/** | |||
* @since 4.0 | |||
* @deprecated in 5.1 no more used |
@@ -19,9 +19,9 @@ | |||
*/ | |||
package org.sonar.api.batch.bootstrap; | |||
import org.sonar.api.batch.ScannerSide; | |||
import org.sonar.api.ExtensionPoint; | |||
import org.sonar.api.batch.InstantiationStrategy; | |||
import org.sonar.api.batch.ScannerSide; | |||
/** | |||
* This extension point allows to change project structure at runtime. It is executed once during task startup. | |||
@@ -48,14 +48,6 @@ public abstract class ProjectBuilder { | |||
ProjectReactor projectReactor(); | |||
} | |||
/** | |||
* Don't inject ProjectReactor as it may not be available | |||
* @deprecated since 3.7 use {@link #ProjectBuilder()} | |||
*/ | |||
@Deprecated | |||
protected ProjectBuilder(final ProjectReactor reactor) { | |||
} | |||
/** | |||
* @since 3.7 | |||
*/ |
@@ -57,8 +57,7 @@ public class ProjectConfigurator { | |||
Date analysisDate = loadAnalysisDate(); | |||
project | |||
.setAnalysisDate(analysisDate) | |||
.setAnalysisVersion(loadAnalysisVersion()) | |||
.setAnalysisType(loadAnalysisType()); | |||
.setAnalysisVersion(loadAnalysisVersion()); | |||
return this; | |||
} | |||
@@ -78,22 +77,6 @@ public class ProjectConfigurator { | |||
return date; | |||
} | |||
private Project.AnalysisType loadAnalysisType() { | |||
String value = settings.getString(CoreProperties.DYNAMIC_ANALYSIS_PROPERTY); | |||
if (value == null) { | |||
return Project.AnalysisType.DYNAMIC; | |||
} | |||
LOG.warn("'sonar.dynamicAnalysis' is deprecated since version 4.3 and should no longer be used."); | |||
if ("true".equals(value)) { | |||
return Project.AnalysisType.DYNAMIC; | |||
} | |||
if ("reuseReports".equals(value)) { | |||
return Project.AnalysisType.REUSE_REPORTS; | |||
} | |||
return Project.AnalysisType.STATIC; | |||
} | |||
private String loadAnalysisVersion() { | |||
return settings.getString(CoreProperties.PROJECT_VERSION_PROPERTY); | |||
} |
@@ -88,33 +88,6 @@ public class ProjectConfiguratorTest { | |||
assertThat(project.getAnalysisType()).isEqualTo(Project.AnalysisType.DYNAMIC); | |||
} | |||
@Test | |||
public void explicit_dynamic_analysis() { | |||
Settings configuration = new Settings(); | |||
configuration.setProperty(CoreProperties.DYNAMIC_ANALYSIS_PROPERTY, "true"); | |||
Project project = new Project("key"); | |||
new ProjectConfigurator(configuration, system2).configure(project); | |||
assertThat(project.getAnalysisType()).isEqualTo(Project.AnalysisType.DYNAMIC); | |||
} | |||
@Test | |||
public void explicit_static_analysis() { | |||
Settings configuration = new Settings(); | |||
configuration.setProperty(CoreProperties.DYNAMIC_ANALYSIS_PROPERTY, "false"); | |||
Project project = new Project("key"); | |||
new ProjectConfigurator(configuration, system2).configure(project); | |||
assertThat(project.getAnalysisType()).isEqualTo(Project.AnalysisType.STATIC); | |||
} | |||
@Test | |||
public void explicit_dynamic_analysis_reusing_reports() { | |||
Settings configuration = new Settings(); | |||
configuration.setProperty(CoreProperties.DYNAMIC_ANALYSIS_PROPERTY, "reuseReports"); | |||
Project project = new Project("key"); | |||
new ProjectConfigurator(configuration, system2).configure(project); | |||
assertThat(project.getAnalysisType()).isEqualTo(Project.AnalysisType.REUSE_REPORTS); | |||
} | |||
@Test | |||
public void is_dynamic_analysis() { | |||
assertThat(Project.AnalysisType.DYNAMIC.isDynamic(false)).isTrue(); |