use of com.android.tools.build.bundletool.model.exceptions.InvalidBundleException in project bundletool by google.
the class BundleConfigValidatorTest method optimizations_duplicateSplitDimensions_throws.
@Test
public void optimizations_duplicateSplitDimensions_throws() throws Exception {
AppBundle appBundle = createAppBundle(BundleConfigBuilder.create().clearOptimizations().addSplitDimension(SplitDimension.Value.ABI).addSplitDimension(SplitDimension.Value.ABI));
InvalidBundleException exception = assertThrows(InvalidBundleException.class, () -> new BundleConfigValidator().validateBundle(appBundle));
assertThat(exception).hasMessageThat().contains("duplicate split dimensions:");
}
use of com.android.tools.build.bundletool.model.exceptions.InvalidBundleException in project bundletool by google.
the class BundleConfigValidatorTest method compression_forbiddenCharactersInGlob_carriageReturn_throws.
@Test
public void compression_forbiddenCharactersInGlob_carriageReturn_throws() throws Exception {
AppBundle appBundle = createAppBundle(BundleConfigBuilder.create().clearCompression().addUncompressedGlob("res/raw/**\nassets/raw/**"));
InvalidBundleException e = assertThrows(InvalidBundleException.class, () -> new BundleConfigValidator().validateBundle(appBundle));
assertThat(e).hasMessageThat().contains("Invalid uncompressed glob: 'res/raw/**\nassets/raw/**'.");
}
use of com.android.tools.build.bundletool.model.exceptions.InvalidBundleException in project bundletool by google.
the class BundleConfigValidatorTest method optimizations_nonTcfDimensionsSuffixStripping_throws.
@Test
public void optimizations_nonTcfDimensionsSuffixStripping_throws() throws Exception {
AppBundle appBundle = createAppBundle(BundleConfigBuilder.create().clearOptimizations().addSplitDimension(SplitDimension.newBuilder().setValueValue(Value.LANGUAGE_VALUE).setSuffixStripping(SuffixStripping.newBuilder().setEnabled(true)).build()));
InvalidBundleException exception = assertThrows(InvalidBundleException.class, () -> new BundleConfigValidator().validateBundle(appBundle));
assertThat(exception).hasMessageThat().contains("Suffix stripping was enabled for an unsupported dimension. Supported dimensions are:" + " TEXTURE_COMPRESSION_FORMAT, DEVICE_TIER.");
}
use of com.android.tools.build.bundletool.model.exceptions.InvalidBundleException in project bundletool by google.
the class BundleConfigValidatorTest method compression_forbiddenCharactersInGlob_backslash_throws.
@Test
public void compression_forbiddenCharactersInGlob_backslash_throws() throws Exception {
AppBundle appBundle = createAppBundle(BundleConfigBuilder.create().clearCompression().addUncompressedGlob("res\\\\raw\\\\**"));
InvalidBundleException e = assertThrows(InvalidBundleException.class, () -> new BundleConfigValidator().validateBundle(appBundle));
assertThat(e).hasMessageThat().contains("Invalid uncompressed glob: 'res\\\\raw\\\\**'.");
}
use of com.android.tools.build.bundletool.model.exceptions.InvalidBundleException in project bundletool by google.
the class BundleConfigValidatorTest method optimizations_unrecognizedDimensionsEnabled_throws.
@Test
public void optimizations_unrecognizedDimensionsEnabled_throws() throws Exception {
AppBundle appBundle = createAppBundle(BundleConfigBuilder.create().clearOptimizations().addSplitDimension(SplitDimension.newBuilder().setValueValue(1234).build()));
InvalidBundleException exception = assertThrows(InvalidBundleException.class, () -> new BundleConfigValidator().validateBundle(appBundle));
assertThat(exception).hasMessageThat().contains("BundleConfig.pb contains an unrecognized split dimension.");
}
Aggregations