Search in sources :

Example 1 with DefaultSystemEnvironmentProvider

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

the class BuildSdkApksCommandTest method keystoreProvidedDoesNotPrint.

@Test
public void keystoreProvidedDoesNotPrint() throws Exception {
    try (ByteArrayOutputStream outputByteArrayStream = new ByteArrayOutputStream();
        PrintStream outputPrintStream = new PrintStream(outputByteArrayStream)) {
        BuildSdkApksCommand.fromFlags(getDefaultFlagsWithAdditionalFlags("--ks=" + keystorePath, "--ks-key-alias=" + KEY_ALIAS, "--ks-pass=pass:" + KEYSTORE_PASSWORD, "--key-pass=pass:" + KEY_PASSWORD), outputPrintStream, new DefaultSystemEnvironmentProvider());
        assertThat(new String(outputByteArrayStream.toByteArray(), UTF_8)).isEmpty();
    }
}
Also used : PrintStream(java.io.PrintStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) DefaultSystemEnvironmentProvider(com.android.tools.build.bundletool.model.utils.DefaultSystemEnvironmentProvider) Test(org.junit.Test)

Example 2 with DefaultSystemEnvironmentProvider

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

the class BuildSdkApksCommandTest method noKeystoreProvidedPrintsWarning.

@Test
@Ignore("b/222682673")
public void noKeystoreProvidedPrintsWarning() throws Exception {
    try (ByteArrayOutputStream outputByteArrayStream = new ByteArrayOutputStream();
        PrintStream outputPrintStream = new PrintStream(outputByteArrayStream)) {
        BuildSdkApksCommand.fromFlags(getDefaultFlagsWithAdditionalFlags(), outputPrintStream, new DefaultSystemEnvironmentProvider());
        assertThat(new String(outputByteArrayStream.toByteArray(), UTF_8)).contains("WARNING: The APKs won't be signed");
    }
}
Also used : PrintStream(java.io.PrintStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) DefaultSystemEnvironmentProvider(com.android.tools.build.bundletool.model.utils.DefaultSystemEnvironmentProvider) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

DefaultSystemEnvironmentProvider (com.android.tools.build.bundletool.model.utils.DefaultSystemEnvironmentProvider)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 PrintStream (java.io.PrintStream)2 Test (org.junit.Test)2 Ignore (org.junit.Ignore)1