use of org.sonar.scanner.analysis.AnalysisProperties in project sonarqube by SonarSource.
the class DefaultAnalysisModeTest method scan_all.
@Test
public void scan_all() {
Map<String, String> props = new HashMap<>();
props.put(CoreProperties.ANALYSIS_MODE, CoreProperties.ANALYSIS_MODE_ISSUES);
GlobalProperties globalProps = new GlobalProperties(props);
AnalysisProperties analysisProps = new AnalysisProperties(new HashMap<String, String>());
DefaultAnalysisMode mode = new DefaultAnalysisMode(globalProps, analysisProps);
assertThat(mode.scanAllFiles()).isFalse();
props.put("sonar.scanAllFiles", "true");
analysisProps = new AnalysisProperties(props);
mode = new DefaultAnalysisMode(globalProps, analysisProps);
assertThat(mode.scanAllFiles()).isTrue();
props.put(CoreProperties.ANALYSIS_MODE, CoreProperties.ANALYSIS_MODE_PUBLISH);
analysisProps = new AnalysisProperties(props);
mode = new DefaultAnalysisMode(globalProps, analysisProps);
assertThat(mode.scanAllFiles()).isTrue();
}
use of org.sonar.scanner.analysis.AnalysisProperties in project sonarqube by SonarSource.
the class DefaultAnalysisModeTest method createMode.
private static DefaultAnalysisMode createMode(@Nullable String bootstrapMode, @Nullable String analysisMode) {
Map<String, String> bootstrapMap = new HashMap<>();
Map<String, String> analysisMap = new HashMap<>();
if (bootstrapMode != null) {
bootstrapMap.put(CoreProperties.ANALYSIS_MODE, bootstrapMode);
}
if (analysisMode != null) {
analysisMap.put(CoreProperties.ANALYSIS_MODE, analysisMode);
}
return new DefaultAnalysisMode(new GlobalProperties(bootstrapMap), new AnalysisProperties(analysisMap));
}
use of org.sonar.scanner.analysis.AnalysisProperties in project sonarqube by SonarSource.
the class ScanTask method execute.
@Override
public void execute() {
AnalysisProperties props = new AnalysisProperties(taskProps.properties(), taskProps.property(CoreProperties.ENCRYPTION_SECRET_KEY_PATH));
new ProjectScanContainer(taskContainer, props).execute();
}
use of org.sonar.scanner.analysis.AnalysisProperties in project sonarqube by SonarSource.
the class ProjectReactorBuilderTest method shouldRemoveModulePropertiesFromTaskProperties.
@Test
public void shouldRemoveModulePropertiesFromTaskProperties() {
Map<String, String> props = loadProps("big-multi-module-definitions-all-in-root");
AnalysisProperties taskProperties = new AnalysisProperties(props, null);
assertThat(taskProperties.property("module1.module11.property")).isEqualTo("My module11 property");
new ProjectReactorBuilder(taskProperties).execute();
assertThat(taskProperties.property("module1.module11.property")).isNull();
}
use of org.sonar.scanner.analysis.AnalysisProperties in project sonarqube by SonarSource.
the class ProjectReactorBuilderTest method should_log_a_warning_when_a_dropped_property_is_present.
@Test
public void should_log_a_warning_when_a_dropped_property_is_present() {
Map<String, String> props = loadProps("simple-project");
props.put("sonar.qualitygate", "somevalue");
AnalysisProperties bootstrapProps = new AnalysisProperties(props, null);
new ProjectReactorBuilder(bootstrapProps).execute();
assertThat(logTester.logs(LoggerLevel.WARN)).containsOnly("Property 'sonar.qualitygate' is not supported any more. It will be ignored.");
}
Aggregations