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 PurgeDatastoresStepTest method verify_call_purge_method_of_the_purge_task.
private void verify_call_purge_method_of_the_purge_task(Component project) {
treeRootHolder.setRoot(project);
when(settingsRepository.getSettings(project)).thenReturn(new MapSettings());
dbIdsRepository.setComponentId(project, PROJECT_ID);
underTest.execute();
ArgumentCaptor<IdUuidPair> argumentCaptor = ArgumentCaptor.forClass(IdUuidPair.class);
verify(projectCleaner).purge(any(DbSession.class), argumentCaptor.capture(), any(Settings.class), anyList());
assertThat(argumentCaptor.getValue().getId()).isEqualTo(PROJECT_ID);
assertThat(argumentCaptor.getValue().getUuid()).isEqualTo(PROJECT_UUID);
}
Aggregations