use of com.android.tools.build.bundletool.flags.FlagParser in project bundletool by google.
the class CheckTransparencyCommandTest method buildingCommandViaFlags_bundleMode_unknownFlagSet.
@Test
public void buildingCommandViaFlags_bundleMode_unknownFlagSet() {
Throwable e = assertThrows(UnknownFlagsException.class, () -> CheckTransparencyCommand.fromFlags(new FlagParser().parse("--mode=BUNDLE", "--bundle=" + bundlePath, "--unknownFlag=hello"), systemEnvironmentProvider, fakeAdbServer));
assertThat(e).hasMessageThat().contains("Unrecognized flags");
}
use of com.android.tools.build.bundletool.flags.FlagParser in project bundletool by google.
the class CheckTransparencyCommandTest method buildingCommandViaFlags_apkMode_adbPathSet.
@Test
public void buildingCommandViaFlags_apkMode_adbPathSet() {
Throwable e = assertThrows(UnknownFlagsException.class, () -> CheckTransparencyCommand.fromFlags(new FlagParser().parse("--mode=APK", "--apk-zip=" + apkZipPath, "--adb=path/to/adb"), systemEnvironmentProvider, fakeAdbServer));
assertThat(e).hasMessageThat().contains("Unrecognized flags");
}
use of com.android.tools.build.bundletool.flags.FlagParser in project bundletool by google.
the class CheckTransparencyCommandTest method buildingCommandViaFlags_connectedDeviceMode_unknownFlagSet.
@Test
public void buildingCommandViaFlags_connectedDeviceMode_unknownFlagSet() {
Throwable e = assertThrows(UnknownFlagsException.class, () -> CheckTransparencyCommand.fromFlags(new FlagParser().parse("--mode=CONNECTED_DEVICE", "--connected-device=true", "--adb=" + ADB_PATH, "--package-name=" + PACKAGE_NAME, "--unknownFlag=hello"), systemEnvironmentProvider, fakeAdbServer));
assertThat(e).hasMessageThat().contains("Unrecognized flags");
}
use of com.android.tools.build.bundletool.flags.FlagParser in project bundletool by google.
the class CheckTransparencyCommandTest method buildingCommandViaFlags_bundleMode_bundlePathNotSet.
@Test
public void buildingCommandViaFlags_bundleMode_bundlePathNotSet() {
Throwable e = assertThrows(RequiredFlagNotSetException.class, () -> CheckTransparencyCommand.fromFlags(new FlagParser().parse("--mode=BUNDLE"), systemEnvironmentProvider, fakeAdbServer));
assertThat(e).hasMessageThat().contains("Missing the required --bundle flag");
}
use of com.android.tools.build.bundletool.flags.FlagParser in project bundletool by google.
the class ExtractApksCommandTest method missingApksArchiveFlag_throws.
@Test
public void missingApksArchiveFlag_throws() throws Exception {
Path deviceSpecFile = createDeviceSpecFile(DeviceSpec.getDefaultInstance(), tmpDir.resolve("device.json"));
expectMissingRequiredFlagException("apks", () -> ExtractApksCommand.fromFlags(new FlagParser().parse("--device-spec=" + deviceSpecFile)));
}
Aggregations