* @since 1.0
*/
public class Main {
-
+ private static final String SEPARATOR = "------------------------------------------------------------------------";
private final Exit exit;
private final Cli cli;
private final Conf conf;
}
private void displayExecutionResult(Stats stats, String resultMsg) {
- logger.info("------------------------------------------------------------------------");
+ logger.info(SEPARATOR);
logger.info("EXECUTION " + resultMsg);
- logger.info("------------------------------------------------------------------------");
+ logger.info(SEPARATOR);
stats.stop();
- logger.info("------------------------------------------------------------------------");
+ logger.info(SEPARATOR);
}
private void showError(String message, Throwable e, boolean showStackTrace) {
assertThat(properties.getProperty("sonar.projectBaseDir")).isEqualTo(projectHome.toString());
}
+ @Test
+ public void failModuleBaseDirDoesNotExist() throws IOException {
+ args.setProperty("sonar.modules", "module1");
+ args.setProperty("module1.sonar.projectBaseDir", "invalid");
+
+ exception.expect(IllegalStateException.class);
+ exception.expectMessage("The base directory of the module 'module1' does not exist");
+ conf.properties();
+ }
+
+ @Test
+ public void failModulePropertyFileDoesNotExist() throws IOException {
+ args.setProperty("sonar.modules", "module1");
+ args.setProperty("module1.sonar.projectConfigFile", "invalid");
+
+ exception.expect(IllegalStateException.class);
+ exception.expectMessage("The properties file of the module 'module1' does not exist");
+ conf.properties();
+ }
+
@Test
public void shouldSupportSettingBaseDirFromCli() throws Exception {
Path projectHome = Paths.get(getClass().getResource("ConfTest/shouldLoadModuleConfiguration/project").toURI());