use of org.robolectric.manifest.AndroidManifest in project Just-Another-Android-App by athkalia.
the class PermissionsTest method permissions_sanity_check.
@Test
public void permissions_sanity_check() {
// Arrange
AndroidManifest androidManifest = new AndroidManifest(Fs.fileFromPath("build/intermediates/manifests/full/debug/AndroidManifest.xml"), null, null);
Set<String> permissions = new HashSet<>(androidManifest.getUsedPermissions());
// Assert
String[] expectedPermissions = { "android.permission.INTERNET" };
assertThat(permissions).containsOnly(expectedPermissions);
}
use of org.robolectric.manifest.AndroidManifest in project robolectric by robolectric.
the class GradleManifestFactoryTest method getAppManifest_withMergedResources_shouldHaveMergedResPath.
@Test
public void getAppManifest_withMergedResources_shouldHaveMergedResPath() throws Exception {
FileFsFile.from("build", "intermediates", "res", "merged").getFile().mkdirs();
final AndroidManifest manifest = createManifest(configBuilder.setConstants(BuildConfig.class).setPackageName("fake.package.name").build());
assertThat(manifest.getPackageName()).isEqualTo("fake.package.name");
assertThat(manifest.getResDirectory()).isEqualTo(file("build/intermediates/res/merged/flavor1/type1"));
assertThat(manifest.getAssetsDirectory()).isEqualTo(file("build/intermediates/assets/flavor1/type1"));
assertThat(manifest.getAndroidManifestFile()).isEqualTo(file("build/intermediates/manifests/full/flavor1/type1/AndroidManifest.xml"));
}
use of org.robolectric.manifest.AndroidManifest in project robolectric by robolectric.
the class BuckManifestFactoryTest method multiple_res_dirs.
@Test
public void multiple_res_dirs() throws Exception {
ManifestIdentifier manifestIdentifier = buckManifestFactory.identify(configBuilder.build());
AndroidManifest manifest = buckManifestFactory.create(manifestIdentifier);
assertThat(manifest.getResDirectory()).isEqualTo(FileFsFile.from("buck/res2"));
assertThat(manifest.getAssetsDirectory()).isEqualTo(FileFsFile.from("buck/assets"));
List<ResourcePath> resourcePathList = manifest.getIncludedResourcePaths();
assertThat(resourcePathList.size()).isEqualTo(2);
assertThat(resourcePathList).containsExactly(new ResourcePath(manifest.getRClass(), FileFsFile.from("buck/res2"), FileFsFile.from("buck/assets")), new ResourcePath(manifest.getRClass(), FileFsFile.from("buck/res1"), FileFsFile.from("buck/assets")));
}
use of org.robolectric.manifest.AndroidManifest in project robolectric by robolectric.
the class GradleManifestFactoryTest method getAppManifest_withPackageNameOverride_shouldCreateManifest.
@Test
public void getAppManifest_withPackageNameOverride_shouldCreateManifest() throws Exception {
final AndroidManifest manifest = createManifest(configBuilder.setConstants(BuildConfig.class).setPackageName("fake.package.name").build());
assertThat(manifest.getPackageName()).isEqualTo("fake.package.name");
assertThat(manifest.getResDirectory()).isEqualTo(file("build/intermediates/res/flavor1/type1"));
assertThat(manifest.getAssetsDirectory()).isEqualTo(file("build/intermediates/assets/flavor1/type1"));
assertThat(manifest.getAndroidManifestFile()).isEqualTo(file("build/intermediates/manifests/full/flavor1/type1/AndroidManifest.xml"));
}
use of org.robolectric.manifest.AndroidManifest in project robolectric by robolectric.
the class GradleManifestFactoryTest method getAppManifest_shouldCreateManifestWithMethodOverrides.
@Test
public void getAppManifest_shouldCreateManifestWithMethodOverrides() throws Exception {
final AndroidManifest manifest = createManifest(configBuilder.setConstants(BuildConfigOverride.class).build());
assertThat(manifest.getResDirectory()).isEqualTo(file("build/intermediates/res/flavor2/type2"));
assertThat(manifest.getAssetsDirectory()).isEqualTo(file("build/intermediates/assets/flavor2/type2"));
assertThat(manifest.getAndroidManifestFile()).isEqualTo(file("build/intermediates/manifests/full/flavor2/type2/AndroidManifest.xml"));
}
Aggregations