diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2015-07-24 15:55:20 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2015-07-24 17:00:40 +0200 |
commit | 542e838f4dfa1f90a6517874471f785953b13ed4 (patch) | |
tree | c3542cd78588a2bf66ee6036124c956b6ecb23de /it | |
parent | 0d9baa81b9c819e1ded0e841be00ef10d4f6fc0e (diff) | |
download | sonarqube-542e838f4dfa1f90a6517874471f785953b13ed4.tar.gz sonarqube-542e838f4dfa1f90a6517874471f785953b13ed4.zip |
Display logs of the analysis in case of error in PluginsTest
Diffstat (limited to 'it')
-rw-r--r-- | it/it-tests/src/test/java/plugins/PluginsTest.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/it/it-tests/src/test/java/plugins/PluginsTest.java b/it/it-tests/src/test/java/plugins/PluginsTest.java index ef69102ecb3..496ce295c95 100644 --- a/it/it-tests/src/test/java/plugins/PluginsTest.java +++ b/it/it-tests/src/test/java/plugins/PluginsTest.java @@ -9,6 +9,7 @@ import com.google.common.base.Joiner; import com.google.common.collect.Sets; import com.sonar.orchestrator.Orchestrator; import com.sonar.orchestrator.OrchestratorBuilder; +import com.sonar.orchestrator.build.BuildResult; import com.sonar.orchestrator.build.SonarRunner; import java.util.Arrays; import java.util.List; @@ -37,6 +38,8 @@ import plugins.checks.Validation; import plugins.checks.VbCheck; import plugins.checks.WebCheck; +import static org.assertj.core.api.Assertions.fail; + /** * Verify that the plugins available in update center * are correctly supported. @@ -92,7 +95,10 @@ public class PluginsTest { @Test public void analysis_of_project_with_all_supported_languages() { SonarRunner analysis = newAnalysis(); - orchestrator.executeBuild(analysis); + BuildResult result = orchestrator.executeBuildQuietly(analysis); + if (result.getStatus() != 0) { + fail(result.getLogs()); + } for (Check check : CHECKS) { System.out.println(check.getClass().getSimpleName() + "..."); check.validate(new Validation(orchestrator, errorCollector)); @@ -104,7 +110,10 @@ public class PluginsTest { SonarRunner analysis = newAnalysis(); analysis.setProperty("sonar.analysis.mode", "preview"); analysis.setProperty("sonar.preview.excludePlugins", Joiner.on(",").join(DISABLED_PLUGINS_FOR_PREVIEW_MODE)); - orchestrator.executeBuild(analysis); + BuildResult result = orchestrator.executeBuildQuietly(analysis); + if (result.getStatus() != 0) { + fail(result.getLogs()); + } } private static SonarRunner newAnalysis() { |