use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class EmbeddedDatabaseTest method start_fails_with_IAE_if_property_Data_Path_is_not_set.
@Test
public void start_fails_with_IAE_if_property_Data_Path_is_not_set() {
EmbeddedDatabase underTest = new EmbeddedDatabase(new MapSettings());
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("Missing property " + PATH_DATA);
underTest.start();
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class EmbeddedDatabaseTest method start_fails_with_IAE_if_embedded_port_settings_is_not_set.
@Test
public void start_fails_with_IAE_if_embedded_port_settings_is_not_set() throws IOException {
EmbeddedDatabase underTest = new EmbeddedDatabase(new MapSettings().setProperty(PATH_DATA, temporaryFolder.newFolder().getAbsolutePath()).setProperty(PROP_URL, "jdbc url"));
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("Missing property " + PROP_EMBEDDED_PORT);
underTest.start();
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class EmbeddedDatabaseTest method start_supports_in_memory_H2_JDBC_URL.
@Test
public void start_supports_in_memory_H2_JDBC_URL() throws IOException {
int port = NetworkUtils.freePort();
underTest = new EmbeddedDatabase(new MapSettings().setProperty(PATH_DATA, temporaryFolder.newFolder().getAbsolutePath()).setProperty(PROP_URL, "jdbc:h2:mem:sonar").setProperty(PROP_EMBEDDED_PORT, "" + port).setProperty(PROP_USER, "foo").setProperty(PROP_PASSWORD, "bar"));
underTest.start();
checkDbIsUp(port, "foo", "bar");
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class EmbeddedDatabaseTest method start_ignores_URL_to_create_database_and_uses_default_username_and_password_when_then_are_not_set.
@Test
public void start_ignores_URL_to_create_database_and_uses_default_username_and_password_when_then_are_not_set() throws IOException {
int port = NetworkUtils.freePort();
underTest = new EmbeddedDatabase(new MapSettings().setProperty(PATH_DATA, temporaryFolder.newFolder().getAbsolutePath()).setProperty(PROP_URL, "jdbc url").setProperty(PROP_EMBEDDED_PORT, "" + port));
underTest.start();
checkDbIsUp(port, PROP_USER_DEFAULT_VALUE, PROP_PASSWORD_DEFAULT_VALUE);
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class UserIndexDefinitionTest method define.
@Test
public void define() {
UserIndexDefinition def = new UserIndexDefinition(new MapSettings());
def.define(underTest);
assertThat(underTest.getIndices()).hasSize(1);
NewIndex index = underTest.getIndices().get("users");
assertThat(index).isNotNull();
assertThat(index.getTypes().keySet()).containsOnly("user");
// no cluster by default
assertThat(index.getSettings().get("index.number_of_shards")).isEqualTo("1");
assertThat(index.getSettings().get("index.number_of_replicas")).isEqualTo("0");
}
Aggregations