Search in sources :

Example 51 with Settings

use of org.sonar.api.config.Settings in project sonar-web by SonarSource.

the class WebTest method testCustomFileSuffixes.

@Test
public void testCustomFileSuffixes() {
    Settings settings = new Settings();
    settings.setProperty(WebConstants.FILE_EXTENSIONS_PROP_KEY, "foo, bar ,   toto");
    Web web = new Web(settings);
    assertThat(web.getFileSuffixes()).containsOnly("foo", "bar", "toto");
}
Also used : Settings(org.sonar.api.config.Settings) Test(org.junit.Test)

Example 52 with Settings

use of org.sonar.api.config.Settings in project sonar-web by SonarSource.

the class WebTest method testDefaultFileSuffixes.

@Test
public void testDefaultFileSuffixes() {
    Settings settings = new Settings();
    settings.setProperty(WebConstants.FILE_EXTENSIONS_PROP_KEY, WebConstants.FILE_EXTENSIONS_DEF_VALUE);
    Web web = new Web(settings);
    assertThat(web.getFileSuffixes()).containsOnly(".html", ".xhtml", ".rhtml", ".shtml");
}
Also used : Settings(org.sonar.api.config.Settings) Test(org.junit.Test)

Aggregations

Settings (org.sonar.api.config.Settings)52 MapSettings (org.sonar.api.config.MapSettings)43 Test (org.junit.Test)41 Before (org.junit.Before)5 Languages (org.sonar.api.resources.Languages)5 FileExclusions (org.sonar.api.scan.filesystem.FileExclusions)5 DefaultLanguagesRepository (org.sonar.scanner.repository.language.DefaultLanguagesRepository)5 LanguagesRepository (org.sonar.scanner.repository.language.LanguagesRepository)5 IndexedFile (org.sonar.api.batch.fs.IndexedFile)4 DefaultIndexedFile (org.sonar.api.batch.fs.internal.DefaultIndexedFile)4 File (java.io.File)3 String.format (java.lang.String.format)3 TransportClient (org.elasticsearch.client.transport.TransportClient)3 PropertyDto (org.sonar.db.property.PropertyDto)3 InetAddress (java.net.InetAddress)2 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)2 Condition (org.assertj.core.api.Condition)2 TransportAddress (org.elasticsearch.common.transport.TransportAddress)2 Rule (org.junit.Rule)2 ExpectedException (org.junit.rules.ExpectedException)2