use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class FileExclusionsTest method ignore_inclusion_of_world.
@Test
public void ignore_inclusion_of_world() {
Settings settings = new MapSettings();
settings.setProperty(CoreProperties.PROJECT_INCLUSIONS_PROPERTY, "**/*");
settings.setProperty(CoreProperties.PROJECT_TEST_INCLUSIONS_PROPERTY, "**/*");
assertThat(new FileExclusions(settings).sourceInclusions()).isEmpty();
assertThat(new FileExclusions(settings).testInclusions()).isEmpty();
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class FileExclusionsTest method load_exclusions.
@Test
public void load_exclusions() {
Settings settings = new MapSettings();
settings.setProperty(CoreProperties.PROJECT_EXCLUSIONS_PROPERTY, "**/*Foo.java");
settings.setProperty(CoreProperties.PROJECT_TEST_EXCLUSIONS_PROPERTY, "**/*FooTest.java");
FileExclusions moduleExclusions = new FileExclusions(settings);
assertThat(moduleExclusions.sourceInclusions()).isEmpty();
assertThat(moduleExclusions.sourceExclusions()).containsOnly("**/*Foo.java");
assertThat(moduleExclusions.testInclusions()).isEmpty();
assertThat(moduleExclusions.testExclusions()).containsOnly("**/*FooTest.java");
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class DefaultCpdBlockIndexerTest method init.
@Before
public void init() {
settings = new MapSettings();
engine = new DefaultCpdBlockIndexer(null, null, settings, null);
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class JavaCpdBlockIndexerTest method languageSupported.
@Test
public void languageSupported() {
JavaCpdBlockIndexer engine = new JavaCpdBlockIndexer(mock(FileSystem.class), new MapSettings(), index);
assertThat(engine.isLanguageSupported(JAVA)).isTrue();
assertThat(engine.isLanguageSupported("php")).isFalse();
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class FileCacheProviderTest method honor_sonarUserHome.
@Test
public void honor_sonarUserHome() throws IOException {
FileCacheProvider provider = new FileCacheProvider();
Settings settings = new MapSettings();
File f = temp.newFolder();
settings.appendProperty("sonar.userHome", f.getAbsolutePath());
FileCache cache = provider.provide(settings);
assertThat(cache.getDir()).isEqualTo(new File(f, "cache"));
}
Aggregations