Search in sources :

Example 1 with FakeDependency

use of com.android.repository.testframework.FakeDependency 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);
}
Also used : FakeRemotePackage(com.android.repository.testframework.FakePackage.FakeRemotePackage) FakeLocalPackage(com.android.repository.testframework.FakePackage.FakeLocalPackage) LocalPackage(com.android.repository.api.LocalPackage) FakeLocalPackage(com.android.repository.testframework.FakePackage.FakeLocalPackage) RepositoryPackages(com.android.repository.impl.meta.RepositoryPackages) FakeDependency(com.android.repository.testframework.FakeDependency) FakeRepoManager(com.android.repository.testframework.FakeRepoManager) RemotePackage(com.android.repository.api.RemotePackage) FakeRemotePackage(com.android.repository.testframework.FakePackage.FakeRemotePackage) File(java.io.File) Test(org.junit.Test)

Example 2 with FakeDependency

use of com.android.repository.testframework.FakeDependency 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);
}
Also used : FakeRemotePackage(com.android.repository.testframework.FakePackage.FakeRemotePackage) FakeLocalPackage(com.android.repository.testframework.FakePackage.FakeLocalPackage) LocalPackage(com.android.repository.api.LocalPackage) FakeLocalPackage(com.android.repository.testframework.FakePackage.FakeLocalPackage) RepositoryPackages(com.android.repository.impl.meta.RepositoryPackages) FakeDependency(com.android.repository.testframework.FakeDependency) FakeRepoManager(com.android.repository.testframework.FakeRepoManager) RemotePackage(com.android.repository.api.RemotePackage) FakeRemotePackage(com.android.repository.testframework.FakePackage.FakeRemotePackage) File(java.io.File) Test(org.junit.Test)

Aggregations

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 FakeLocalPackage (com.android.repository.testframework.FakePackage.FakeLocalPackage)2 FakeRemotePackage (com.android.repository.testframework.FakePackage.FakeRemotePackage)2 FakeRepoManager (com.android.repository.testframework.FakeRepoManager)2 File (java.io.File)2 Test (org.junit.Test)2