use of org.robolectric.manifest.AndroidManifest in project robolectric by robolectric.
the class GradleManifestFactoryTest method getAppManifest_forApplications_shouldCreateManifest.
@Test
public void getAppManifest_forApplications_shouldCreateManifest() throws Exception {
final AndroidManifest manifest = createManifest(configBuilder.setConstants(BuildConfig.class).build());
assertThat(manifest.getPackageName()).isEqualTo("org.robolectric.gradleapp");
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 rClassShouldBeInTheSamePackageAsBuildConfig.
@Test
public void rClassShouldBeInTheSamePackageAsBuildConfig() throws Exception {
File manifestFile = new File(joinPath("build", "intermediates", "manifests", "full", org.robolectric.gradleapp.BuildConfig.FLAVOR, org.robolectric.gradleapp.BuildConfig.BUILD_TYPE), "AndroidManifest.xml");
manifestFile.getParentFile().mkdirs();
newFile(manifestFile, "<manifest package=\"something\"/>");
AndroidManifest manifest = createManifest(configBuilder.setConstants(BuildConfig.class).build());
assertThat(manifest.getRClass().getPackage().getName()).isEqualTo("org.robolectric.gradleapp");
}
use of org.robolectric.manifest.AndroidManifest in project robolectric by robolectric.
the class GradleManifestFactoryTest method getAppManifest_withOverriddenConfigManifest_shouldCreateManifest.
@Test
public void getAppManifest_withOverriddenConfigManifest_shouldCreateManifest() throws Exception {
final AndroidManifest manifest = createManifest(configBuilder.setConstants(BuildConfig.class).setManifest("TestAndroidManifest.xml").build());
assertThat(manifest.getAndroidManifestFile().getPath()).isEqualTo(getClass().getClassLoader().getResource("TestAndroidManifest.xml").getPath());
assertThat(manifest.getPackageName()).isEqualTo("org.robolectric.gradleapp");
assertThat(manifest.getResDirectory()).isEqualTo(file("build/intermediates/res/flavor1/type1"));
assertThat(manifest.getAssetsDirectory()).isEqualTo(file("build/intermediates/assets/flavor1/type1"));
}
use of org.robolectric.manifest.AndroidManifest in project robolectric by robolectric.
the class GradleManifestFactoryTest method getAppManifest_forLibraries_shouldCreateManifest.
@Test
public void getAppManifest_forLibraries_shouldCreateManifest() throws Exception {
delete(FileFsFile.from("build", "intermediates", "res").getFile());
delete(FileFsFile.from("build", "intermediates", "assets").getFile());
delete(FileFsFile.from("build", "intermediates", "manifests", "full").getFile());
final AndroidManifest manifest = createManifest(configBuilder.setConstants(BuildConfig.class).build());
assertThat(manifest.getPackageName()).isEqualTo("org.robolectric.gradleapp");
assertThat(manifest.getResDirectory()).isEqualTo(file("build/intermediates/bundles/flavor1/type1/res"));
assertThat(manifest.getAssetsDirectory()).isEqualTo(file("build/intermediates/bundles/flavor1/type1/assets"));
assertThat(manifest.getAndroidManifestFile()).isEqualTo(file("build/intermediates/bundles/flavor1/type1/AndroidManifest.xml"));
}
use of org.robolectric.manifest.AndroidManifest in project robolectric by robolectric.
the class GradleManifestFactoryTest method getAppManifest_withOverriddenConfigAssetDir_shouldCreateManifest.
@Test
public void getAppManifest_withOverriddenConfigAssetDir_shouldCreateManifest() throws Exception {
final AndroidManifest manifest = createManifest(configBuilder.setConstants(BuildConfig.class).setAssetDir("../../src/test/resources/assets").build());
assertThat(manifest.getPackageName()).isEqualTo("org.robolectric.gradleapp");
assertThat(manifest.getResDirectory()).isEqualTo(file("build/intermediates/res/flavor1/type1"));
assertThat(manifest.getAssetsDirectory()).isEqualTo(file("build/intermediates/../../src/test/resources/assets"));
assertThat(manifest.getAndroidManifestFile()).isEqualTo(file("build/intermediates/manifests/full/flavor1/type1/AndroidManifest.xml"));
}
Aggregations