diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2014-03-18 15:31:16 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2014-03-18 15:39:04 +0100 |
commit | 67a1fce1f8cf223e71e28d047fa9c6618ffe411e (patch) | |
tree | 15f997d265f67d01fbc832e330de499e4c850eca | |
parent | 152cf9835b1cfd4a817b83ec48e2b1f474e8490f (diff) | |
download | sonarqube-67a1fce1f8cf223e71e28d047fa9c6618ffe411e.tar.gz sonarqube-67a1fce1f8cf223e71e28d047fa9c6618ffe411e.zip |
SONAR-5069 revert. sonar.sources is back. It must be mandatory.
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/scan/DefaultProjectBootstrapper.java | 3 | ||||
-rw-r--r-- | sonar-batch/src/test/java/org/sonar/batch/scan/DefaultProjectBootstrapperTest.java | 10 |
2 files changed, 8 insertions, 5 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/DefaultProjectBootstrapper.java b/sonar-batch/src/main/java/org/sonar/batch/scan/DefaultProjectBootstrapper.java index bc0927250de..c84b9d5a2f1 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/scan/DefaultProjectBootstrapper.java +++ b/sonar-batch/src/main/java/org/sonar/batch/scan/DefaultProjectBootstrapper.java @@ -91,7 +91,8 @@ class DefaultProjectBootstrapper implements ProjectBootstrapper { * Array of all mandatory properties required for a project without child. */ private static final String[] MANDATORY_PROPERTIES_FOR_SIMPLE_PROJECT = { - PROPERTY_PROJECT_BASEDIR, CoreProperties.PROJECT_KEY_PROPERTY, CoreProperties.PROJECT_NAME_PROPERTY, CoreProperties.PROJECT_VERSION_PROPERTY + PROPERTY_PROJECT_BASEDIR, CoreProperties.PROJECT_KEY_PROPERTY, CoreProperties.PROJECT_NAME_PROPERTY, + CoreProperties.PROJECT_VERSION_PROPERTY, PROPERTY_SOURCES }; /** diff --git a/sonar-batch/src/test/java/org/sonar/batch/scan/DefaultProjectBootstrapperTest.java b/sonar-batch/src/test/java/org/sonar/batch/scan/DefaultProjectBootstrapperTest.java index fbb6dce4889..c96a789ff9f 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/scan/DefaultProjectBootstrapperTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/scan/DefaultProjectBootstrapperTest.java @@ -85,7 +85,9 @@ public class DefaultProjectBootstrapperTest { } @Test - public void shouldNotFailIfMissingSourceDirectory() throws IOException { + public void fail_if_sources_not_set() throws IOException { + thrown.expect(IllegalStateException.class); + thrown.expectMessage("You must define the following mandatory properties for 'com.foo.project': sonar.sources"); loadProjectDefinition("simple-project-with-missing-source-dir"); } @@ -469,7 +471,7 @@ public class DefaultProjectBootstrapperTest { thrown.expect(IllegalStateException.class); thrown.expectMessage("You must define the following mandatory properties for 'Unknown': foo2, foo3"); - DefaultProjectBootstrapper.checkMandatoryProperties(props, new String[] {"foo1", "foo2", "foo3"}); + DefaultProjectBootstrapper.checkMandatoryProperties(props, new String[]{"foo1", "foo2", "foo3"}); } @Test @@ -481,7 +483,7 @@ public class DefaultProjectBootstrapperTest { thrown.expect(IllegalStateException.class); thrown.expectMessage("You must define the following mandatory properties for 'my-project': foo2, foo3"); - DefaultProjectBootstrapper.checkMandatoryProperties(props, new String[] {"foo1", "foo2", "foo3"}); + DefaultProjectBootstrapper.checkMandatoryProperties(props, new String[]{"foo1", "foo2", "foo3"}); } @Test @@ -490,7 +492,7 @@ public class DefaultProjectBootstrapperTest { props.setProperty("foo1", "bla"); props.setProperty("foo4", "bla"); - DefaultProjectBootstrapper.checkMandatoryProperties(props, new String[] {"foo1"}); + DefaultProjectBootstrapper.checkMandatoryProperties(props, new String[]{"foo1"}); // No exception should be thrown } |