use of org.sonar.process.Props in project sonarqube by SonarSource.
the class JdbcSettingsTest method checkAndComplete_sets_driver_path_for_postgresql.
@Test
public void checkAndComplete_sets_driver_path_for_postgresql() throws Exception {
File driverFile = new File(homeDir, "lib/jdbc/postgresql/pg.jar");
FileUtils.touch(driverFile);
Props props = newProps(JDBC_URL, "jdbc:postgresql://localhost/sonar");
underTest.accept(props);
assertThat(props.nonNullValueAsFile(ProcessProperties.JDBC_DRIVER_PATH)).isEqualTo(driverFile);
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class JdbcSettingsTest method fail_with_MessageException_when_url_does_not_have_jdbc_prefix.
@Test
public void fail_with_MessageException_when_url_does_not_have_jdbc_prefix() {
Props props = newProps(JDBC_URL, "oracle:thin:@localhost/XE");
expectedException.expect(MessageException.class);
expectedException.expectMessage("Bad format of JDBC URL: oracle:thin:@localhost/XE");
underTest.resolveProviderAndEnforceNonnullJdbcUrl(props);
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class JdbcSettingsTest method sets_driver_path_for_h2.
@Test
public void sets_driver_path_for_h2() throws Exception {
File driverFile = new File(homeDir, "lib/jdbc/h2/h2.jar");
FileUtils.touch(driverFile);
Props props = newProps(JDBC_URL, "jdbc:h2:tcp://localhost:9092/sonar");
underTest.accept(props);
assertThat(props.nonNullValueAsFile(ProcessProperties.JDBC_DRIVER_PATH)).isEqualTo(driverFile);
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class EsSettingsTest method cluster_is_enabled.
@Test
public void cluster_is_enabled() throws Exception {
Props props = minProps();
props.set(ProcessProperties.CLUSTER_ENABLED, "true");
props.set(ProcessProperties.CLUSTER_SEARCH_HOSTS, "1.2.3.4:9000,1.2.3.5:8080");
Settings settings = new EsSettings(props).build();
assertThat(settings.get("index.number_of_replicas")).isEqualTo("1");
assertThat(settings.get("discovery.zen.ping.unicast.hosts")).isEqualTo("1.2.3.4:9000,1.2.3.5:8080");
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class EsSettingsTest method enable_http_connector.
@Test
public void enable_http_connector() throws Exception {
Props props = minProps();
props.set(ProcessProperties.SEARCH_HTTP_PORT, "9010");
Settings settings = new EsSettings(props).build();
assertThat(settings.get("http.port")).isEqualTo("9010");
assertThat(settings.get("http.host")).isEqualTo("127.0.0.1");
assertThat(settings.get("http.enabled")).isEqualTo("true");
}
Aggregations