use of com.android.repository.testframework.FakePackage.FakeLocalPackage in project android by JetBrains.
the class PatchInstallerFactoryTest method createInstallerWithPatch.
@Test
public void createInstallerWithPatch() {
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));
Installer installer = myInstallerFactory.createInstaller(remote, myRepoManager, new FakeDownloader(myFileOp), myFileOp);
assertTrue(installer instanceof PatchInstaller);
}
use of com.android.repository.testframework.FakePackage.FakeLocalPackage in project android by JetBrains.
the class PatchInstallerFactoryTest method cantHandleWindowsUninstallWithoutPatcher.
@Test
public void cantHandleWindowsUninstallWithoutPatcher() {
myFileOp.setIsWindows(true);
LocalPackage p = new FakeLocalPackage("foo");
myRepositoryPackages.setLocalPkgInfos(ImmutableList.of(p));
assertFalse(myInstallerFactory.canHandlePackage(p, myRepoManager, myFileOp));
}
use of com.android.repository.testframework.FakePackage.FakeLocalPackage in project android by JetBrains.
the class PatchInstallerFactoryTest method canHandleWindowsUninstallWithPatcher.
@Test
public void canHandleWindowsUninstallWithPatcher() {
myFileOp.setIsWindows(true);
LocalPackage p = new FakeLocalPackage("foo");
myRepositoryPackages.setLocalPkgInfos(ImmutableList.of(p, PATCHER_4));
assertTrue(myInstallerFactory.canHandlePackage(p, myRepoManager, myFileOp));
}
use of com.android.repository.testframework.FakePackage.FakeLocalPackage in project android by JetBrains.
the class PatchInstallerFactoryTest method createPatchUninstaller.
@Test
public void createPatchUninstaller() {
myFileOp.setIsWindows(true);
FakeLocalPackage p = new FakeLocalPackage("foo");
myRepositoryPackages.setLocalPkgInfos(ImmutableList.of(p, PATCHER_4));
assertTrue(myInstallerFactory.createUninstaller(p, myRepoManager, myFileOp) instanceof PatchUninstaller);
}
use of com.android.repository.testframework.FakePackage.FakeLocalPackage in project android by JetBrains.
the class PatchInstallerFactoryTest method createFallbackUninstaller.
@Test
public void createFallbackUninstaller() {
FakeLocalPackage p = new FakeLocalPackage("foo");
assertFalse(myInstallerFactory.createUninstaller(p, myRepoManager, myFileOp) instanceof PatchUninstaller);
}
Aggregations