Remove dependency on ModuleTestUtils

Bug: 160296318
Test: atest StagedInstallInternalTest
Change-Id: Ic311aeaf4801c3b7c0dc5cd7a222cc304bba1335
Merged-In: Ic311aeaf4801c3b7c0dc5cd7a222cc304bba1335
(cherry picked from commit cdb2494778)
This commit is contained in:
Mohammad Samiul Islam
2020-09-17 18:39:49 +01:00
parent 7d3a369aea
commit ccf4849b52
2 changed files with 6 additions and 9 deletions

View File

@@ -27,7 +27,6 @@ java_test_host {
static_libs: [ static_libs: [
"testng", "testng",
"compatibility-tradefed", "compatibility-tradefed",
"module_test_util",
"frameworks-base-hostutils", "frameworks-base-hostutils",
"cts-install-lib-host", "cts-install-lib-host",
], ],

View File

@@ -27,7 +27,6 @@ import android.cts.install.lib.host.InstallUtilsHost;
import com.android.ddmlib.Log; import com.android.ddmlib.Log;
import com.android.tests.rollback.host.AbandonSessionsRule; import com.android.tests.rollback.host.AbandonSessionsRule;
import com.android.tests.util.ModuleTestUtils;
import com.android.tradefed.device.DeviceNotAvailableException; import com.android.tradefed.device.DeviceNotAvailableException;
import com.android.tradefed.testtype.DeviceJUnit4ClassRunner; import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test; import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test;
@@ -56,7 +55,6 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test {
private static final String SHIM_V2 = "com.android.apex.cts.shim.v2.apex"; private static final String SHIM_V2 = "com.android.apex.cts.shim.v2.apex";
private static final String APK_A = "TestAppAv1.apk"; private static final String APK_A = "TestAppAv1.apk";
private final ModuleTestUtils mTestUtils = new ModuleTestUtils(this);
private final InstallUtilsHost mHostUtils = new InstallUtilsHost(this); private final InstallUtilsHost mHostUtils = new InstallUtilsHost(this);
/** /**
@@ -105,7 +103,7 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test {
assumeTrue("Device does not support updating APEX", assumeTrue("Device does not support updating APEX",
mHostUtils.isApexUpdateSupported()); mHostUtils.isApexUpdateSupported());
final File apexFile = mTestUtils.getTestFile(SHIM_V2); final File apexFile = mHostUtils.getTestFile(SHIM_V2);
final String output = getDevice().executeAdbCommand("install", "--staged", final String output = getDevice().executeAdbCommand("install", "--staged",
"--staged-ready-timeout", "60000", apexFile.getAbsolutePath()); "--staged-ready-timeout", "60000", apexFile.getAbsolutePath());
assertThat(output).contains("Reboot device to apply staged session"); assertThat(output).contains("Reboot device to apply staged session");
@@ -120,7 +118,7 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test {
assumeTrue("Device does not support updating APEX", assumeTrue("Device does not support updating APEX",
mHostUtils.isApexUpdateSupported()); mHostUtils.isApexUpdateSupported());
final File apexFile = mTestUtils.getTestFile(SHIM_V2); final File apexFile = mHostUtils.getTestFile(SHIM_V2);
final String output = getDevice().executeAdbCommand("install", "--staged", final String output = getDevice().executeAdbCommand("install", "--staged",
apexFile.getAbsolutePath()); apexFile.getAbsolutePath());
assertThat(output).contains("Reboot device to apply staged session"); assertThat(output).contains("Reboot device to apply staged session");
@@ -135,7 +133,7 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test {
assumeTrue("Device does not support updating APEX", assumeTrue("Device does not support updating APEX",
mHostUtils.isApexUpdateSupported()); mHostUtils.isApexUpdateSupported());
final File apexFile = mTestUtils.getTestFile(SHIM_V2); final File apexFile = mHostUtils.getTestFile(SHIM_V2);
final String output = getDevice().executeAdbCommand("install", "--staged", final String output = getDevice().executeAdbCommand("install", "--staged",
"--staged-ready-timeout", "0", apexFile.getAbsolutePath()); "--staged-ready-timeout", "0", apexFile.getAbsolutePath());
assertThat(output).doesNotContain("Reboot device to apply staged session"); assertThat(output).doesNotContain("Reboot device to apply staged session");
@@ -151,7 +149,7 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test {
assumeTrue("Device does not support updating APEX", assumeTrue("Device does not support updating APEX",
mHostUtils.isApexUpdateSupported()); mHostUtils.isApexUpdateSupported());
final File apexFile = mTestUtils.getTestFile(SHIM_V2); final File apexFile = mHostUtils.getTestFile(SHIM_V2);
String output = getDevice().executeAdbCommand("install", "--staged", String output = getDevice().executeAdbCommand("install", "--staged",
"--enable-rollback", apexFile.getAbsolutePath()); "--enable-rollback", apexFile.getAbsolutePath());
assertThat(output).contains("Reboot device to apply staged session"); assertThat(output).contains("Reboot device to apply staged session");
@@ -168,8 +166,8 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test {
assumeTrue("Device does not support updating APEX", assumeTrue("Device does not support updating APEX",
mHostUtils.isApexUpdateSupported()); mHostUtils.isApexUpdateSupported());
final File apexFile = mTestUtils.getTestFile(SHIM_V2); final File apexFile = mHostUtils.getTestFile(SHIM_V2);
final File apkFile = mTestUtils.getTestFile(APK_A); final File apkFile = mHostUtils.getTestFile(APK_A);
final String output = getDevice().executeAdbCommand("install-multi-package", final String output = getDevice().executeAdbCommand("install-multi-package",
apexFile.getAbsolutePath(), apkFile.getAbsolutePath()); apexFile.getAbsolutePath(), apkFile.getAbsolutePath());
assertThat(output).contains("Created parent session"); assertThat(output).contains("Created parent session");