use of com.intellij.openapi.updateSettings.impl.UpdateSettings in project android by JetBrains.
the class SdkComponentSourceTest method testUpdates.
public void testUpdates() throws Exception {
ExternalComponentManager.getInstance().registerComponentSource(myTestComponentSource);
ProgressIndicator progress = new StudioProgressIndicatorAdapter(new FakeProgressIndicator(), null);
UpdateSettings settings = new UpdateSettings() {
@Override
public List<String> getEnabledExternalUpdateSources() {
return ImmutableList.of(myTestComponentSource.getName());
}
};
Collection<ExternalUpdate> updates = UpdateChecker.updateExternal(true, settings, progress);
assertEquals(1, updates.size());
ExternalUpdate update = updates.iterator().next();
Iterator<UpdatableExternalComponent> iter = update.getComponents().iterator();
UpdatableExternalComponent component = iter.next();
assertEquals("package newerPreview", component.getName());
assertEquals(new Revision(1, 0, 0, 2), ((RepoPackage) component.getKey()).getVersion());
component = iter.next();
assertEquals("package newerRemote", component.getName());
assertEquals(new Revision(1, 1, 0), ((RepoPackage) component.getKey()).getVersion());
assertFalse(iter.hasNext());
}
use of com.intellij.openapi.updateSettings.impl.UpdateSettings in project intellij-community by JetBrains.
the class ITNProxy method createParameters.
@NotNull
private static Multimap<String, String> createParameters(String login, String password, @NotNull ErrorBean error) {
Multimap<String, String> params = ArrayListMultimap.create(40, 1);
params.put("protocol.version", "1");
params.put("user.login", login);
params.put("user.password", password);
params.put("os.name", SystemProperties.getOsName());
params.put("java.version", SystemProperties.getJavaVersion());
params.put("java.vm.vendor", SystemProperties.getJavaVmVendor());
ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
ApplicationNamesInfo namesInfo = ApplicationNamesInfo.getInstance();
Application application = ApplicationManager.getApplication();
params.put("app.name", namesInfo.getProductName());
params.put("app.name.full", namesInfo.getFullProductName());
params.put("app.name.version", appInfo.getVersionName());
params.put("app.eap", Boolean.toString(appInfo.isEAP()));
params.put("app.internal", Boolean.toString(application.isInternal()));
params.put("app.build", appInfo.getApiVersion());
params.put("app.version.major", appInfo.getMajorVersion());
params.put("app.version.minor", appInfo.getMinorVersion());
params.put("app.build.date", format(appInfo.getBuildDate()));
params.put("app.build.date.release", format(appInfo.getMajorReleaseBuildDate()));
params.put("app.compilation.timestamp", IdeaLogger.getOurCompilationTimestamp());
BuildNumber build = appInfo.getBuild();
String buildNumberWithAllDetails = build.asString();
params.put("app.product.code", build.getProductCode());
if (StringUtil.startsWith(buildNumberWithAllDetails, build.getProductCode() + "-")) {
buildNumberWithAllDetails = buildNumberWithAllDetails.substring(build.getProductCode().length() + 1);
}
params.put("app.build.number", buildNumberWithAllDetails);
UpdateSettings updateSettings = UpdateSettings.getInstance();
params.put("update.channel.status", updateSettings.getSelectedChannelStatus().getCode());
params.put("update.ignored.builds", StringUtil.join(updateSettings.getIgnoredBuildNumbers(), ","));
params.put("plugin.name", error.getPluginName());
params.put("plugin.version", error.getPluginVersion());
params.put("last.action", error.getLastAction());
params.put("previous.exception", error.getPreviousException() == null ? null : Integer.toString(error.getPreviousException()));
params.put("error.message", error.getMessage());
params.put("error.stacktrace", error.getStackTrace());
params.put("error.description", error.getDescription());
params.put("assignee.id", error.getAssigneeId() == null ? null : Integer.toString(error.getAssigneeId()));
for (Attachment attachment : error.getAttachments()) {
params.put("attachment.name", attachment.getName());
params.put("attachment.value", attachment.getEncodedBytes());
}
return params;
}
Aggregations