Search in sources :

Example 1 with MapSettings

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");
}
Also used : MapSettings(org.sonar.api.config.MapSettings) Settings(org.sonar.api.config.Settings) MapSettings(org.sonar.api.config.MapSettings) Test(org.junit.Test)

Example 2 with MapSettings

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");
}
Also used : MapSettings(org.sonar.api.config.MapSettings) Properties(java.util.Properties) Settings(org.sonar.api.config.Settings) MapSettings(org.sonar.api.config.MapSettings) Test(org.junit.Test)

Example 3 with MapSettings

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);
}
Also used : MapSettings(org.sonar.api.config.MapSettings) Settings(org.sonar.api.config.Settings) MapSettings(org.sonar.api.config.MapSettings) Before(org.junit.Before)

Example 4 with MapSettings

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));
}
Also used : MapSettings(org.sonar.api.config.MapSettings) ProjectSettingsFactory(org.sonar.ce.settings.ProjectSettingsFactory) Before(org.junit.Before)

Example 5 with MapSettings

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();
}
Also used : MapSettings(org.sonar.api.config.MapSettings) Test(org.junit.Test)

Aggregations

MapSettings (org.sonar.api.config.MapSettings)98 Test (org.junit.Test)75 Settings (org.sonar.api.config.Settings)36 Before (org.junit.Before)20 URI (java.net.URI)13 Languages (org.sonar.api.resources.Languages)9 DefaultLanguagesRepository (org.sonar.scanner.repository.language.DefaultLanguagesRepository)9 LanguagesRepository (org.sonar.scanner.repository.language.LanguagesRepository)8 File (java.io.File)7 SensorStorage (org.sonar.api.batch.sensor.internal.SensorStorage)7 FileExclusions (org.sonar.api.scan.filesystem.FileExclusions)6 Properties (java.util.Properties)5 IndexedFile (org.sonar.api.batch.fs.IndexedFile)5 DefaultFileSystem (org.sonar.api.batch.fs.internal.DefaultFileSystem)5 DefaultIndexedFile (org.sonar.api.batch.fs.internal.DefaultIndexedFile)5 PropertyDefinitions (org.sonar.api.config.PropertyDefinitions)5 InputFile (org.sonar.api.batch.fs.InputFile)4 InputStream (java.io.InputStream)3 Description (org.hamcrest.Description)3 CoreProperties (org.sonar.api.CoreProperties)3