use of com.android.repository.testframework.FakePackage.FakeLocalPackage in project android by JetBrains.
the class PatchInstallerFactoryTest method cantHandleNoPatchOnWindowsWithNoPatcher.
@Test
public void cantHandleNoPatchOnWindowsWithNoPatcher() {
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));
myRepositoryPackages.setRemotePkgInfos(ImmutableList.of(remote));
assertFalse(myInstallerFactory.canHandlePackage(remote, myRepoManager, myFileOp));
}
use of com.android.repository.testframework.FakePackage.FakeLocalPackage in project android by JetBrains.
the class PatchInstallerUtilTest method getDependantPatcher.
@Test
public void getDependantPatcher() throws Exception {
LocalPackage target = new FakeLocalPackage("patcher;v2");
List<LocalPackage> local = ImmutableList.of(new FakeLocalPackage("patcher;v1"), target, new FakeLocalPackage("patcher;v3"));
FakeRemotePackage update = new FakeRemotePackage("p");
List<RemotePackage> remote = ImmutableList.of(update, new FakeRemotePackage("patcher;v4"));
update.setDependencies(ImmutableList.of(new FakeDependency(target.getPath())));
RepositoryPackages packages = new RepositoryPackages(local, remote);
FakeRepoManager mgr = new FakeRepoManager(new File("/sdk"), packages);
LocalPackage patcher = PatchInstallerUtil.getDependantPatcher(update, mgr);
assertEquals(target, patcher);
}
use of com.android.repository.testframework.FakePackage.FakeLocalPackage in project android by JetBrains.
the class PatchInstallerUtilTest method dependantPatcherNotInstalled.
@Test
public void dependantPatcherNotInstalled() throws Exception {
FakeLocalPackage target = new FakeLocalPackage("patcher;v2");
List<LocalPackage> local = ImmutableList.of(new FakeLocalPackage("patcher;v1"), new FakeLocalPackage("patcher;v3"));
FakeRemotePackage update = new FakeRemotePackage("p");
List<RemotePackage> remote = ImmutableList.of(update, new FakeRemotePackage("patcher;v4"));
update.setDependencies(ImmutableList.of(new FakeDependency(target.getPath())));
RepositoryPackages packages = new RepositoryPackages(local, remote);
FakeRepoManager mgr = new FakeRepoManager(new File("/sdk"), packages);
LocalPackage patcher = PatchInstallerUtil.getDependantPatcher(update, mgr);
assertNull(patcher);
}
use of com.android.repository.testframework.FakePackage.FakeLocalPackage in project android by JetBrains.
the class PatchInstallerUtilTest method noLatestPatcher.
@Test
public void noLatestPatcher() throws Exception {
List<LocalPackage> local = ImmutableList.of(new FakeLocalPackage("foo"));
RepositoryPackages packages = new RepositoryPackages(local, ImmutableList.of());
FakeRepoManager mgr = new FakeRepoManager(new File("/sdk"), packages);
LocalPackage patcher = PatchInstallerUtil.getLatestPatcher(mgr);
assertNull(patcher);
}
Aggregations