* 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
};
/**
}
@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");
}
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
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
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
}