Search in sources :

Example 6 with FakeRemotePackage

use of com.android.repository.testframework.FakePackage.FakeRemotePackage in project android by JetBrains.

the class PatchInstallerFactoryTest method cantHandleNoSrcOnWindows.

@Test
public void cantHandleNoSrcOnWindows() {
    myFileOp.setIsWindows(true);
    FakeRemotePackage remote = new FakeRemotePackage("foo");
    remote.setRevision(new Revision(2));
    myRepositoryPackages.setLocalPkgInfos(ImmutableList.of(PATCHER_4));
    myRepositoryPackages.setRemotePkgInfos(ImmutableList.of(remote));
    assertFalse(myInstallerFactory.canHandlePackage(remote, myRepoManager, myFileOp));
}
Also used : FakeRemotePackage(com.android.repository.testframework.FakePackage.FakeRemotePackage) Revision(com.android.repository.Revision) Test(org.junit.Test)

Example 7 with FakeRemotePackage

use of com.android.repository.testframework.FakePackage.FakeRemotePackage in project android by JetBrains.

the class PatchInstallerFactoryTest method cantHandleNoPatchOnLinux.

@Test
public void cantHandleNoPatchOnLinux() {
    FakeRemotePackage p = new FakeRemotePackage("foo");
    myRepositoryPackages.setLocalPkgInfos(ImmutableList.of(PATCHER_4));
    myRepositoryPackages.setRemotePkgInfos(ImmutableList.of(p));
    assertFalse(myInstallerFactory.canHandlePackage(p, myRepoManager, myFileOp));
}
Also used : FakeRemotePackage(com.android.repository.testframework.FakePackage.FakeRemotePackage) Test(org.junit.Test)

Example 8 with FakeRemotePackage

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

Example 9 with FakeRemotePackage

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

Example 10 with FakeRemotePackage

use of com.android.repository.testframework.FakePackage.FakeRemotePackage 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

FakeRemotePackage (com.android.repository.testframework.FakePackage.FakeRemotePackage)13 Test (org.junit.Test)13 FakeLocalPackage (com.android.repository.testframework.FakePackage.FakeLocalPackage)11 Revision (com.android.repository.Revision)10 Installer (com.android.repository.api.Installer)3 FakeDownloader (com.android.repository.testframework.FakeDownloader)3 LocalPackage (com.android.repository.api.LocalPackage)2 RemotePackage (com.android.repository.api.RemotePackage)2 RepositoryPackages (com.android.repository.impl.meta.RepositoryPackages)2 FakeDependency (com.android.repository.testframework.FakeDependency)2 FakeRepoManager (com.android.repository.testframework.FakeRepoManager)2 File (java.io.File)2