diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2015-09-14 16:46:35 +0200 |
---|---|---|
committer | Duarte Meneses <duarte.meneses@sonarsource.com> | 2015-09-14 17:29:40 +0200 |
commit | 4af51da20823591001d85f2b7d1135d5bc9de51d (patch) | |
tree | d1627930d096907cae7fae317f918224ee910c07 /it | |
parent | 069f75fe8558dbea2c7194465f84c5b025bdd672 (diff) | |
download | sonarqube-4af51da20823591001d85f2b7d1135d5bc9de51d.tar.gz sonarqube-4af51da20823591001d85f2b7d1135d5bc9de51d.zip |
Improve FileCache tests
Diffstat (limited to 'it')
-rw-r--r-- | it/it-tests/src/test/java/batch/BatchTest.java | 25 |
1 files changed, 22 insertions, 3 deletions
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(); @@ -196,6 +196,25 @@ public class BatchTest { } @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 { orchestrator.getServer().provisionProject("sample", "xoo-sample"); @@ -351,7 +370,7 @@ public class BatchTest { // message .contains("Error message from plugin") - // but not stacktrace + // but not stacktrace .doesNotContain("at com.sonarsource.RaiseMessageException"); } |