From 4af51da20823591001d85f2b7d1135d5bc9de51d Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Mon, 14 Sep 2015 16:46:35 +0200 Subject: Improve FileCache tests --- it/it-tests/src/test/java/batch/BatchTest.java | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'it') diff --git a/it/it-tests/src/test/java/batch/BatchTest.java b/it/it-tests/src/test/java/batch/BatchTest.java index 01352f45231..a3a7edadf6c 100644 --- a/it/it-tests/src/test/java/batch/BatchTest.java +++ b/it/it-tests/src/test/java/batch/BatchTest.java @@ -39,11 +39,11 @@ public class BatchTest { .addPlugin(ItUtils.xooPlugin()) .setContext("/") - .addPlugin(ItUtils.pluginArtifact("batch-plugin")) + .addPlugin(ItUtils.pluginArtifact("batch-plugin")) // Java is only used in convert_library_into_module test .setOrchestratorProperty("javaVersion", "LATEST_RELEASE").addPlugin("java") - .build(); + .build(); @Rule public ExpectedException thrown = ExpectedException.none(); @@ -195,6 +195,25 @@ public class BatchTest { "sonar.profile was set to 'unknow' but didn't match any profile for any language. Please check your configuration."); } + @Test + public void should_honor_sonarUserHome() { + File userHome = temp.getRoot(); + + orchestrator.getServer().provisionProject("sample", "xoo-sample"); + orchestrator.getServer().associateProjectToQualityProfile("sample", "xoo", "one-issue-per-line"); + + SonarRunner runner = configureRunner("shared/xoo-sample", + "sonar.verbose", "true"); + runner.setEnvironmentVariable("SONAR_USER_HOME", "/dev/null"); + BuildResult buildResult = orchestrator.executeBuildQuietly(runner); + assertThat(buildResult.getStatus()).isEqualTo(1); + + buildResult = scan("shared/xoo-sample", + "sonar.verbose", "true", + "sonar.userHome", userHome.getAbsolutePath()); + assertThat(buildResult.isSuccess()).isTrue(); + } + @Test public void should_authenticate_when_needed() { try { @@ -351,7 +370,7 @@ public class BatchTest { // message .contains("Error message from plugin") - // but not stacktrace + // but not stacktrace .doesNotContain("at com.sonarsource.RaiseMessageException"); } -- cgit v1.2.3