use of com.android.tools.build.bundletool.flags.FlagParser in project bundletool by google.
the class InstallApksCommandTest method missingApksFlag_fails.
@Test
public void missingApksFlag_fails() {
expectMissingRequiredBuilderPropertyException("apksArchivePath", () -> InstallApksCommand.builder().setAdbPath(adbPath).setAdbServer(fakeServerOneDevice(lDeviceWithLocales("en-US"))).build());
expectMissingRequiredFlagException("apks", () -> InstallApksCommand.fromFlags(new FlagParser().parse("--adb=" + adbPath), systemEnvironmentProvider, fakeServerOneDevice(lDeviceWithLocales("en-US"))));
}
use of com.android.tools.build.bundletool.flags.FlagParser in project bundletool by google.
the class InstallMultiApksCommandTest method fromFlags_matchBuilder_apksZip.
@Test
public void fromFlags_matchBuilder_apksZip() {
Path zipFile = tmpDir.resolve("container.zip");
InstallMultiApksCommand fromFlags = InstallMultiApksCommand.fromFlags(new FlagParser().parse("--apks-zip=" + zipFile), systemEnvironmentProvider, fakeServerOneDevice(qDeviceWithLocales("en-US")));
InstallMultiApksCommand fromBuilder = InstallMultiApksCommand.builder().setAdbPath(adbPath).setAdbServer(fromFlags.getAdbServer()).setApksArchiveZipPath(zipFile).setDeviceId(DEVICE_ID).build();
assertThat(fromBuilder).isEqualTo(fromFlags);
}
use of com.android.tools.build.bundletool.flags.FlagParser in project bundletool by google.
the class InstallMultiApksCommandTest method fromFlags_missingApksOption.
@Test
public void fromFlags_missingApksOption() {
InvalidCommandException e = assertThrows(InvalidCommandException.class, () -> InstallMultiApksCommand.fromFlags(new FlagParser().parse(), systemEnvironmentProvider, fakeServerOneDevice(qDeviceWithLocales("en-US"))));
assertThat(e).hasMessageThat().contains("Exactly one of");
}
use of com.android.tools.build.bundletool.flags.FlagParser in project bundletool by google.
the class InstallMultiApksCommandTest method fromFlags_staged.
@Test
public void fromFlags_staged() {
Path zipFile = tmpDir.resolve("container.zip");
InstallMultiApksCommand fromFlags = InstallMultiApksCommand.fromFlags(new FlagParser().parse("--staged", "--apks-zip=" + zipFile), systemEnvironmentProvider, fakeServerOneDevice(qDeviceWithLocales("en-US")));
assertThat(fromFlags.getStaged()).isTrue();
}
use of com.android.tools.build.bundletool.flags.FlagParser in project bundletool by google.
the class InstallMultiApksCommandTest method execute_badAdbPath.
@Test
public void execute_badAdbPath() {
Path zipFile = tmpDir.resolve("container.zip");
InstallMultiApksCommand fromFlags = InstallMultiApksCommand.fromFlags(new FlagParser().parse("--adb=foo", "--apks-zip=" + zipFile), systemEnvironmentProvider, fakeServerOneDevice(qDeviceWithLocales("en-US")));
IllegalArgumentException e = assertThrows(IllegalArgumentException.class, fromFlags::execute);
assertThat(e).hasMessageThat().contains("was not found");
}
Aggregations