Search in sources :

Example 76 with MapSettings

use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.

the class FileCacheProviderTest method keep_singleton_instance.

@Test
public void keep_singleton_instance() {
    FileCacheProvider provider = new FileCacheProvider();
    Settings settings = new MapSettings();
    FileCache cache1 = provider.provide(settings);
    FileCache cache2 = provider.provide(settings);
    assertThat(cache1).isSameAs(cache2);
}
Also used : MapSettings(org.sonar.api.config.MapSettings) Settings(org.sonar.api.config.Settings) MapSettings(org.sonar.api.config.MapSettings) FileCache(org.sonar.home.cache.FileCache) Test(org.junit.Test)

Example 77 with MapSettings

use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.

the class FileCacheProviderTest method provide.

@Test
public void provide() {
    FileCacheProvider provider = new FileCacheProvider();
    FileCache cache = provider.provide(new MapSettings());
    assertThat(cache).isNotNull();
    assertThat(cache.getDir()).isNotNull().exists();
}
Also used : MapSettings(org.sonar.api.config.MapSettings) FileCache(org.sonar.home.cache.FileCache) Test(org.junit.Test)

Example 78 with MapSettings

use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.

the class IssueInclusionPatternInitializerTest method init.

@Before
public void init() {
    settings = new MapSettings(new PropertyDefinitions(IssueExclusionProperties.all()));
    patternsInitializer = new IssueInclusionPatternInitializer(settings);
}
Also used : MapSettings(org.sonar.api.config.MapSettings) PropertyDefinitions(org.sonar.api.config.PropertyDefinitions) Before(org.junit.Before)

Example 79 with MapSettings

use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.

the class DefaultPostJobContextTest method prepare.

@Before
public void prepare() {
    issueCache = mock(IssueCache.class);
    componentStore = new InputComponentStore(new PathResolver());
    settings = new MapSettings();
    analysisMode = mock(AnalysisMode.class);
    context = new DefaultPostJobContext(settings, issueCache, componentStore, analysisMode);
}
Also used : MapSettings(org.sonar.api.config.MapSettings) InputComponentStore(org.sonar.scanner.scan.filesystem.InputComponentStore) PathResolver(org.sonar.api.scan.filesystem.PathResolver) AnalysisMode(org.sonar.api.batch.AnalysisMode) IssueCache(org.sonar.scanner.issue.IssueCache) Before(org.junit.Before)

Example 80 with MapSettings

use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.

the class PostJobOptimizerTest method prepare.

@Before
public void prepare() {
    settings = new MapSettings();
    optimizer = new PostJobOptimizer(settings);
}
Also used : MapSettings(org.sonar.api.config.MapSettings) Before(org.junit.Before)

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