Search in sources :

Example 1 with ZipPath

use of com.android.tools.build.bundletool.model.ZipPath in project bundletool by google.

the class BundleFilesValidatorTest method validateApexFile_repeatingAbis_throws.

@Test
public void validateApexFile_repeatingAbis_throws() throws Exception {
    ZipPath repeatingAbisFile = ZipPath.create("apex/x86.x86_64.x86.img");
    InvalidBundleException e = assertThrows(InvalidBundleException.class, () -> new BundleFilesValidator().validateModuleFile(repeatingAbisFile));
    assertThat(e).hasMessageThat().contains("Repeating architectures in APEX system image file");
}
Also used : InvalidBundleException(com.android.tools.build.bundletool.model.exceptions.InvalidBundleException) ZipPath(com.android.tools.build.bundletool.model.ZipPath) Test(org.junit.Test)

Example 2 with ZipPath

use of com.android.tools.build.bundletool.model.ZipPath in project bundletool by google.

the class BundleFilesValidatorTest method validateDexFile_valid_success.

@Test
public void validateDexFile_valid_success() throws Exception {
    ZipPath dexFile = ZipPath.create("dex/classes.dex");
    new BundleFilesValidator().validateModuleFile(dexFile);
}
Also used : ZipPath(com.android.tools.build.bundletool.model.ZipPath) Test(org.junit.Test)

Example 3 with ZipPath

use of com.android.tools.build.bundletool.model.ZipPath in project bundletool by google.

the class BundleFilesValidatorTest method validateLibFile_nonSoExtension_throws.

@Test
public void validateLibFile_nonSoExtension_throws() throws Exception {
    ZipPath nonSoFile = ZipPath.create("lib/x86/libX.dat");
    InvalidBundleException e = assertThrows(InvalidBundleException.class, () -> new BundleFilesValidator().validateModuleFile(nonSoFile));
    assertThat(e).hasMessageThat().contains("Files under lib/ must have .so extension");
}
Also used : InvalidBundleException(com.android.tools.build.bundletool.model.exceptions.InvalidBundleException) ZipPath(com.android.tools.build.bundletool.model.ZipPath) Test(org.junit.Test)

Example 4 with ZipPath

use of com.android.tools.build.bundletool.model.ZipPath in project bundletool by google.

the class BundleFilesValidatorTest method validateWrapSh_valid_success.

@Test
public void validateWrapSh_valid_success() throws Exception {
    ZipPath libFile = ZipPath.create("lib/x86/wrap.sh");
    new BundleFilesValidator().validateModuleFile(libFile);
}
Also used : ZipPath(com.android.tools.build.bundletool.model.ZipPath) Test(org.junit.Test)

Example 5 with ZipPath

use of com.android.tools.build.bundletool.model.ZipPath in project bundletool by google.

the class BundleFilesValidatorTest method validateApexFile_nonImgExtension_throws.

@Test
public void validateApexFile_nonImgExtension_throws() throws Exception {
    ZipPath nonImgFile = ZipPath.create("apex/x86.dat");
    InvalidBundleException e = assertThrows(InvalidBundleException.class, () -> new BundleFilesValidator().validateModuleFile(nonImgFile));
    assertThat(e).hasMessageThat().contains("Files under apex/ must have .img extension");
}
Also used : InvalidBundleException(com.android.tools.build.bundletool.model.exceptions.InvalidBundleException) ZipPath(com.android.tools.build.bundletool.model.ZipPath) Test(org.junit.Test)

Aggregations

ZipPath (com.android.tools.build.bundletool.model.ZipPath)194 Test (org.junit.Test)154 BuildApksResult (com.android.bundle.Commands.BuildApksResult)106 Path (java.nio.file.Path)55 DeviceSpec (com.android.bundle.Devices.DeviceSpec)44 InvalidBundleException (com.android.tools.build.bundletool.model.exceptions.InvalidBundleException)23 ImmutableSet (com.google.common.collect.ImmutableSet)23 ModuleEntry (com.android.tools.build.bundletool.model.ModuleEntry)19 Variant (com.android.bundle.Commands.Variant)16 ApksArchiveHelpers.createVariant (com.android.tools.build.bundletool.testing.ApksArchiveHelpers.createVariant)15 BundleModule (com.android.tools.build.bundletool.model.BundleModule)13 ImmutableList (com.google.common.collect.ImmutableList)12 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)11 ApksArchiveHelpers.standaloneVariant (com.android.tools.build.bundletool.testing.ApksArchiveHelpers.standaloneVariant)10 Theory (org.junit.experimental.theories.Theory)10 AdbServer (com.android.tools.build.bundletool.device.AdbServer)9 IOException (java.io.IOException)9 ModuleSplit (com.android.tools.build.bundletool.model.ModuleSplit)8 ImmutableSet.toImmutableSet (com.google.common.collect.ImmutableSet.toImmutableSet)8 UncheckedIOException (java.io.UncheckedIOException)8