Merge "Install test app2 per test class for HostsideConnOnActivityStartTest" into main
This commit is contained in:
@@ -18,21 +18,24 @@ package com.android.cts.net;
|
||||
|
||||
import android.platform.test.annotations.FlakyTest;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import com.android.tradefed.device.DeviceNotAvailableException;
|
||||
import com.android.tradefed.invoker.TestInformation;
|
||||
import com.android.tradefed.testtype.junit4.AfterClassWithInfo;
|
||||
import com.android.tradefed.testtype.junit4.BeforeClassWithInfo;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class HostsideConnOnActivityStartTest extends HostsideNetworkTestCase {
|
||||
private static final String TEST_CLASS = TEST_PKG + ".ConnOnActivityStartTest";
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
uninstallPackage(TEST_APP2_PKG, false);
|
||||
installPackage(TEST_APP2_APK);
|
||||
@BeforeClassWithInfo
|
||||
public static void setUpOnce(TestInformation testInfo) throws Exception {
|
||||
uninstallPackage(testInfo, TEST_APP2_PKG, false);
|
||||
installPackage(testInfo, TEST_APP2_APK);
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
uninstallPackage(TEST_APP2_PKG, true);
|
||||
@AfterClassWithInfo
|
||||
public static void tearDownOnce(TestInformation testInfo) throws DeviceNotAvailableException {
|
||||
uninstallPackage(testInfo, TEST_APP2_PKG, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -46,7 +46,7 @@ abstract class HostsideNetworkTestCase extends BaseHostJUnit4Test {
|
||||
protected static final String TEST_APP2_APK = "CtsHostsideNetworkTestsApp2.apk";
|
||||
|
||||
@BeforeClassWithInfo
|
||||
public static void setUpOnce(TestInformation testInfo) throws Exception {
|
||||
public static void setUpOnceBase(TestInformation testInfo) throws Exception {
|
||||
DeviceSdkLevel deviceSdkLevel = new DeviceSdkLevel(testInfo.getDevice());
|
||||
String testApk = deviceSdkLevel.isDeviceAtLeastT() ? TEST_APK_NEXT : TEST_APK;
|
||||
|
||||
@@ -55,7 +55,8 @@ abstract class HostsideNetworkTestCase extends BaseHostJUnit4Test {
|
||||
}
|
||||
|
||||
@AfterClassWithInfo
|
||||
public static void tearDownOnce(TestInformation testInfo) throws DeviceNotAvailableException {
|
||||
public static void tearDownOnceBase(TestInformation testInfo)
|
||||
throws DeviceNotAvailableException {
|
||||
uninstallPackage(testInfo, TEST_PKG, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user