use of org.sonarsource.sonarlint.core.client.api.connected.ServerConfiguration in project sonarlint-core by SonarSource.
the class PartialUpdaterTest method create.
@Test
public void create() {
ServerConfiguration serverConfiguration = mock(ServerConfiguration.class);
when(serverConfiguration.getUrl()).thenReturn("http://fake.com");
assertThat(PartialUpdater.create(storageReader, storagePaths, serverConfiguration, issueStoreReader)).isNotNull();
}
use of org.sonarsource.sonarlint.core.client.api.connected.ServerConfiguration in project sonarlint-core by SonarSource.
the class NotificationCheckerFactoryTest method testFactory.
@Test
public void testFactory() {
ServerConfiguration serverConfiguration = mock(ServerConfiguration.class);
when(serverConfiguration.getUrl()).thenReturn("http://localhost");
NotificationChecker checker = new NotificationCheckerFactory().create(serverConfiguration);
assertThat(checker).isNotNull();
}
use of org.sonarsource.sonarlint.core.client.api.connected.ServerConfiguration in project sonarlint-core by SonarSource.
the class SonarQubeNotificationsTest method testIsSupported.
@Test
public void testIsSupported() {
ServerConfiguration serverConfig = mock(ServerConfiguration.class);
when(checkerFactory.create(serverConfig)).thenReturn(checker);
when(checker.isSupported()).thenReturn(true);
SonarQubeNotifications notifications = new SonarQubeNotifications(timer, timerTask, checkerFactory);
assertThat(notifications.isSupported(serverConfig)).isTrue();
}
use of org.sonarsource.sonarlint.core.client.api.connected.ServerConfiguration in project sonarlint-intellij by SonarSource.
the class ConnectionTestTask method run.
@Override
public void run(@NotNull ProgressIndicator indicator) {
indicator.setText("Connecting to " + server.getHostUrl() + "...");
indicator.setIndeterminate(true);
try {
ServerConfiguration serverConfiguration = SonarLintUtils.getServerConfiguration(server);
WsHelper wsHelper = new WsHelperImpl();
result = wsHelper.validateConnection(serverConfiguration);
} catch (Exception e) {
String msg = "Connection test failed";
LOGGER.info(msg, e);
GlobalLogOutput.get().logError(msg, e);
exception = e;
}
}
use of org.sonarsource.sonarlint.core.client.api.connected.ServerConfiguration in project sonarlint-intellij by SonarSource.
the class InformationFetchTask method run.
@Override
public void run(@NotNull ProgressIndicator indicator) {
indicator.setText("Connecting to " + server.getHostUrl() + "...");
indicator.setIndeterminate(false);
try {
ServerConfiguration serverConfiguration = SonarLintUtils.getServerConfiguration(server);
indicator.setText("Checking support of notifications");
notificationsSupported = SonarQubeNotifications.get().isSupported(serverConfiguration);
WsHelper wsHelper = new WsHelperImpl();
organizations = wsHelper.listOrganizations(serverConfiguration, new TaskProgressMonitor(indicator));
} catch (UnsupportedServerException e) {
organizations = Collections.emptyList();
} catch (Exception e) {
LOGGER.info("Failed to fetch information", e);
exception = e;
}
}
Aggregations