use of org.jetbrains.android.compiler.artifact.AndroidFinalPackageElement in project android by JetBrains.
the class NonGradleApkProviderTest method testGetApksWithArtifactName.
public void testGetApksWithArtifactName() throws Exception {
IDevice device = Mockito.mock(IDevice.class);
ArtifactManager artifactManager = ArtifactManager.getInstance(myFacet.getModule().getProject());
CompositePackagingElement<?> archive = PackagingElementFactory.getInstance().createArchive("right.apk");
archive.addFirstChild(new AndroidFinalPackageElement(myFacet.getModule().getProject(), myFacet));
artifactManager.addArtifact("customApk", AndroidApplicationArtifactType.getInstance(), archive);
myFacet.getProperties().APK_PATH = "wrong.apk";
NonGradleApkProvider provider = new NonGradleApkProvider(myFacet, new NonGradleApplicationIdProvider(myFacet), "customApk");
Collection<ApkInfo> apks = provider.getApks(device);
assertNotNull(apks);
assertEquals(1, apks.size());
ApkInfo apk = apks.iterator().next();
assertEquals("p1.p2", apk.getApplicationId());
assertTrue(apk.getFile().getPath().endsWith("right.apk"));
}
Aggregations