use of org.sonarsource.sonarlint.core.util.ProgressWrapper in project sonarlint-core by SonarSource.
the class WsHelperImpl method listOrganizations.
@Override
public List<RemoteOrganization> listOrganizations(ServerConfiguration serverConfig, @Nullable ProgressMonitor monitor) {
SonarLintWsClient client = createClient(serverConfig);
ServerVersionAndStatusChecker serverChecker = new ServerVersionAndStatusChecker(client);
return listOrganizations(client, serverChecker, new ProgressWrapper(monitor));
}
use of org.sonarsource.sonarlint.core.util.ProgressWrapper in project sonarlint-core by SonarSource.
the class StorageAnalyzerTest method testStaleModuleStorage.
@Test
public void testStaleModuleStorage() {
when(globalReader.get()).thenReturn(mock(GlobalStorageStatus.class));
ModuleStorageStatus moduleStatus = mock(ModuleStorageStatus.class);
when(moduleStatus.isStale()).thenReturn(true);
when(moduleReader.apply("module1")).thenReturn(moduleStatus);
exception.expect(StorageException.class);
exception.expectMessage("Stored data for module 'module1' is stale");
analyzer.analyze(mock(StorageContainer.class), config, mock(IssueListener.class), new ProgressWrapper(null));
}
use of org.sonarsource.sonarlint.core.util.ProgressWrapper in project sonarlint-core by SonarSource.
the class PartialUpdaterTest method error_downloading_modules.
@Test
public void error_downloading_modules() {
when(storagePaths.getGlobalStorageRoot()).thenReturn(temp.getRoot().toPath());
doThrow(IOException.class).when(moduleListDownloader).fetchModulesListTo(eq(temp.getRoot().toPath()), eq(SERVER_VERSION), any(ProgressWrapper.class));
exception.expect(DownloadException.class);
updater.updateModuleList(new ProgressWrapper(null));
}
use of org.sonarsource.sonarlint.core.util.ProgressWrapper in project sonarlint-core by SonarSource.
the class PartialUpdaterTest method update_module_list.
@Test
public void update_module_list() {
when(storagePaths.getGlobalStorageRoot()).thenReturn(temp.getRoot().toPath());
updater.updateModuleList(new ProgressWrapper(null));
verify(moduleListDownloader).fetchModulesListTo(eq(temp.getRoot().toPath()), eq(SERVER_VERSION), any(ProgressWrapper.class));
}
use of org.sonarsource.sonarlint.core.util.ProgressWrapper in project sonarlint-core by SonarSource.
the class StorageAnalyzerTest method testNoGlobalStorage.
@Test
public void testNoGlobalStorage() {
when(globalReader.get()).thenReturn(null);
exception.expect(StorageException.class);
exception.expectMessage("Missing global data");
analyzer.analyze(mock(StorageContainer.class), config, mock(IssueListener.class), new ProgressWrapper(null));
}
Aggregations