use of com.android.repository.Revision 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.android.repository.Revision 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());
}
use of com.android.repository.Revision in project android by JetBrains.
the class PatchInstallerFactoryTest method canHandleNoPatchOnWindowsWithNewPatcher.
@Test
public void canHandleNoPatchOnWindowsWithNewPatcher() {
myFileOp.setIsWindows(true);
FakeRemotePackage remote = new FakeRemotePackage("foo");
remote.setRevision(new Revision(2));
FakeLocalPackage local = new FakeLocalPackage("foo");
local.setRevision(new Revision(1));
myRepositoryPackages.setLocalPkgInfos(ImmutableList.of(local, PATCHER_4));
myRepositoryPackages.setRemotePkgInfos(ImmutableList.of(remote));
assertTrue(myInstallerFactory.canHandlePackage(remote, myRepoManager, myFileOp));
}
use of com.android.repository.Revision in project android by JetBrains.
the class PatchInstallerFactoryTest method canHandleOnWindows.
@Test
public void canHandleOnWindows() {
myFileOp.setIsWindows(true);
FakeRemotePackage remote = new FakeRemotePackage("foo");
remote.setRevision(new Revision(2));
remote.setPatchInfo("foo", new Revision(1));
FakeLocalPackage local = new FakeLocalPackage("foo");
local.setRevision(new Revision(1));
myRepositoryPackages.setLocalPkgInfos(ImmutableList.of(local, PATCHER_4));
myRepositoryPackages.setRemotePkgInfos(ImmutableList.of(remote));
assertTrue(myInstallerFactory.canHandlePackage(remote, myRepoManager, myFileOp));
}
use of com.android.repository.Revision in project android by JetBrains.
the class PatchInstallerFactoryTest method createFallbackInstaller.
@Test
public void createFallbackInstaller() {
FakeRemotePackage remote = new FakeRemotePackage("foo");
remote.setRevision(new Revision(2));
FakeLocalPackage local = new FakeLocalPackage("foo");
local.setRevision(new Revision(1));
myRepositoryPackages.setLocalPkgInfos(ImmutableList.of(local, PATCHER_4));
myRepositoryPackages.setRemotePkgInfos(ImmutableList.of(remote));
Installer installer = myInstallerFactory.createInstaller(remote, myRepoManager, new FakeDownloader(myFileOp), myFileOp);
assertNotNull(installer);
assertFalse(installer instanceof PatchOperation);
}
Aggregations