diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2015-12-09 16:20:47 +0100 |
---|---|---|
committer | Duarte Meneses <duarte.meneses@sonarsource.com> | 2015-12-10 17:59:17 +0100 |
commit | 56a4685a6061731fe701ea3ec8afbf9a8a1015f0 (patch) | |
tree | 6d6619f27809db90b381c8bfb10415daa27fbc85 /sonar-batch/src/test | |
parent | 1be1ef656f02315135f1197f8dfa0128de3ab763 (diff) | |
download | sonarqube-56a4685a6061731fe701ea3ec8afbf9a8a1015f0.tar.gz sonarqube-56a4685a6061731fe701ea3ec8afbf9a8a1015f0.zip |
SONAR-6968 Bad error message when analyzer detects that no language plugins are installed
Diffstat (limited to 'sonar-batch/src/test')
4 files changed, 16 insertions, 11 deletions
diff --git a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/fs/ProjectBuilderMediumTest.java b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/fs/ProjectBuilderMediumTest.java index ed7a35a4836..a8979340a61 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/fs/ProjectBuilderMediumTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/fs/ProjectBuilderMediumTest.java @@ -19,6 +19,8 @@ */ package org.sonar.batch.mediumtest.fs; +import org.sonar.api.utils.MessageException; + import com.google.common.collect.ImmutableMap; import org.apache.commons.io.FileUtils; import org.junit.After; @@ -102,7 +104,7 @@ public class ProjectBuilderMediumTest { public void testProjectBuilderWithNewLine() throws IOException { File baseDir = prepareProject(); - exception.expect(IllegalStateException.class); + exception.expect(MessageException.class); exception.expectMessage("is not a valid branch name"); tester.newTask() .properties(ImmutableMap.<String, String>builder() diff --git a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/tasks/TasksMediumTest.java b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/tasks/TasksMediumTest.java index ec151f29874..f81789b937f 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/tasks/TasksMediumTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/tasks/TasksMediumTest.java @@ -87,7 +87,7 @@ public class TasksMediumTest { thrown.expect(IllegalStateException.class); thrown.expectMessage( - "Unable to load component class org.sonar.batch.mediumtest.tasks.TasksMediumTest$BrokenTask: org.sonar.batch.mediumtest.tasks.TasksMediumTest$BrokenTask has unsatisfied dependency 'class org.sonar.api.issue.action.Actions'"); + "Unable to load component class org.sonar.batch.mediumtest.tasks.TasksMediumTest$BrokenTask"); tester.newTask() .properties(ImmutableMap.<String, String>builder() diff --git a/sonar-batch/src/test/java/org/sonar/batch/repository/DefaultQualityProfileLoaderTest.java b/sonar-batch/src/test/java/org/sonar/batch/repository/DefaultQualityProfileLoaderTest.java index b3c2b79dcb3..4caba83ec70 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/repository/DefaultQualityProfileLoaderTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/repository/DefaultQualityProfileLoaderTest.java @@ -19,8 +19,9 @@ */ package org.sonar.batch.repository; -import org.sonarqube.ws.QualityProfiles; +import org.sonar.api.utils.MessageException; +import org.sonarqube.ws.QualityProfiles; import com.google.common.io.Resources; import org.sonarqube.ws.QualityProfiles.SearchWsResponse.QualityProfile; import org.sonar.batch.cache.WSLoaderResult; @@ -77,7 +78,7 @@ public class DefaultQualityProfileLoaderTest { InputStream is = createEncodedQP(); when(ws.loadStream(anyString())).thenReturn(new WSLoaderResult<InputStream>(is, false)); - exception.expect(IllegalStateException.class); + exception.expect(MessageException.class); exception.expectMessage("No quality profiles"); qpLoader.load("project", null, null); diff --git a/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorValidatorTest.java b/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorValidatorTest.java index 761c608c8cd..40b68bf21cb 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorValidatorTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectReactorValidatorTest.java @@ -21,6 +21,8 @@ package org.sonar.batch.scan; import static org.mockito.Mockito.when; +import org.sonar.api.utils.MessageException; + import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -67,7 +69,7 @@ public class ProjectReactorValidatorTest { validator.validate(createProjectReactor("project/key")); when(mode.isIssues()).thenReturn(false); - thrown.expect(IllegalStateException.class); + thrown.expect(MessageException.class); thrown.expectMessage("is not a valid project or module key"); validator.validate(createProjectReactor("project/key")); } @@ -106,7 +108,7 @@ public class ProjectReactorValidatorTest { public void fail_with_invalid_key() { ProjectReactor reactor = createProjectReactor("foo$bar"); - thrown.expect(IllegalStateException.class); + thrown.expect(MessageException.class); thrown.expectMessage("\"foo$bar\" is not a valid project or module key"); validator.validate(reactor); } @@ -115,7 +117,7 @@ public class ProjectReactorValidatorTest { public void fail_with_backslash_in_key() { ProjectReactor reactor = createProjectReactor("foo\\bar"); - thrown.expect(IllegalStateException.class); + thrown.expect(MessageException.class); thrown.expectMessage("\"foo\\bar\" is not a valid project or module key"); validator.validate(reactor); } @@ -133,7 +135,7 @@ public class ProjectReactorValidatorTest { @Test public void fail_with_invalid_branch() { ProjectReactor reactor = createProjectReactor("foo", "bran#ch"); - thrown.expect(IllegalStateException.class); + thrown.expect(MessageException.class); thrown.expectMessage("\"bran#ch\" is not a valid branch name"); validator.validate(reactor); } @@ -141,7 +143,7 @@ public class ProjectReactorValidatorTest { @Test public void fail_with_colon_in_branch() { ProjectReactor reactor = createProjectReactor("foo", "bran:ch"); - thrown.expect(IllegalStateException.class); + thrown.expect(MessageException.class); thrown.expectMessage("\"bran:ch\" is not a valid branch name"); validator.validate(reactor); } @@ -150,7 +152,7 @@ public class ProjectReactorValidatorTest { public void fail_with_only_digits() { ProjectReactor reactor = createProjectReactor("12345"); - thrown.expect(IllegalStateException.class); + thrown.expect(MessageException.class); thrown.expectMessage("\"12345\" is not a valid project or module key"); validator.validate(reactor); } @@ -160,7 +162,7 @@ public class ProjectReactorValidatorTest { ProjectReactor reactor = createProjectReactor("foo"); settings.setProperty("sonar.phase", "phase"); - thrown.expect(IllegalStateException.class); + thrown.expect(MessageException.class); thrown.expectMessage("\"sonar.phase\" is deprecated"); validator.validate(reactor); } |