use of com.android.tools.build.bundletool.model.exceptions.CommandExecutionException in project bundletool by google.
the class FusingAndroidManifestMergerTest method noBaseManifest_throws.
@Test
public void noBaseManifest_throws() {
SetMultimap<BundleModuleName, AndroidManifest> manifests = ImmutableSetMultimap.of(BundleModuleName.create("feature"), AndroidManifest.create(androidManifest("com.testapp")));
CommandExecutionException exception = assertThrows(CommandExecutionException.class, () -> createMerger(Mode.REPLACE).merge(manifests));
assertThat(exception).hasMessageThat().isEqualTo("Expected to have base module.");
}
use of com.android.tools.build.bundletool.model.exceptions.CommandExecutionException in project bundletool by google.
the class KeystorePropertiesTest method readFromFile_missingKeystorePath.
@Test
public void readFromFile_missingKeystorePath() throws Exception {
Path keystorePropertiesPath = createPropertiesFile(null, KEY_ALIAS, null, null);
CommandExecutionException e = assertThrows(CommandExecutionException.class, () -> KeystoreProperties.readFromFile(keystorePropertiesPath));
assertThat(e).hasMessageThat().contains(String.format("No value was given for property 'ks' in %s.", keystorePropertiesPath));
}
use of com.android.tools.build.bundletool.model.exceptions.CommandExecutionException in project bundletool by google.
the class SigningConfigurationTest method extractFromKeystore_wrongKeyPassword.
@Test
public void extractFromKeystore_wrongKeyPassword() throws Exception {
Path keystorePath = createKeystore();
CommandExecutionException e = assertThrows(CommandExecutionException.class, () -> SigningConfiguration.extractFromKeystore(keystorePath, KEY_ALIAS, Optional.of(Password.createForTest(KEYSTORE_PASSWORD)), Optional.of(Password.createForTest("WrongPassword"))));
assertThat(e).hasMessageThat().contains("Incorrect key password");
}
use of com.android.tools.build.bundletool.model.exceptions.CommandExecutionException in project bundletool by google.
the class SigningConfigurationTest method extractFromKeystore_keyAliasDoesNotExist.
@Test
public void extractFromKeystore_keyAliasDoesNotExist() throws Exception {
Path keystorePath = createKeystore();
CommandExecutionException e = assertThrows(CommandExecutionException.class, () -> SigningConfiguration.extractFromKeystore(keystorePath, "BadKeyAlias", Optional.of(Password.createForTest(KEYSTORE_PASSWORD)), Optional.of(Password.createForTest(KEY_PASSWORD))));
assertThat(e).hasMessageThat().contains("No key found with alias 'BadKeyAlias'");
}
use of com.android.tools.build.bundletool.model.exceptions.CommandExecutionException in project bundletool by google.
the class KeystorePropertiesTest method readFromFile_missingKeyAlias.
@Test
public void readFromFile_missingKeyAlias() throws Exception {
Path keystorePropertiesPath = createPropertiesFile(KEYSTORE_PATH, null, null, null);
CommandExecutionException e = assertThrows(CommandExecutionException.class, () -> KeystoreProperties.readFromFile(keystorePropertiesPath));
assertThat(e).hasMessageThat().contains(String.format("No value was given for property 'ks-key-alias' in %s.", keystorePropertiesPath));
}
Aggregations