use of com.sonar.orchestrator.build.BuildResult in project sonarqube by SonarSource.
the class PermissionTest method scanner_can_authenticate_with_login_password.
/**
* SONAR-4211 Test Sonar Runner when server requires authentication
*/
@Test
public void scanner_can_authenticate_with_login_password() {
createUserWithProvisioningAndScanPermissions();
orchestrator.getServer().provisionProject("sample", "xoo-sample");
BuildResult buildResult = scanQuietly("shared/xoo-sample", "sonar.login", "", "sonar.password", "");
assertThat(buildResult.getLastStatus()).isEqualTo(1);
assertThat(buildResult.getLogs()).contains("Not authorized. Analyzing this project requires to be authenticated. Please provide the values of the properties sonar.login and sonar.password.");
// SONAR-4048
buildResult = scanQuietly("shared/xoo-sample", "sonar.login", "wrong_login", "sonar.password", "wrong_password");
assertThat(buildResult.getLastStatus()).isEqualTo(1);
assertThat(buildResult.getLogs()).contains("Not authorized. Please check the properties sonar.login and sonar.password.");
buildResult = scan("shared/xoo-sample", "sonar.login", A_LOGIN, "sonar.password", A_PASSWORD);
assertThat(buildResult.getLastStatus()).isEqualTo(0);
}
use of com.sonar.orchestrator.build.BuildResult in project sonarqube by SonarSource.
the class PermissionTest method run_scanner_with_user_having_scan_permission_only_on_project.
@Test
public void run_scanner_with_user_having_scan_permission_only_on_project() throws Exception {
userRule.createUser(A_LOGIN, A_PASSWORD);
orchestrator.getServer().provisionProject("sample", "sample");
addUserPermission(A_LOGIN, "scan", "sample");
BuildResult buildResult = scanQuietly("shared/xoo-sample", "sonar.login", A_LOGIN, "sonar.password", A_PASSWORD);
assertThat(buildResult.isSuccess()).isTrue();
}
use of com.sonar.orchestrator.build.BuildResult 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.BuildResult in project sonarqube by SonarSource.
the class PluginsTest method analysis_of_project_with_all_supported_languages.
@Test
public void analysis_of_project_with_all_supported_languages() {
SonarScanner analysis = newAnalysis();
BuildResult result = ORCHESTRATOR.executeBuildQuietly(analysis);
if (result.getLastStatus() != 0) {
fail(result.getLogs());
}
for (Check check : CHECKS) {
System.out.println(check.getClass().getSimpleName() + "...");
check.validate(new Validation(ORCHESTRATOR, errorCollector));
}
}
use of com.sonar.orchestrator.build.BuildResult in project sonarqube by SonarSource.
the class CeWsTest method inspectProject.
@Before
public void inspectProject() {
orchestrator.resetData();
BuildResult buildResult = orchestrator.executeBuild(SonarScanner.create(projectDir("shared/xoo-sample")));
this.taskUuid = ItUtils.extractCeTaskId(buildResult);
this.wsClient = ItUtils.newAdminWsClient(orchestrator);
}
Aggregations