use of org.sonarsource.sonarlint.core.WsHelperImpl in project sonarlint-core by SonarSource.
the class OrganizationTest method downloadOrganizations.
@Test
public void downloadOrganizations() throws Exception {
WsHelper helper = new WsHelperImpl();
List<RemoteOrganization> organizations = helper.listOrganizations(getServerConfigForOrg(null), null);
assertThat(organizations).hasSize(2);
}
use of org.sonarsource.sonarlint.core.WsHelperImpl in project sonarlint-core by SonarSource.
the class ConnectedModeRequirementsTest method dontCheckMinimalPluginVersionWhenValidatingConnection.
@Test
public void dontCheckMinimalPluginVersionWhenValidatingConnection() throws IOException {
ValidationResult result = new WsHelperImpl().validateConnection(config());
assertThat(result.success()).isTrue();
}
use of org.sonarsource.sonarlint.core.WsHelperImpl 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.WsHelperImpl 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;
}
}
use of org.sonarsource.sonarlint.core.WsHelperImpl in project sonarlint-core by SonarSource.
the class ConnectedModeTest method downloadOrganizations.
@Test
public void downloadOrganizations() throws Exception {
WsHelper helper = new WsHelperImpl();
if (ORCHESTRATOR.getServer().version().isGreaterThanOrEquals("6.3")) {
assertThat(helper.listOrganizations(getServerConfig(), null)).hasSize(1);
} else {
try {
helper.listOrganizations(getServerConfig(), null);
fail("Expected exception");
} catch (Exception e) {
assertThat(e).isInstanceOf(UnsupportedServerException.class);
}
}
}
Aggregations