Home
last modified time | relevance | path

Searched refs:mockDevice (Results 1 – 16 of 16) sorted by relevance

/tools/tradefederation/core/tests/src/com/android/tradefed/device/
DManagedDeviceListTest.java117 IManagedTestDevice mockDevice = EasyMock.createMock(IManagedTestDevice.class); in testUpdateFastbootState() local
118 EasyMock.expect(mockDevice.getSerialNumber()).andReturn("serial1"); in testUpdateFastbootState()
119 mockDevice.setDeviceState(TestDeviceState.FASTBOOT); in testUpdateFastbootState()
121 mManagedDeviceList.add(mockDevice); in testUpdateFastbootState()
123 EasyMock.replay(mockDevice); in testUpdateFastbootState()
127 EasyMock.verify(mockDevice); in testUpdateFastbootState()
137 IManagedTestDevice mockDevice = EasyMock.createMock(IManagedTestDevice.class); in testUpdateFastbootState_gone() local
138 EasyMock.expect(mockDevice.getSerialNumber()).andStubReturn("serial1"); in testUpdateFastbootState_gone()
139 EasyMock.expect(mockDevice.getDeviceState()).andReturn(TestDeviceState.FASTBOOT); in testUpdateFastbootState_gone()
140 mockDevice.setDeviceState(TestDeviceState.NOT_AVAILABLE); in testUpdateFastbootState_gone()
[all …]
DMockDeviceManager.java66 ITestDevice mockDevice = EasyMock.createNiceMock(ITestDevice.class); in setNumDevicesInternal() local
67 EasyMock.expect(mockDevice.getSerialNumber()).andReturn("serial" + i).anyTimes(); in setNumDevicesInternal()
70 EasyMock.expect(mockDevice.getIDevice()).andReturn(mockIDevice).anyTimes(); in setNumDevicesInternal()
71 EasyMock.expect(mockDevice.getDeviceState()).andReturn( in setNumDevicesInternal()
73 EasyMock.expect(mockDevice.waitForDeviceShell(EasyMock.anyLong())) in setNumDevicesInternal()
75 EasyMock.replay(mockDevice, mockIDevice); in setNumDevicesInternal()
76 mAvailableDeviceQueue.add(mockDevice); in setNumDevicesInternal()
92 ITestDevice mockDevice = new TestDevice(mockIDevice, stateMonitor, allocationMonitor) { in setNumDevicesCustomRealNoRecovery() local
98 mockDevice.setRecoveryMode(RecoveryMode.NONE); in setNumDevicesCustomRealNoRecovery()
99 mAvailableDeviceQueue.add(mockDevice); in setNumDevicesCustomRealNoRecovery()
[all …]
DMockTestDeviceHelper.java39 static void injectShellResponse(ITestDevice mockDevice, final String expectedCommand, in injectShellResponse() argument
53 mockDevice.executeShellCommand(EasyMock.eq(expectedCommand), in injectShellResponse()
56 mockDevice.executeShellCommand(EasyMock.<String>anyObject(), in injectShellResponse()
82 static void injectShellResponse(ITestDevice mockDevice, final String expectedCommand, in injectShellResponse() argument
98 mockDevice.executeShellCommand(EasyMock.eq(expectedCommand), in injectShellResponse()
102 mockDevice.executeShellCommand(EasyMock.<String> anyObject(), in injectShellResponse()
DMockDeviceHelper.java38 IDevice mockDevice, final String expectedCommand, final String response, boolean asStub) in injectShellResponse() argument
53 mockDevice.executeShellCommand( in injectShellResponse()
56 mockDevice.executeShellCommand( in injectShellResponse()
DMockFileUtil.java38 public static void setMockDirContents(ITestDevice mockDevice, String rootPath, in setMockDirContents() argument
41 EasyMock.expect(mockDevice.getFileEntry(rootPath)).andStubReturn(rootEntry); in setMockDirContents()
70 public static void setMockDirPath(ITestDevice mockDevice, String rootPath, in setMockDirPath() argument
73 EasyMock.expect(mockDevice.getFileEntry(rootPath)).andStubReturn(rootEntry); in setMockDirPath()
DDeviceStateMonitorTest.java96 IDevice mockDevice = EasyMock.createMock(IDevice.class); in testIsAdbTcp_usb() local
97 EasyMock.expect(mockDevice.getSerialNumber()).andStubReturn("2345asdf"); in testIsAdbTcp_usb()
98 EasyMock.expect(mockDevice.getState()).andReturn(DeviceState.ONLINE); in testIsAdbTcp_usb()
99 EasyMock.replay(mockDevice); in testIsAdbTcp_usb()
100 DeviceStateMonitor monitor = new DeviceStateMonitor(mMockMgr, mockDevice, true); in testIsAdbTcp_usb()
108 IDevice mockDevice = EasyMock.createMock(IDevice.class); in testIsAdbTcp_tcp() local
109 EasyMock.expect(mockDevice.getSerialNumber()).andStubReturn("192.168.1.1:5555"); in testIsAdbTcp_tcp()
110 EasyMock.expect(mockDevice.getState()).andReturn(DeviceState.ONLINE); in testIsAdbTcp_tcp()
111 EasyMock.replay(mockDevice); in testIsAdbTcp_tcp()
112 DeviceStateMonitor monitor = new DeviceStateMonitor(mMockMgr, mockDevice, true); in testIsAdbTcp_tcp()
/tools/tradefederation/core/prod-tests/tests/src/com/android/monkey/
DMonkeyBaseTest.java66 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testUptime() local
67 monkey.setDevice(mockDevice); in testUptime()
68 EasyMock.expect(mockDevice.executeShellCommand("cat /proc/uptime")).andReturn( in testUptime()
70 EasyMock.replay(mockDevice); in testUptime()
79 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testUptime_fail() local
80 monkey.setDevice(mockDevice); in testUptime_fail()
81 EasyMock.expect(mockDevice.getSerialNumber()).andStubReturn("serial"); in testUptime_fail()
82 EasyMock.expect(mockDevice.executeShellCommand("cat /proc/uptime")).andReturn( in testUptime_fail()
84 EasyMock.expect(mockDevice.executeShellCommand("cat /proc/uptime")).andReturn( in testUptime_fail()
86 EasyMock.replay(mockDevice); in testUptime_fail()
/tools/tradefederation/core/tests/src/com/android/tradefed/testtype/
DGTestTest.java331 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testFileExclusionRegexFilter_emptyfilters() local
332 EasyMock.expect(mockDevice.executeShellCommand("ls -l /test_file")) in testFileExclusionRegexFilter_emptyfilters()
334 EasyMock.replay(mockDevice); in testFileExclusionRegexFilter_emptyfilters()
335 mGTest.setDevice(mockDevice); in testFileExclusionRegexFilter_emptyfilters()
337 EasyMock.verify(mockDevice); in testFileExclusionRegexFilter_emptyfilters()
351 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testFileExclusionRegexFilter_skipMatched() local
352 EasyMock.expect(mockDevice.executeShellCommand("ls -l /some/path/file/run_me")) in testFileExclusionRegexFilter_skipMatched()
354 EasyMock.expect(mockDevice.executeShellCommand("ls -l /some/path/file/run_me2")) in testFileExclusionRegexFilter_skipMatched()
356 EasyMock.expect(mockDevice.executeShellCommand("ls -l /some/path/file/run_me.not")) in testFileExclusionRegexFilter_skipMatched()
358 EasyMock.replay(mockDevice); in testFileExclusionRegexFilter_skipMatched()
[all …]
DCodeCoverageTestBaseTest.java418 ITestDevice mockDevice = coverageTest.getDevice();
419 doReturn(false).doReturn(true).when(mockDevice).doesFileExist(anyString());
/tools/tradefederation/core/tests/src/com/android/tradefed/util/
DSimplePerfUtilTest.java36 private ITestDevice mockDevice = null; field in SimplePerfUtilTest
41 mockDevice = EasyMock.createMock(ITestDevice.class); in setUp()
45 spu = SimplePerfUtil.newInstance(mockDevice, SimplePerfType.STAT); in testCommandStringPreparerWithoutParams()
52 spu = SimplePerfUtil.newInstance(mockDevice, SimplePerfType.RECORD); in testCommandStringPreparerWithParams()
66 spu = SimplePerfUtil.newInstance(mockDevice, SimplePerfType.LIST); in testCommandStringPreparerWithNullCommand()
/tools/tradefederation/core/tests/src/com/android/tradefed/command/
DCommandSchedulerFuncTest.java259 ITestDevice mockDevice = EasyMock.createNiceMock(ITestDevice.class); in testBatteryLowLevel() local
260 EasyMock.expect(mockDevice.getSerialNumber()).andReturn("serial").anyTimes(); in testBatteryLowLevel()
262 EasyMock.expect(mockDevice.getIDevice()).andReturn(mockIDevice).anyTimes(); in testBatteryLowLevel()
263 EasyMock.expect(mockDevice.getDeviceState()).andReturn( in testBatteryLowLevel()
272 EasyMock.replay(mockDevice); in testBatteryLowLevel()
274 mMockDeviceManager.addDevice(mockDevice); in testBatteryLowLevel()
301 ITestDevice mockDevice = EasyMock.createNiceMock(ITestDevice.class); in testBatteryLowLevel_interruptible() local
302 EasyMock.expect(mockDevice.getSerialNumber()).andReturn("serial").anyTimes(); in testBatteryLowLevel_interruptible()
312 EasyMock.expect(mockDevice.getIDevice()).andReturn(mockIDevice).anyTimes(); in testBatteryLowLevel_interruptible()
313 EasyMock.expect(mockDevice.getDeviceState()).andReturn( in testBatteryLowLevel_interruptible()
[all …]
DCommandSchedulerTest.java341 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testExecCommand() local
342 EasyMock.expect(mockDevice.getSerialNumber()).andStubReturn("serial"); in testExecCommand()
343 EasyMock.expect(mockDevice.getDeviceState()).andStubReturn(TestDeviceState.ONLINE); in testExecCommand()
344 mockDevice.setRecoveryMode(EasyMock.eq(RecoveryMode.AVAILABLE)); in testExecCommand()
345 EasyMock.expect(mockDevice.getIDevice()).andStubReturn(mockIDevice); in testExecCommand()
351 EasyMock.expect(mockDevice.waitForDeviceShell(EasyMock.anyLong())).andReturn(true); in testExecCommand()
352 replayMocks(mockDevice, mockListener); in testExecCommand()
354 mScheduler.execCommand(mockListener, mockDevice, args); in testExecCommand()
1129 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testExecCommand_versioning() local
1130 EasyMock.expect(mockDevice.getSerialNumber()).andStubReturn("serial"); in testExecCommand_versioning()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/targetprep/
DFastbootDeviceFlasherTest.java221 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testFlashBaseband_noVersion() local
223 setFastbootResponseExpectations(mockDevice, "version-baseband: \n"); in testFlashBaseband_noVersion()
224 setFastbootResponseExpectations(mockDevice, "version-baseband: \n"); in testFlashBaseband_noVersion()
226 setFastbootFlashExpectations(mockDevice, "radio"); in testFlashBaseband_noVersion()
227 mockDevice.rebootIntoBootloader(); in testFlashBaseband_noVersion()
228 EasyMock.replay(mockDevice, mMockRunUtil); in testFlashBaseband_noVersion()
235 flasher.checkAndFlashBaseband(mockDevice, build); in testFlashBaseband_noVersion()
236 EasyMock.verify(mockDevice, mMockRunUtil); in testFlashBaseband_noVersion()
645 private static void setFastbootResponseExpectations(ITestDevice mockDevice, String response) in setFastbootResponseExpectations() argument
652 mockDevice.executeFastbootCommand((String)EasyMock.anyObject(), in setFastbootResponseExpectations()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/testtype/suite/
DBaseTestSuiteTest.java239 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testLoadTestsForMultiAbi() local
240 mRunner.setDevice(mockDevice); in testLoadTestsForMultiAbi()
244 EasyMock.replay(mockDevice); in testLoadTestsForMultiAbi()
249 EasyMock.verify(mockDevice); in testLoadTestsForMultiAbi()
DTestMappingSuiteRunnerTest.java200 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testLoadTestsForMultiAbi() local
201 mRunner.setDevice(mockDevice); in testLoadTestsForMultiAbi()
202 EasyMock.replay(mockDevice); in testLoadTestsForMultiAbi()
209 EasyMock.verify(mockDevice); in testLoadTestsForMultiAbi()
DTfSuiteRunnerTest.java281 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testLoadTestsForMultiAbi() local
282 mRunner.setDevice(mockDevice); in testLoadTestsForMultiAbi()
286 EasyMock.replay(mockDevice); in testLoadTestsForMultiAbi()
291 EasyMock.verify(mockDevice); in testLoadTestsForMultiAbi()