]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5069 revert. sonar.sources is back. It must be mandatory.
authorSimon Brandhof <simon.brandhof@gmail.com>
Tue, 18 Mar 2014 14:31:16 +0000 (15:31 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 18 Mar 2014 14:39:04 +0000 (15:39 +0100)
sonar-batch/src/main/java/org/sonar/batch/scan/DefaultProjectBootstrapper.java
sonar-batch/src/test/java/org/sonar/batch/scan/DefaultProjectBootstrapperTest.java

index bc0927250debf4c99b6be973c2f313b9b58fd5b9..c84b9d5a2f103cc98d641db51fa2fd557b3a6062 100644 (file)
@@ -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
   };
 
   /**
index fbb6dce4889be5e944ed4cb4d6a43901f85b764c..c96a789ff9f6ce26d41af097dff037c9194ca36d 100644 (file)
@@ -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
   }