private void initDefaultValues() {
setDefaultValue(RunnerProperties.HOST_URL, "http://localhost:9000");
- setDefaultValue(RunnerProperties.TASK, "scan");
+ //setDefaultValue(RunnerProperties.TASK, "scan");
setDefaultValue(InternalProperties.RUNNER_APP, "SonarRunner");
setDefaultValue(InternalProperties.RUNNER_APP_VERSION, RunnerVersion.version());
}
}
static boolean taskRequiresProject(Properties props) {
- return ScanProperties.SCAN_TASK.equals(props.get(RunnerProperties.TASK));
+ Object task = props.get(RunnerProperties.TASK);
+ return task == null || ScanProperties.SCAN_TASK.equals(task);
}
}
@Test
public void task_should_require_project() {
Properties props = new Properties();
+ assertThat(Utils.taskRequiresProject(props)).isTrue();
+
props.setProperty("sonar.task", "scan");
assertThat(Utils.taskRequiresProject(props)).isTrue();
}
@Test
public void task_should_not_require_project() {
Properties props = new Properties();
- assertThat(Utils.taskRequiresProject(props)).isFalse();
props.setProperty("sonar.task", "views");
assertThat(Utils.taskRequiresProject(props)).isFalse();
}