use of com.intellij.ide.externalComponents.UpdatableExternalComponent in project android by JetBrains.
the class SdkComponentSource method installUpdates.
/**
* Install the given new versions of components.
*
* @param request The components to install.
*/
@Override
public void installUpdates(@NotNull Collection<UpdatableExternalComponent> request) {
final List<RemotePackage> packages = Lists.newArrayList();
for (UpdatableExternalComponent p : request) {
packages.add((RemotePackage) p.getKey());
}
new UpdateInfoDialog(true, packages).show();
}
use of com.intellij.ide.externalComponents.UpdatableExternalComponent in project android by JetBrains.
the class SdkComponentSourceTest method validateStablePackages.
private static void validateStablePackages(Iterator<UpdatableExternalComponent> componentIter) {
UpdatableExternalComponent c = componentIter.next();
assertEquals("package hasPreview", c.getName());
assertEquals(new Revision(1, 0, 0, 1), ((RepoPackage) c.getKey()).getVersion());
c = componentIter.next();
assertEquals("package newerPreview", c.getName());
assertEquals(new Revision(1, 0, 0, 2), ((RepoPackage) c.getKey()).getVersion());
c = componentIter.next();
assertEquals("package newerRemote", c.getName());
assertEquals(new Revision(1, 1, 0), ((RepoPackage) c.getKey()).getVersion());
c = componentIter.next();
assertEquals("package olderPreview", c.getName());
assertEquals(new Revision(1, 0, 0, 1), ((RepoPackage) c.getKey()).getVersion());
c = componentIter.next();
assertEquals("package olderRemote", c.getName());
assertEquals(new Revision(1, 1, 0), ((RepoPackage) c.getKey()).getVersion());
c = componentIter.next();
assertEquals("package onlyRemote", c.getName());
assertEquals(new Revision(1, 0, 0), ((RepoPackage) c.getKey()).getVersion());
c = componentIter.next();
assertEquals("package samePreview", c.getName());
assertEquals(new Revision(1, 0, 0, 1), ((RepoPackage) c.getKey()).getVersion());
c = componentIter.next();
assertEquals("package sameRemote", c.getName());
assertEquals(new Revision(1, 0, 0), ((RepoPackage) c.getKey()).getVersion());
}
use of com.intellij.ide.externalComponents.UpdatableExternalComponent in project android by JetBrains.
the class SdkComponentSourceTest method testAvailableBetaVersions.
public void testAvailableBetaVersions() throws Exception {
myChannelId = 1;
ProgressIndicator progress = new StudioProgressIndicatorAdapter(new FakeProgressIndicator(), null);
Set<UpdatableExternalComponent> components = Sets.newTreeSet(COMPONENT_COMPARATOR);
components.addAll(myTestComponentSource.getAvailableVersions(progress, null));
Iterator<UpdatableExternalComponent> componentIter = components.iterator();
validateStablePackages(componentIter);
UpdatableExternalComponent c = componentIter.next();
assertEquals("package zNewerInBeta", c.getName());
assertEquals(new Revision(2, 0, 0), ((RepoPackage) c.getKey()).getVersion());
assertFalse(componentIter.hasNext());
}
Aggregations