use of org.sonar.process.Props in project sonarqube by SonarSource.
the class JdbcSettingsTest method resolve_H2_provider_when_props_is_empty_and_set_URL_to_default_H2.
@Test
public void resolve_H2_provider_when_props_is_empty_and_set_URL_to_default_H2() {
Props props = newProps();
assertThat(underTest.resolveProviderAndEnforceNonnullJdbcUrl(props)).isEqualTo(Provider.H2);
assertThat(props.nonNullValue(JDBC_URL)).isEqualTo("jdbc:h2:tcp://localhost:9092/sonar");
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class JdbcSettingsTest method checkProviderForUrlAndUnchangedUrl.
private void checkProviderForUrlAndUnchangedUrl(String url, Provider expected) {
Props props = newProps(JDBC_URL, url);
assertThat(underTest.resolveProviderAndEnforceNonnullJdbcUrl(props)).isEqualTo(expected);
assertThat(props.nonNullValue(JDBC_URL)).isEqualTo(url);
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class JdbcSettingsTest method checkAndComplete_sets_driver_path_for_mssql.
@Test
public void checkAndComplete_sets_driver_path_for_mssql() throws Exception {
File driverFile = new File(homeDir, "lib/jdbc/mssql/sqljdbc4.jar");
FileUtils.touch(driverFile);
Props props = newProps(JDBC_URL, "jdbc:sqlserver://localhost/sonar;SelectMethod=Cursor");
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 WebServer method main.
/**
* Can't be started as is. Needs to be bootstrapped by sonar-application
*/
public static void main(String[] args) {
ProcessEntryPoint entryPoint = ProcessEntryPoint.createForArguments(args);
Props props = entryPoint.getProps();
new WebServerProcessLogging().configure(props);
WebServer server = new WebServer(props);
entryPoint.launch(server);
}
use of org.sonar.process.Props in project sonarqube by SonarSource.
the class EsSettingsTest method test_default_settings.
@Test
public void test_default_settings() throws Exception {
File homeDir = temp.newFolder();
Props props = new Props(new Properties());
props.set(ProcessProperties.SEARCH_PORT, "1234");
props.set(ProcessProperties.SEARCH_HOST, "127.0.0.1");
props.set(ProcessProperties.PATH_HOME, homeDir.getAbsolutePath());
props.set(ProcessProperties.CLUSTER_NAME, "sonarqube");
EsSettings esSettings = new EsSettings(props);
Settings generated = esSettings.build();
assertThat(generated.get("transport.tcp.port")).isEqualTo("1234");
assertThat(generated.get("transport.host")).isEqualTo("127.0.0.1");
// no cluster, but cluster and node names are set though
assertThat(generated.get("cluster.name")).isEqualTo("sonarqube");
assertThat(generated.get("node.name")).isEqualTo("sonarqube");
assertThat(generated.get("path.data")).isNotNull();
assertThat(generated.get("path.logs")).isNotNull();
assertThat(generated.get("path.home")).isNotNull();
// http is disabled for security reasons
assertThat(generated.get("http.enabled")).isEqualTo("false");
assertThat(generated.get("index.number_of_replicas")).isEqualTo("0");
assertThat(generated.get("discovery.zen.ping.unicast.hosts")).isNull();
}
Aggregations