Search in sources :

Example 1 with FakeDownloader

use of com.android.repository.testframework.FakeDownloader in project android by JetBrains.

the class PatchInstallerFactoryTest method createInstallerWithoutPatch.

@Test
public void createInstallerWithoutPatch() {
    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));
    Installer installer = myInstallerFactory.createInstaller(remote, myRepoManager, new FakeDownloader(myFileOp), myFileOp);
    assertTrue(installer instanceof FullInstaller);
}
Also used : FakeRemotePackage(com.android.repository.testframework.FakePackage.FakeRemotePackage) FakeLocalPackage(com.android.repository.testframework.FakePackage.FakeLocalPackage) Revision(com.android.repository.Revision) Installer(com.android.repository.api.Installer) FakeDownloader(com.android.repository.testframework.FakeDownloader) Test(org.junit.Test)

Example 2 with FakeDownloader

use of com.android.repository.testframework.FakeDownloader 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);
}
Also used : FakeRemotePackage(com.android.repository.testframework.FakePackage.FakeRemotePackage) FakeLocalPackage(com.android.repository.testframework.FakePackage.FakeLocalPackage) Revision(com.android.repository.Revision) Installer(com.android.repository.api.Installer) FakeDownloader(com.android.repository.testframework.FakeDownloader) Test(org.junit.Test)

Example 3 with FakeDownloader

use of com.android.repository.testframework.FakeDownloader 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);
}
Also used : FakeRemotePackage(com.android.repository.testframework.FakePackage.FakeRemotePackage) FakeLocalPackage(com.android.repository.testframework.FakePackage.FakeLocalPackage) Revision(com.android.repository.Revision) Installer(com.android.repository.api.Installer) FakeDownloader(com.android.repository.testframework.FakeDownloader) Test(org.junit.Test)

Aggregations

Revision (com.android.repository.Revision)3 Installer (com.android.repository.api.Installer)3 FakeDownloader (com.android.repository.testframework.FakeDownloader)3 FakeLocalPackage (com.android.repository.testframework.FakePackage.FakeLocalPackage)3 FakeRemotePackage (com.android.repository.testframework.FakePackage.FakeRemotePackage)3 Test (org.junit.Test)3