/tools/tradefederation/core/tests/src/com/android/tradefed/targetprep/ |
D | DeviceSetupTest.java | 48 private ITestDevice mMockDevice; field in DeviceSetupTest 62 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp() 64 EasyMock.expect(mMockDevice.getSerialNumber()).andReturn("foo").anyTimes(); in setUp() 65 EasyMock.expect(mMockDevice.getDeviceDescriptor()).andStubReturn(null); in setUp() 66 EasyMock.expect(mMockDevice.getIDevice()).andStubReturn(mMockIDevice); in setUp() 71 context.addAllocatedDevice("device", mMockDevice); in setUp() 90 EasyMock.replay(mMockDevice); in testSetup() 94 EasyMock.verify(mMockDevice); in testSetup() 113 EasyMock.replay(mMockDevice); in testSetup_airplane_mode_on() 118 EasyMock.verify(mMockDevice); in testSetup_airplane_mode_on() [all …]
|
D | GsiDeviceFlashPreparerTest.java | 57 private ITestDevice mMockDevice; field in GsiDeviceFlashPreparerTest 80 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp() 81 EasyMock.expect(mMockDevice.getSerialNumber()).andStubReturn("serial_1"); in setUp() 82 EasyMock.expect(mMockDevice.getDeviceDescriptor()).andStubReturn(mDeviceDescriptor); in setUp() 83 EasyMock.expect(mMockDevice.getOptions()).andReturn(new TestDeviceOptions()).anyTimes(); in setUp() 103 context.addAllocatedDevice("device", mMockDevice); in setUp() 122 mMockDevice.rebootUntilOnline(); in doSetupExpectations() 123 EasyMock.expect(mMockDevice.enableAdbRoot()).andStubReturn(Boolean.TRUE); in doSetupExpectations() 124 mMockDevice.setDate(null); in doSetupExpectations() 125 mMockDevice.waitForDeviceAvailable(EasyMock.anyLong()); in doSetupExpectations() [all …]
|
D | SwitchUserTargetPreparerTest.java | 46 @Mock private ITestDevice mMockDevice; field in SwitchUserTargetPreparerTest 64 when(mMockDevice.getCurrentUser()).thenReturn(11); in testSetUpRunAsPrimary_ifAlreadyInPrimary_noSwitch() 66 mMockDevice, in testSetUpRunAsPrimary_ifAlreadyInPrimary_noSwitch() 72 mSwitchUserTargetPreparer.setUp(mMockDevice, /* buildInfo= */ null); in testSetUpRunAsPrimary_ifAlreadyInPrimary_noSwitch() 75 verify(mMockDevice, never()).switchUser(anyInt()); in testSetUpRunAsPrimary_ifAlreadyInPrimary_noSwitch() 84 when(mMockDevice.getCurrentUser()).thenReturn(0); in testSetUpRunAsSystem_ifAlreadyInSystem_noSwitch() 86 mMockDevice, in testSetUpRunAsSystem_ifAlreadyInSystem_noSwitch() 91 mSwitchUserTargetPreparer.setUp(mMockDevice, /* buildInfo= */ null); in testSetUpRunAsSystem_ifAlreadyInSystem_noSwitch() 94 verify(mMockDevice, never()).switchUser(0); in testSetUpRunAsSystem_ifAlreadyInSystem_noSwitch() 103 when(mMockDevice.getCurrentUser()).thenReturn(11); in testSetUpRunAsPrimary_ifNotInPrimary_switchToPrimary() [all …]
|
D | DefaultTestsZipInstallerTest.java | 47 private ITestDevice mMockDevice; field in DefaultTestsZipInstallerTest 75 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp() 76 EasyMock.expect(mMockDevice.getSerialNumber()).andStubReturn(TEST_STRING); in setUp() 77 EasyMock.expect(mMockDevice.getProductType()).andStubReturn(TEST_STRING); in setUp() 78 EasyMock.expect(mMockDevice.getBuildId()).andStubReturn("1"); in setUp() 80 EasyMock.expect(mMockDevice.getDeviceDescriptor()).andStubReturn(null); in setUp() 104 EasyMock.expect(mMockDevice.getSerialNumber()).andStubReturn("serial_number_stub"); in testCantTouchFilesystem() 105 EasyMock.expect(mMockDevice.getRecoveryMode()).andReturn(RecoveryMode.AVAILABLE); in testCantTouchFilesystem() 106 EasyMock.expect(mMockDevice.executeShellCommand("stop")).andReturn(""); in testCantTouchFilesystem() 107 EasyMock.expect(mMockDevice.executeShellCommand("stop installd")).andReturn(""); in testCantTouchFilesystem() [all …]
|
D | InstallApexModuleTargetPreparerTest.java | 59 private ITestDevice mMockDevice; field in InstallApexModuleTargetPreparerTest 98 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp() 101 EasyMock.expect(mMockDevice.getSerialNumber()).andStubReturn(SERIAL); in setUp() 102 EasyMock.expect(mMockDevice.getDeviceDescriptor()).andStubReturn(null); in setUp() 103 EasyMock.expect(mMockDevice.checkApiLevelAgainstNextRelease(30)).andStubReturn(true); in setUp() 105 context.addAllocatedDevice("device", mMockDevice); in setUp() 220 mMockDevice.deleteFile(APEX_DATA_DIR + "*"); in testSetupSuccess_removeExistingStagedApexSuccess() 222 mMockDevice.deleteFile(SESSION_DATA_DIR + "*"); in testSetupSuccess_removeExistingStagedApexSuccess() 224 mMockDevice.deleteFile(STAGING_DATA_DIR + "*"); in testSetupSuccess_removeExistingStagedApexSuccess() 228 EasyMock.expect(mMockDevice.executeShellV2Command("ls " + APEX_DATA_DIR)).andReturn(res); in testSetupSuccess_removeExistingStagedApexSuccess() [all …]
|
D | RootTargetPreparerTest.java | 37 private ITestDevice mMockDevice; field in RootTargetPreparerTest 45 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp() 47 EasyMock.expect(mMockDevice.getIDevice()).andStubReturn(mMockIDevice); in setUp() 50 context.addAllocatedDevice("device", mMockDevice); in setUp() 57 EasyMock.expect(mMockDevice.isAdbRoot()).andReturn(true).once(); in testSetUpSuccess_rootBefore() 58 EasyMock.replay(mMockDevice, mMockBuildInfo); in testSetUpSuccess_rootBefore() 62 EasyMock.verify(mMockDevice, mMockBuildInfo); in testSetUpSuccess_rootBefore() 67 EasyMock.expect(mMockDevice.isAdbRoot()).andReturn(false).once(); in testSetUpSuccess_notRootBefore() 68 EasyMock.expect(mMockDevice.enableAdbRoot()).andReturn(true).once(); in testSetUpSuccess_notRootBefore() 69 EasyMock.expect(mMockDevice.disableAdbRoot()).andReturn(true).once(); in testSetUpSuccess_notRootBefore() [all …]
|
D | FastbootDeviceFlasherTest.java | 54 private ITestDevice mMockDevice; field in FastbootDeviceFlasherTest 62 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp() 63 EasyMock.expect(mMockDevice.getSerialNumber()).andStubReturn(TEST_STRING); in setUp() 64 EasyMock.expect(mMockDevice.getProductType()).andStubReturn(TEST_STRING); in setUp() 65 EasyMock.expect(mMockDevice.getBuildId()).andStubReturn("1"); in setUp() 66 EasyMock.expect(mMockDevice.getBuildFlavor()).andStubReturn("test-debug"); in setUp() 67 EasyMock.expect(mMockDevice.getDeviceDescriptor()).andStubReturn(null); in setUp() 97 mMockDevice.rebootIntoBootloader(); in testFlash_deviceNotAvailable() 99 mMockDevice.executeFastbootCommand((String)EasyMock.anyObject(), in testFlash_deviceNotAvailable() 102 EasyMock.replay(mMockDevice); in testFlash_deviceNotAvailable() [all …]
|
D | RestartSystemServerTargetPreparerTest.java | 34 private ITestDevice mMockDevice; field in RestartSystemServerTargetPreparerTest 39 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp() 46 EasyMock.expect(mMockDevice.enableAdbRoot()).andReturn(true).once(); in testSetUp_bootComplete() 47 EasyMock.expect(mMockDevice.executeShellCommand("setprop dev.bootcomplete 0")) in testSetUp_bootComplete() 50 mMockDevice.executeShellCommand( in testSetUp_bootComplete() 54 mMockDevice.waitForDeviceAvailable(); in testSetUp_bootComplete() 56 EasyMock.replay(mMockDevice, mMockBuildInfo); in testSetUp_bootComplete() 58 mRestartSystemServerTargetPreparer.setUp(mMockDevice, mMockBuildInfo); in testSetUp_bootComplete() 59 EasyMock.verify(mMockDevice, mMockBuildInfo); in testSetUp_bootComplete() 64 EasyMock.expect(mMockDevice.enableAdbRoot()).andReturn(true).once(); in testSetUp_bootNotComplete() [all …]
|
D | DisableSELinuxTargetPreparerTest.java | 37 private ITestDevice mMockDevice; field in DisableSELinuxTargetPreparerTest 48 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp() 51 context.addAllocatedDevice("device", mMockDevice); in setUp() 61 EasyMock.expect(mMockDevice.executeShellV2Command(GETENFORCE)).andReturn(result).once(); in testSetUpSuccess_permissive() 62 EasyMock.replay(mMockDevice, mMockBuildInfo); in testSetUpSuccess_permissive() 66 EasyMock.verify(mMockDevice, mMockBuildInfo); in testSetUpSuccess_permissive() 74 EasyMock.expect(mMockDevice.executeShellV2Command(GETENFORCE)).andReturn(result).once(); in testSetUpSuccess_enforced_rootBefore() 75 EasyMock.expect(mMockDevice.isAdbRoot()).andReturn(true).once(); in testSetUpSuccess_enforced_rootBefore() 76 EasyMock.expect(mMockDevice.executeShellV2Command(SETENFORCE + "0")) in testSetUpSuccess_enforced_rootBefore() 79 EasyMock.expect(mMockDevice.executeShellV2Command(SETENFORCE + "1")) in testSetUpSuccess_enforced_rootBefore() [all …]
|
D | StopServicesSetupTest.java | 35 private ITestDevice mMockDevice = null; field in StopServicesSetupTest 44 mMockDevice = EasyMock.createStrictMock(ITestDevice.class); in setUp() 47 context.addAllocatedDevice("device", mMockDevice); in setUp() 55 EasyMock.expect(mMockDevice.executeShellCommand("stop")).andReturn(null); in testNoop() 57 EasyMock.replay(mMockDevice); in testNoop() 59 EasyMock.verify(mMockDevice); in testNoop() 68 EasyMock.replay(mMockDevice); in testNoStopFramework() 70 EasyMock.verify(mMockDevice); in testNoStopFramework() 80 EasyMock.expect(mMockDevice.executeShellCommand("stop")).andReturn(null); in testStopServices() 81 EasyMock.expect(mMockDevice.executeShellCommand("stop service1")).andReturn(null); in testStopServices() [all …]
|
D | DeviceFlashPreparerTest.java | 59 private ITestDevice mMockDevice; field in DeviceFlashPreparerTest 70 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp() 71 EasyMock.expect(mMockDevice.getSerialNumber()).andReturn("foo").anyTimes(); in setUp() 72 EasyMock.expect(mMockDevice.getOptions()).andReturn(new TestDeviceOptions()).anyTimes(); in setUp() 112 context.addAllocatedDevice("device", mMockDevice); in setUp() 130 EasyMock.replay(mMockFlasher, mMockDevice); in testSetup() 132 EasyMock.verify(mMockFlasher, mMockDevice); in testSetup() 140 mMockDevice.setRecoveryMode(RecoveryMode.ONLINE); in doSetupExpectations() 141 mMockFlasher.overrideDeviceOptions(mMockDevice); in doSetupExpectations() 144 mMockFlasher.flash(mMockDevice, mMockBuildInfo); in doSetupExpectations() [all …]
|
/tools/tradefederation/core/tests/src/com/android/tradefed/util/ |
D | JavaCodeCoverageFlusherTest.java | 54 @Mock ITestDevice mMockDevice; field in JavaCodeCoverageFlusherTest 66 mFlusher = new JavaCodeCoverageFlusher(mMockDevice, ImmutableList.of()); in testResetAll_calledForAllProcesses() 68 doReturn(PS_OUTPUT).when(mMockDevice).executeShellCommand("ps -e"); in testResetAll_calledForAllProcesses() 70 .when(mMockDevice) in testResetAll_calledForAllProcesses() 72 doReturn("123").when(mMockDevice).getProcessPid("com.android.bluetooth"); in testResetAll_calledForAllProcesses() 73 doReturn("4567").when(mMockDevice).getProcessPid("com.google.android.gms.persistent"); in testResetAll_calledForAllProcesses() 74 doReturn("890").when(mMockDevice).getProcessPid("com.android.phone"); in testResetAll_calledForAllProcesses() 78 verify(mMockDevice) in testResetAll_calledForAllProcesses() 82 verify(mMockDevice) in testResetAll_calledForAllProcesses() 86 verify(mMockDevice) in testResetAll_calledForAllProcesses() [all …]
|
D | AppVersionFetcherTest.java | 38 private ITestDevice mMockDevice; field in AppVersionFetcherTest 42 mMockDevice = EasyMock.createMock(ITestDevice.class); in setup() 47 EasyMock.expect(mMockDevice.executeShellCommand(VERSION_CODE_CMD)) in testFetchVersionCode_valid() 49 EasyMock.replay(mMockDevice); in testFetchVersionCode_valid() 52 AppVersionFetcher.fetch(mMockDevice, PACKAGE_NAME, AppVersionInfo.VERSION_CODE)); in testFetchVersionCode_valid() 53 EasyMock.verify(mMockDevice); in testFetchVersionCode_valid() 58 EasyMock.expect(mMockDevice.executeShellCommand(VERSION_NAME_CMD)) in testFetchVersionName_valid() 60 EasyMock.replay(mMockDevice); in testFetchVersionName_valid() 63 AppVersionFetcher.fetch(mMockDevice, PACKAGE_NAME, AppVersionInfo.VERSION_NAME)); in testFetchVersionName_valid() 64 EasyMock.verify(mMockDevice); in testFetchVersionName_valid() [all …]
|
D | NativeCodeCoverageFlusherTest.java | 42 @Mock ITestDevice mMockDevice; field in NativeCodeCoverageFlusherTest 54 doReturn(true).when(mMockDevice).isAdbRoot(); in testClearCoverageMeasurements_rmCommandCalled() 56 mFlusher = new NativeCodeCoverageFlusher(mMockDevice, ImmutableList.of()); in testClearCoverageMeasurements_rmCommandCalled() 60 verify(mMockDevice).executeShellCommand("rm -rf /data/misc/trace/*"); in testClearCoverageMeasurements_rmCommandCalled() 65 doReturn(false).when(mMockDevice).isAdbRoot(); in testNoAdbRootClearCoverageMeasurements_noOp() 68 mFlusher = new NativeCodeCoverageFlusher(mMockDevice, ImmutableList.of()); in testNoAdbRootClearCoverageMeasurements_noOp() 76 verify(mMockDevice, never()).executeShellCommand(anyString()); in testNoAdbRootClearCoverageMeasurements_noOp() 82 doReturn(true).when(mMockDevice).isAdbRoot(); in testFlushCoverageAllProcesses_flushAllCommandCalled() 84 mFlusher = new NativeCodeCoverageFlusher(mMockDevice, ImmutableList.of()); in testFlushCoverageAllProcesses_flushAllCommandCalled() 88 verify(mMockDevice).executeShellCommand("kill -37 -1"); in testFlushCoverageAllProcesses_flushAllCommandCalled() [all …]
|
/tools/tradefederation/core/tests/src/com/android/tradefed/suite/checker/ |
D | SystemServerFileDescriptorCheckerTest.java | 35 private ITestDevice mMockDevice; field in SystemServerFileDescriptorCheckerTest 39 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp() 45 EasyMock.expect(mMockDevice.getProperty(EasyMock.eq("ro.build.type"))) in testFailToGetPid() 47 EasyMock.expect(mMockDevice.executeShellCommand(EasyMock.eq("pidof system_server"))) in testFailToGetPid() 49 EasyMock.replay(mMockDevice); in testFailToGetPid() 50 assertEquals(CheckStatus.SUCCESS, mChecker.preExecutionCheck(mMockDevice).getStatus()); in testFailToGetPid() 51 assertEquals(CheckStatus.SUCCESS, mChecker.postExecutionCheck(mMockDevice).getStatus()); in testFailToGetPid() 52 EasyMock.verify(mMockDevice); in testFailToGetPid() 57 EasyMock.expect(mMockDevice.getProperty(EasyMock.eq("ro.build.type"))) in testFailToGetFdCount() 59 EasyMock.expect(mMockDevice.executeShellCommand(EasyMock.eq("pidof system_server"))) in testFailToGetFdCount() [all …]
|
D | SystemServerStatusCheckerTest.java | 38 private ITestDevice mMockDevice; field in SystemServerStatusCheckerTest 42 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp() 43 EasyMock.expect(mMockDevice.getSerialNumber()).andStubReturn("SERIAL"); in setUp() 44 EasyMock.expect(mMockDevice.getApiLevel()).andStubReturn(29); in setUp() 57 EasyMock.expect(mMockDevice.getProcessByName(EasyMock.eq("system_server"))) in testSystemServerProcessNotRestarted() 59 EasyMock.expect(mMockDevice.deviceSoftRestarted(EasyMock.anyObject())).andReturn(false); in testSystemServerProcessNotRestarted() 60 EasyMock.replay(mMockDevice); in testSystemServerProcessNotRestarted() 61 assertEquals(CheckStatus.SUCCESS, mChecker.preExecutionCheck(mMockDevice).getStatus()); in testSystemServerProcessNotRestarted() 62 assertEquals(CheckStatus.SUCCESS, mChecker.postExecutionCheck(mMockDevice).getStatus()); in testSystemServerProcessNotRestarted() 63 EasyMock.verify(mMockDevice); in testSystemServerProcessNotRestarted() [all …]
|
D | DeviceSettingCheckerTest.java | 38 private ITestDevice mMockDevice; field in DeviceSettingCheckerTest 43 mMockDevice = EasyMock.createMock(ITestDevice.class); in setup() 58 EasyMock.expect(mMockDevice.getAllSettings(EasyMock.eq("global"))) in testSettingsUnchanged() 61 EasyMock.expect(mMockDevice.getAllSettings(EasyMock.eq("secure"))) in testSettingsUnchanged() 64 EasyMock.expect(mMockDevice.getAllSettings(EasyMock.eq("system"))) in testSettingsUnchanged() 67 EasyMock.replay(mMockDevice); in testSettingsUnchanged() 68 assertEquals(CheckStatus.SUCCESS, mChecker.preExecutionCheck(mMockDevice).getStatus()); in testSettingsUnchanged() 69 assertEquals(CheckStatus.SUCCESS, mChecker.postExecutionCheck(mMockDevice).getStatus()); in testSettingsUnchanged() 70 EasyMock.verify(mMockDevice); in testSettingsUnchanged() 83 EasyMock.expect(mMockDevice.getAllSettings(EasyMock.eq("global"))).andReturn(mapPreGlobal); in testSettingsChanged() [all …]
|
D | DeviceStorageStatusCheckerTest.java | 35 private ITestDevice mMockDevice; field in DeviceStorageStatusCheckerTest 40 mMockDevice = EasyMock.createMock(ITestDevice.class); in setup() 50 EasyMock.expect(mMockDevice.getPartitionFreeSpace(EasyMock.eq("/data"))) in testEnoughDeviceStorage() 52 EasyMock.expect(mMockDevice.getPartitionFreeSpace(EasyMock.eq("/data2"))) in testEnoughDeviceStorage() 54 EasyMock.replay(mMockDevice); in testEnoughDeviceStorage() 55 assertEquals(CheckStatus.SUCCESS, mChecker.preExecutionCheck(mMockDevice).getStatus()); in testEnoughDeviceStorage() 56 EasyMock.verify(mMockDevice); in testEnoughDeviceStorage() 62 EasyMock.expect(mMockDevice.getPartitionFreeSpace(EasyMock.eq("/data"))) in testInEnoughDeviceStorageOn1Partition() 64 EasyMock.expect(mMockDevice.getPartitionFreeSpace(EasyMock.eq("/data2"))) in testInEnoughDeviceStorageOn1Partition() 66 EasyMock.replay(mMockDevice); in testInEnoughDeviceStorageOn1Partition() [all …]
|
/tools/tradefederation/core/tests/src/com/android/tradefed/device/ |
D | DeviceSelectionOptionsTest.java | 45 private IDevice mMockDevice; field in DeviceSelectionOptionsTest 81 mMockDevice = EasyMock.createMock(IDevice.class); in setUp() 82 EasyMock.expect(mMockDevice.getSerialNumber()).andStubReturn(DEVICE_SERIAL); in setUp() 83 EasyMock.expect(mMockDevice.isEmulator()).andStubReturn(Boolean.FALSE); in setUp() 94 assertEquals(1, options.getSerials(mMockDevice).size()); in testGetSerials() 95 assertTrue(options.getSerials(mMockDevice).contains(DEVICE_ENV_SERIAL)); in testGetSerials() 96 assertFalse(options.getSerials(mMockDevice).contains(DEVICE_SERIAL)); in testGetSerials() 139 assertEquals(1, options.getSerials(mMockDevice).size()); in testGetSerialsDoesNotOverride() 140 assertFalse(options.getSerials(mMockDevice).contains(DEVICE_ENV_SERIAL)); in testGetSerialsDoesNotOverride() 141 assertTrue(options.getSerials(mMockDevice).contains(DEVICE_SERIAL)); in testGetSerialsDoesNotOverride() [all …]
|
D | WifiHelperTest.java | 36 private ITestDevice mMockDevice; field in WifiHelperTest 40 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp() 41 EasyMock.expect(mMockDevice.executeShellCommand(WifiHelper.CHECK_PACKAGE_CMD)) in setUp() 93 MockTestDeviceHelper.injectShellResponse(mMockDevice, null, 5, TimeUnit.MINUTES, 0, "", in testWaitForIp_failThenPass() 95 MockTestDeviceHelper.injectShellResponse(mMockDevice, null, 5, TimeUnit.MINUTES, 0, in testWaitForIp_failThenPass() 97 EasyMock.replay(mMockDevice); in testWaitForIp_failThenPass() 98 WifiHelper wifiHelper = new WifiHelper(mMockDevice) { in testWaitForIp_failThenPass() 106 EasyMock.verify(mMockDevice); in testWaitForIp_failThenPass() 115 MockTestDeviceHelper.injectShellResponse(mMockDevice, expectedCommand, 5, TimeUnit.MINUTES, in testStartMonitor() 117 EasyMock.replay(mMockDevice); in testStartMonitor() [all …]
|
D | DeviceStateMonitorTest.java | 43 private IDevice mMockDevice; field in DeviceStateMonitorTest 52 mMockDevice = EasyMock.createMock(IDevice.class); in setUp() 53 EasyMock.expect(mMockDevice.getState()).andReturn(DeviceState.ONLINE); in setUp() 54 EasyMock.expect(mMockDevice.getSerialNumber()).andReturn(SERIAL_NUMBER).anyTimes(); in setUp() 55 EasyMock.replay(mMockDevice); in setUp() 56 mMonitor = new DeviceStateMonitor(mMockMgr, mMockDevice, true); in setUp() 63 assertEquals(mMockDevice, mMonitor.waitForDeviceOnline()); in testWaitForDeviceOnline_alreadyOnline() 81 assertEquals(mMockDevice, mMonitor.waitForDeviceOnline()); in testWaitForDeviceOnline() 161 mMockDevice = EasyMock.createMock(IDevice.class); in testWaitForShellAvailable() 162 EasyMock.expect(mMockDevice.getState()).andReturn(DeviceState.ONLINE); in testWaitForShellAvailable() [all …]
|
/tools/tradefederation/core/tests/src/com/android/tradefed/util/sl4a/ |
D | Sl4aClientTest.java | 42 private ITestDevice mMockDevice; field in Sl4aClientTest 47 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp() 50 mClient = new Sl4aClient(mMockDevice, mDeviceServer.getPort(), mDeviceServer.getPort()) { in setUp() 74 EasyMock.expect(mMockDevice.executeShellCommand(Sl4aClient.IS_SL4A_RUNNING_CMD)) in testIsSl4ARunning() 77 EasyMock.expect(mMockDevice.executeShellCommand(Sl4aClient.IS_SL4A_RUNNING_CMD_OLD)) in testIsSl4ARunning() 81 EasyMock.replay(mMockDevice); in testIsSl4ARunning() 83 EasyMock.verify(mMockDevice); in testIsSl4ARunning() 91 EasyMock.expect(mMockDevice.executeShellCommand(Sl4aClient.IS_SL4A_RUNNING_CMD)) in testIsSl4ARunning_notRunning() 93 EasyMock.expect(mMockDevice.executeShellCommand(Sl4aClient.IS_SL4A_RUNNING_CMD_OLD)) in testIsSl4ARunning_notRunning() 95 EasyMock.replay(mMockDevice); in testIsSl4ARunning_notRunning() [all …]
|
/tools/tradefederation/core/tests/src/com/android/tradefed/testtype/suite/module/ |
D | NativeBridgeModuleControllerTest.java | 40 private ITestDevice mMockDevice; field in NativeBridgeModuleControllerTest 46 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp() 48 mContext.addAllocatedDevice(ConfigurationDef.DEFAULT_DEVICE_NAME, mMockDevice); in setUp() 57 EasyMock.expect(mMockDevice.getIDevice()).andReturn(new StubDevice("serial")); in testStubDevice() 58 EasyMock.replay(mMockDevice); in testStubDevice() 60 EasyMock.verify(mMockDevice); in testStubDevice() 66 EasyMock.expect(mMockDevice.getIDevice()).andReturn(mMockIDevice); in testNoBridgeSupport() 67 EasyMock.expect(mMockDevice.getProperty(NativeBridgeModuleController.NATIVE_BRIDGE_PROP)) in testNoBridgeSupport() 69 EasyMock.replay(mMockDevice, mMockIDevice); in testNoBridgeSupport() 71 EasyMock.verify(mMockDevice, mMockIDevice); in testNoBridgeSupport() [all …]
|
/tools/tradefederation/core/tests/src/com/android/tradefed/device/recovery/ |
D | BatteryUnavailableDeviceRecoveryTest.java | 34 private IManagedTestDevice mMockDevice; field in BatteryUnavailableDeviceRecoveryTest 40 mMockDevice = EasyMock.createMock(IManagedTestDevice.class); in setUp() 42 EasyMock.expect(mMockDevice.getIDevice()).andStubReturn(mMockIDevice); in setUp() 47 EasyMock.expect(mMockDevice.isStateBootloaderOrFastbootd()).andReturn(false); in testShouldSkip() 48 EasyMock.expect(mMockDevice.getBattery()).andReturn(50); in testShouldSkip() 49 EasyMock.replay(mMockDevice); in testShouldSkip() 50 assertTrue(mRecoverer.shouldSkip(mMockDevice)); in testShouldSkip() 51 EasyMock.verify(mMockDevice); in testShouldSkip() 56 EasyMock.expect(mMockDevice.isStateBootloaderOrFastbootd()).andReturn(true); in testShouldSkip_fastboot() 57 EasyMock.replay(mMockDevice); in testShouldSkip_fastboot() [all …]
|
/tools/tradefederation/core/tests/src/com/android/tradefed/build/ |
D | BootstrapBuildProviderTest.java | 38 private ITestDevice mMockDevice; field in BootstrapBuildProviderTest 49 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp() 54 EasyMock.expect(mMockDevice.getBuildId()).andReturn("5"); in testGetBuild() 55 EasyMock.expect(mMockDevice.getIDevice()).andReturn(EasyMock.createMock(IDevice.class)); in testGetBuild() 56 EasyMock.expect(mMockDevice.waitForDeviceShell(EasyMock.anyLong())).andReturn(true); in testGetBuild() 57 EasyMock.expect(mMockDevice.getProperty(EasyMock.anyObject())).andStubReturn("property"); in testGetBuild() 58 EasyMock.expect(mMockDevice.getProductVariant()).andStubReturn("variant"); in testGetBuild() 59 EasyMock.expect(mMockDevice.getBuildFlavor()).andStubReturn("flavor"); in testGetBuild() 60 EasyMock.expect(mMockDevice.getBuildAlias()).andStubReturn("alias"); in testGetBuild() 61 EasyMock.replay(mMockDevice); in testGetBuild() [all …]
|