use of com.sonar.orchestrator.build.SonarScanner in project sonarqube by SonarSource.
the class IssuesModeTest method configureRunner.
private SonarScanner configureRunner(String projectDir, String... props) throws IOException {
SonarScanner runner = SonarScanner.create(ItUtils.projectDir(projectDir), "sonar.working.directory", temp.newFolder().getAbsolutePath(), "sonar.report.export.path", "sonar-report.json", "sonar.userHome", temp.newFolder().getAbsolutePath());
runner.setProperties(props);
return runner;
}
use of com.sonar.orchestrator.build.SonarScanner in project sonarqube by SonarSource.
the class PermissionTest method scanner_fails_if_authentication_token_is_not_valid.
@Test
public void scanner_fails_if_authentication_token_is_not_valid() {
SonarScanner sampleProject = SonarScanner.create(projectDir("shared/xoo-sample"));
sampleProject.setProperties("sonar.login", "unknown-token", "sonar.password", "");
BuildResult buildResult = orchestrator.executeBuildQuietly(sampleProject);
assertThat(buildResult.isSuccess()).isFalse();
}
use of com.sonar.orchestrator.build.SonarScanner in project sonarqube by SonarSource.
the class CrossModuleDuplicationsTest method analyzeProject.
private static SonarScanner analyzeProject(File projectDir, String projectKey, boolean create, String... additionalProperties) {
if (create) {
orchestrator.getServer().provisionProject(projectKey, projectKey);
orchestrator.getServer().associateProjectToQualityProfile(projectKey, "xoo", "xoo-duplication-profile");
}
SonarScanner sonarRunner = SonarScanner.create(projectDir);
ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
for (int i = 0; i < additionalProperties.length; i += 2) {
builder.put(additionalProperties[i], additionalProperties[i + 1]);
}
SonarScanner scan = sonarRunner.setDebugLogs(true).setProperties(builder.build());
orchestrator.executeBuild(scan);
return scan;
}
use of com.sonar.orchestrator.build.SonarScanner in project sonarqube by SonarSource.
the class PluginsTest method preview_analysis_of_project_with_all_supported_languages.
@Test
public void preview_analysis_of_project_with_all_supported_languages() {
SonarScanner analysis = newAnalysis();
analysis.setProperty("sonar.analysis.mode", "issues");
BuildResult result = ORCHESTRATOR.executeBuildQuietly(analysis);
if (result.getLastStatus() != 0) {
fail(result.getLogs());
}
}
use of com.sonar.orchestrator.build.SonarScanner in project sonarqube by SonarSource.
the class PluginsTest method newAnalysis.
private static SonarScanner newAnalysis() {
SonarScanner analysis = SonarScanner.create(Project.basedir());
// required to bypass usage of build-wrapper
analysis.setProperties("sonar.cfamily.build-wrapper-output.bypass", "true");
return analysis;
}
Aggregations