use of com.sonar.orchestrator.build.BuildResult in project sonarqube by SonarSource.
the class IssuesModeTest method shoud_support_sonar_profile_prop.
// SONAR-8518
@Test
public void shoud_support_sonar_profile_prop() throws IOException {
restoreProfile("one-issue-per-line.xml");
restoreProfile("empty.xml");
orchestrator.getServer().provisionProject("sample", "xoo-sample");
orchestrator.getServer().associateProjectToQualityProfile("sample", "xoo", "empty");
SonarScanner runner = configureRunner("shared/xoo-sample", "sonar.verbose", "true", "sonar.analysis.mode", "issues", "sonar.profile", "one-issue-per-line");
BuildResult result = orchestrator.executeBuild(runner);
ItUtils.assertIssuesInJsonReport(result, 17, 0, 0);
}
use of com.sonar.orchestrator.build.BuildResult in project sonarqube by SonarSource.
the class IssuesModeTest method should_fail_if_plugin_access_secured_properties.
@Test
public void should_fail_if_plugin_access_secured_properties() throws IOException {
// Test access from task (ie BatchSettings)
SonarScanner runner = configureRunnerIssues("shared/xoo-sample", null, "accessSecuredFromTask", "true");
BuildResult result = orchestrator.executeBuildQuietly(runner);
assertThat(result.getLogs()).contains("Access to the secured property 'foo.bar.secured' is not possible in issues mode. " + "The SonarQube plugin which requires this property must be deactivated in issues mode.");
// Test access from sensor (ie ModuleSettings)
runner = configureRunnerIssues("shared/xoo-sample", null, "accessSecuredFromSensor", "true");
result = orchestrator.executeBuildQuietly(runner);
assertThat(result.getLogs()).contains("Access to the secured property 'foo.bar.secured' is not possible in issues mode. " + "The SonarQube plugin which requires this property must be deactivated in issues mode.");
}
use of com.sonar.orchestrator.build.BuildResult in project sonarqube by SonarSource.
the class ScannerTest method should_display_project_url_after_analysis.
/**
* SONAR-4239
*/
@Test
public void should_display_project_url_after_analysis() throws IOException {
orchestrator.getServer().provisionProject("com.sonarsource.it.samples:multi-modules-sample", "Sonar :: Integration Tests :: Multi-modules Sample");
orchestrator.getServer().associateProjectToQualityProfile("com.sonarsource.it.samples:multi-modules-sample", "xoo", "one-issue-per-line");
Assume.assumeTrue(orchestrator.getServer().version().isGreaterThanOrEquals("3.6"));
BuildResult result = scan("shared/xoo-multi-modules-sample");
assertThat(result.getLogs()).contains("/dashboard/index/com.sonarsource.it.samples:multi-modules-sample");
result = scan("shared/xoo-multi-modules-sample", "sonar.branch", "mybranch");
assertThat(result.getLogs()).contains("/dashboard/index/com.sonarsource.it.samples:multi-modules-sample:mybranch");
try {
setServerProperty(orchestrator, null, "sonar.core.serverBaseURL", "http://foo:123/sonar");
result = scan("shared/xoo-multi-modules-sample");
assertThat(result.getLogs()).contains("http://foo:123/sonar/dashboard/index/com.sonarsource.it.samples:multi-modules-sample");
} finally {
resetSettings(orchestrator, null, "sonar.core.serverBaseURL");
}
}
use of com.sonar.orchestrator.build.BuildResult in project sonarqube by SonarSource.
the class IssueExclusionsTest method checkAnalysisFails.
private void checkAnalysisFails(String... properties) {
BuildResult buildResult = scan(properties);
assertThat(buildResult.getStatus()).isNotEqualTo(0);
assertThat(buildResult.getLogs().indexOf("SonarException")).isGreaterThan(0);
}
use of com.sonar.orchestrator.build.BuildResult in project sonarqube by SonarSource.
the class SSLTest method simple_analysis_with_server_certificate.
@Test
public void simple_analysis_with_server_certificate() throws Exception {
startSSLTransparentReverseProxy(false);
SonarScanner sonarScanner = SonarScanner.create(ItUtils.projectDir("shared/xoo-sample")).setScannerVersion("2.7").setProperty("sonar.host.url", "https://localhost:" + httpsPort);
BuildResult buildResult = orchestrator.executeBuildQuietly(sonarScanner);
assertThat(buildResult.getLastStatus()).isNotEqualTo(0);
assertThat(buildResult.getLogs()).contains("javax.net.ssl.SSLHandshakeException");
Path clientTruststore = Paths.get(SSLTest.class.getResource(CLIENT_TRUSTSTORE).toURI()).toAbsolutePath();
String truststorePassword = CLIENT_TRUSTSTORE_PWD;
buildResult = orchestrator.executeBuild(sonarScanner.setEnvironmentVariable("SONAR_SCANNER_OPTS", "-Djavax.net.ssl.trustStore=" + clientTruststore.toString() + " -Djavax.net.ssl.trustStorePassword=" + truststorePassword));
}
Aggregations