use of com.android.tools.build.bundletool.model.exceptions.CommandExecutionException in project bundletool by google.
the class SigningConfigurationTest method extractFromKeystore_wrongKeystorePassword.
@Test
public void extractFromKeystore_wrongKeystorePassword() throws Exception {
Path keystorePath = createKeystore();
CommandExecutionException e = assertThrows(CommandExecutionException.class, () -> SigningConfiguration.extractFromKeystore(keystorePath, KEY_ALIAS, Optional.of(Password.createForTest("WrongPassword")), Optional.of(Password.createForTest(KEY_PASSWORD))));
assertThat(e).hasMessageThat().contains("Incorrect keystore password");
}
use of com.android.tools.build.bundletool.model.exceptions.CommandExecutionException in project bundletool by google.
the class BundleToolErrorTest method testCommandExecution_causeNoMessage.
@Test
public void testCommandExecution_causeNoMessage() {
CommandExecutionException exception = CommandExecutionException.builder().withCause(new IllegalArgumentException("internal")).build();
assertError(exception.toProto(), ErrorType.COMMAND_EXECUTION_ERROR, "", "java.lang.IllegalArgumentException: internal");
}
use of com.android.tools.build.bundletool.model.exceptions.CommandExecutionException in project bundletool by google.
the class BundleToolErrorTest method testCommandExecution.
@Test
public void testCommandExecution() {
CommandExecutionException exception = CommandExecutionException.builder().withInternalMessage("%s id:%d", "internal", 12).build();
assertError(exception.toProto(), ErrorType.COMMAND_EXECUTION_ERROR, "", "internal id:12");
}
use of com.android.tools.build.bundletool.model.exceptions.CommandExecutionException in project bundletool by google.
the class FusingAndroidManifestMergerTest method duplicateManifest_throws.
@Test
public void duplicateManifest_throws() {
SetMultimap<BundleModuleName, AndroidManifest> manifests = ImmutableSetMultimap.of(BASE_MODULE_NAME, AndroidManifest.create(androidManifest("com.testapp1")), BASE_MODULE_NAME, AndroidManifest.create(androidManifest("com.testapp2")));
CommandExecutionException exception = assertThrows(CommandExecutionException.class, () -> createMerger(Mode.REPLACE).merge(manifests));
assertThat(exception).hasMessageThat().isEqualTo("Expected exactly one base module manifest, but found 2.");
}
use of com.android.tools.build.bundletool.model.exceptions.CommandExecutionException in project bundletool by google.
the class MergingUtilsTest method mergeShardTargetings_sdkTargetingSecondTargeting_throws.
@Test
public void mergeShardTargetings_sdkTargetingSecondTargeting_throws() {
ApkTargeting targeting = apkMinSdkTargeting(1);
CommandExecutionException exception = assertThrows(CommandExecutionException.class, () -> MergingUtils.mergeShardTargetings(apkAbiTargeting(AbiAlias.X86), targeting));
assertThat(exception).hasMessageThat().contains("Expecting only ABI, screen density, language and texture compression format" + " targeting");
}
Aggregations