use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.
the class AppBundleTest method hasSharedUserId_specifiedInFeatureModule_returnsFalse.
@Test
public void hasSharedUserId_specifiedInFeatureModule_returnsFalse() {
AppBundle appBundle = new AppBundleBuilder().addModule("base", baseModule -> baseModule.setManifest(androidManifest(PACKAGE_NAME))).addModule("feature1", featureModule -> featureModule.setManifest(androidManifestForFeature(PACKAGE_NAME, withSharedUserId("shared_user_id")))).build();
assertThat(appBundle.hasSharedUserId()).isFalse();
}
use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.
the class AppBundleTest method getPackageName_assetOnly.
@Test
public void getPackageName_assetOnly() throws Exception {
AppBundle appBundle = new AppBundleBuilder().setBundleConfig(BundleConfig.newBuilder().setType(BundleType.ASSET_ONLY).build()).addModule("asset1", baseModule -> baseModule.setManifest(ASSET_MODULE_MANIFEST)).build();
assertThat(appBundle.getPackageName()).isEqualTo(PACKAGE_NAME);
}
use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.
the class AppBundleTest method isAssetOnly.
@Test
public void isAssetOnly() throws Exception {
AppBundle appBundle = new AppBundleBuilder().setBundleConfig(BundleConfig.newBuilder().setType(BundleType.ASSET_ONLY).build()).addModule("asset1", baseModule -> baseModule.setManifest(ASSET_MODULE_MANIFEST)).build();
assertThat(appBundle.isAssetOnly()).isTrue();
}
use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.
the class AppBundleTest method storeArchiveEnabled_true.
@Test
public void storeArchiveEnabled_true() throws Exception {
AppBundle appBundle = new AppBundleBuilder().setBundleConfig(BundleConfigBuilder.create().setStoreArchive(true).build()).addModule("base", builder -> builder.setManifest(MANIFEST)).build();
assertThat(appBundle.storeArchiveEnabled()).isTrue();
}
use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.
the class AppBundleTest method baseAndAssetModule_fromModules_areSeparated.
@Test
public void baseAndAssetModule_fromModules_areSeparated() throws Exception {
AppBundle appBundle = new AppBundleBuilder().addModule("base", baseModule -> baseModule.setManifest(MANIFEST).addFile("dex/classes.dex", DUMMY_CONTENT)).addModule("some_asset_module", module -> module.setManifest(ASSET_MODULE_MANIFEST).addFile("assets/img1.png", DUMMY_CONTENT)).build();
assertThat(appBundle.getFeatureModules().keySet()).containsExactly(BundleModuleName.create("base"));
assertThat(appBundle.getAssetModules().keySet()).containsExactly(BundleModuleName.create("some_asset_module"));
}
Aggregations