use of org.sonar.home.cache.FileCache in project sonarqube by SonarSource.
the class ScannerPluginJarExploderTest method setUp.
@Before
public void setUp() throws IOException {
userHome = temp.newFolder();
FileCache fileCache = new FileCacheBuilder(new Slf4jLogger()).setUserHome(userHome).build();
underTest = new ScannerPluginJarExploder(fileCache);
}
use of org.sonar.home.cache.FileCache 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"));
}
use of org.sonar.home.cache.FileCache 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);
}
use of org.sonar.home.cache.FileCache 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();
}
Aggregations