use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class DefaultDatabaseTest method shouldGuessDefaultDriver.
@Test
public void shouldGuessDefaultDriver() {
Settings settings = new MapSettings();
settings.setProperty("sonar.jdbc.url", "jdbc:postgresql://localhost/sonar");
DefaultDatabase database = new DefaultDatabase(logbackHelper, settings);
database.initSettings();
assertThat(database.getProperties().getProperty("sonar.jdbc.driverClassName")).isEqualTo("org.postgresql.Driver");
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class DefaultDatabaseTest method shouldCompleteProperties.
@Test
public void shouldCompleteProperties() {
Settings settings = new MapSettings();
DefaultDatabase db = new DefaultDatabase(logbackHelper, settings) {
@Override
protected void doCompleteProperties(Properties properties) {
properties.setProperty("sonar.jdbc.maxActive", "2");
}
};
db.initSettings();
Properties props = db.getProperties();
assertThat(props.getProperty("sonar.jdbc.maxActive")).isEqualTo("2");
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class CeHttpClientTest method setUp.
@Before
public void setUp() throws Exception {
ipcSharedDir = temp.newFolder();
Settings settings = new MapSettings();
settings.setProperty(ProcessEntryPoint.PROPERTY_SHARED_PATH, ipcSharedDir.getAbsolutePath());
underTest = new CeHttpClient(settings);
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class SettingsRepositoryTest method createDao.
@Before
public void createDao() {
globalSettings = new MapSettings();
session = dbClient.openSession(false);
underTest = new SettingsRepositoryImpl(new ProjectSettingsFactory(globalSettings, dbClient));
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class IssueFilterTest method accept_everything_when_no_filter_properties.
@Test
public void accept_everything_when_no_filter_properties() throws Exception {
IssueFilter underTest = newIssueFilter(new MapSettings());
assertThat(underTest.accept(ISSUE_1, COMPONENT_1)).isTrue();
assertThat(underTest.accept(ISSUE_2, COMPONENT_2)).isTrue();
assertThat(underTest.accept(ISSUE_3, COMPONENT_3)).isTrue();
}
Aggregations