use of com.android.repository.testframework.FakePackage.FakeLocalPackage in project android by JetBrains.
the class AvdWizardUtilsTest method createMockSdk.
@NotNull
private static AndroidSdkHandler createMockSdk(String versionString, String path) {
FakeLocalPackage p = new FakeLocalPackage(path);
p.setRevision(Revision.parseRevision(versionString));
RepositoryPackages packages = new RepositoryPackages();
packages.setLocalPkgInfos(ImmutableList.of(p));
RepoManager mgr = new FakeRepoManager(null, packages);
return new AndroidSdkHandler(null, null, new MockFileOp(), mgr);
}
use of com.android.repository.testframework.FakePackage.FakeLocalPackage 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.testframework.FakePackage.FakeLocalPackage 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.testframework.FakePackage.FakeLocalPackage in project android by JetBrains.
the class PatchInstallerFactoryTest method cantHandleLinuxUninstallWithPatcher.
@Test
public void cantHandleLinuxUninstallWithPatcher() {
LocalPackage p = new FakeLocalPackage("foo");
myRepositoryPackages.setLocalPkgInfos(ImmutableList.of(p, PATCHER_4));
assertFalse(myInstallerFactory.canHandlePackage(p, myRepoManager, myFileOp));
}
use of com.android.repository.testframework.FakePackage.FakeLocalPackage 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