Home
last modified time | relevance | path

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

/tools/tradefederation/core/tests/src/com/android/tradefed/testtype/suite/
DBaseTestSuiteTest.java396 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testLoadTestsForMultiAbi() local
397 mRunner.setDevice(mockDevice); in testLoadTestsForMultiAbi()
401 EasyMock.replay(mockDevice); in testLoadTestsForMultiAbi()
406 EasyMock.verify(mockDevice); in testLoadTestsForMultiAbi()
415 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testLoadTests_parameterizedModule() local
416 mRunner.setDevice(mockDevice); in testLoadTests_parameterizedModule()
425 EasyMock.replay(mockDevice); in testLoadTests_parameterizedModule()
432 EasyMock.verify(mockDevice); in testLoadTests_parameterizedModule()
457 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testLoadTests_parameterizedModule_load_with_filter() local
458 mRunner.setDevice(mockDevice); in testLoadTests_parameterizedModule_load_with_filter()
[all …]
DTfSuiteRunnerTest.java320 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testLoadTestsForMultiAbi() local
321 mRunner.setDevice(mockDevice); in testLoadTestsForMultiAbi()
325 EasyMock.replay(mockDevice); in testLoadTestsForMultiAbi()
330 EasyMock.verify(mockDevice); in testLoadTestsForMultiAbi()
DTestMappingSuiteRunnerTest.java605 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testLoadTestsForMultiAbi() local
606 mRunner.setDevice(mockDevice); in testLoadTestsForMultiAbi()
607 EasyMock.replay(mockDevice); in testLoadTestsForMultiAbi()
614 EasyMock.verify(mockDevice); in testLoadTestsForMultiAbi()
/tools/tradefederation/core/tests/src/com/android/tradefed/device/
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 …]
DManagedDeviceListTest.java125 IManagedTestDevice mockDevice = EasyMock.createMock(IManagedTestDevice.class); in testUpdateFastbootState() local
126 EasyMock.expect(mockDevice.getSerialNumber()).andReturn("serial1"); in testUpdateFastbootState()
127 mockDevice.setDeviceState(TestDeviceState.FASTBOOT); in testUpdateFastbootState()
129 mManagedDeviceList.add(mockDevice); in testUpdateFastbootState()
131 EasyMock.replay(mockDevice); in testUpdateFastbootState()
135 EasyMock.verify(mockDevice); in testUpdateFastbootState()
146 IManagedTestDevice mockDevice = EasyMock.createMock(IManagedTestDevice.class); in testUpdateFastbootState_gone() local
147 EasyMock.expect(mockDevice.getSerialNumber()).andStubReturn("serial1"); in testUpdateFastbootState_gone()
148 EasyMock.expect(mockDevice.getDeviceState()).andReturn(TestDeviceState.FASTBOOT); in testUpdateFastbootState_gone()
149 mockDevice.setDeviceState(TestDeviceState.NOT_AVAILABLE); in testUpdateFastbootState_gone()
[all …]
DDeviceStateMonitorTest.java97 IDevice mockDevice = EasyMock.createMock(IDevice.class); in testIsAdbTcp_usb() local
98 EasyMock.expect(mockDevice.getSerialNumber()).andStubReturn("2345asdf"); in testIsAdbTcp_usb()
99 EasyMock.expect(mockDevice.getState()).andReturn(DeviceState.ONLINE); in testIsAdbTcp_usb()
100 EasyMock.replay(mockDevice); in testIsAdbTcp_usb()
101 DeviceStateMonitor monitor = new DeviceStateMonitor(mMockMgr, mockDevice, true); in testIsAdbTcp_usb()
109 IDevice mockDevice = EasyMock.createMock(IDevice.class); in testIsAdbTcp_tcp() local
110 EasyMock.expect(mockDevice.getSerialNumber()).andStubReturn("192.168.1.1:5555"); in testIsAdbTcp_tcp()
111 EasyMock.expect(mockDevice.getState()).andReturn(DeviceState.ONLINE); in testIsAdbTcp_tcp()
112 EasyMock.replay(mockDevice); in testIsAdbTcp_tcp()
113 DeviceStateMonitor monitor = new DeviceStateMonitor(mMockMgr, mockDevice, true); in testIsAdbTcp_tcp()
DWaitDeviceRecoveryTest.java120 UsbDevice mockDevice = Mockito.mock(UsbDevice.class); in testRecoverDevice_unavailable_recovers() local
121 doReturn(mockDevice).when(mMockUsbHelper).getDevice("serial"); in testRecoverDevice_unavailable_recovers()
130 verify(mockDevice).reset(); in testRecoverDevice_unavailable_recovers()
141 UsbDevice mockDevice = Mockito.mock(UsbDevice.class); in testRecoverDevice_unavailable_recovery() local
142 doReturn(mockDevice).when(mMockUsbHelper).getDevice("serial"); in testRecoverDevice_unavailable_recovery()
155 verify(mockDevice).reset(); in testRecoverDevice_unavailable_recovery()
166 UsbDevice mockDevice = Mockito.mock(UsbDevice.class); in testRecoverDevice_unavailable_recovery_fail() local
167 doReturn(mockDevice).when(mMockUsbHelper).getDevice("serial"); in testRecoverDevice_unavailable_recovery_fail()
179 verify(mockDevice).reset(); in testRecoverDevice_unavailable_recovery_fail()
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()
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()
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()
/tools/tradefederation/core/tests/src/com/android/tradefed/device/recovery/
DUsbResetRunConfigRecoveryTest.java42 IManagedTestDevice mockDevice = Mockito.mock(IManagedTestDevice.class); in testShouldSkip() local
43 doReturn("serial").when(mockDevice).getSerialNumber(); in testShouldSkip()
44 doReturn(false).when(mockDevice).isStateBootloaderOrFastbootd(); in testShouldSkip()
45 boolean res = mUsbReset.shouldSkip(mockDevice); in testShouldSkip()
47 res = mUsbReset.shouldSkip(mockDevice); in testShouldSkip()
49 res = mUsbReset.shouldSkip(mockDevice); in testShouldSkip()
55 IManagedTestDevice mockDevice = Mockito.mock(IManagedTestDevice.class); in testShouldSkip_fastboot() local
56 doReturn("serial").when(mockDevice).getSerialNumber(); in testShouldSkip_fastboot()
57 doReturn(true).when(mockDevice).isStateBootloaderOrFastbootd(); in testShouldSkip_fastboot()
58 assertTrue(mUsbReset.shouldSkip(mockDevice)); in testShouldSkip_fastboot()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/testtype/
DGTestTest.java401 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testFileExclusionRegexFilter_emptyfilters() local
402 EasyMock.expect(mockDevice.isExecutable("/test_file")).andReturn(true); in testFileExclusionRegexFilter_emptyfilters()
403 EasyMock.replay(mockDevice); in testFileExclusionRegexFilter_emptyfilters()
404 mGTest.setDevice(mockDevice); in testFileExclusionRegexFilter_emptyfilters()
406 EasyMock.verify(mockDevice); in testFileExclusionRegexFilter_emptyfilters()
420 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testFileExclusionRegexFilter_skipMatched() local
421 EasyMock.expect(mockDevice.isExecutable("/some/path/file/run_me")).andReturn(true); in testFileExclusionRegexFilter_skipMatched()
422 EasyMock.expect(mockDevice.isExecutable("/some/path/file/run_me2")).andReturn(true); in testFileExclusionRegexFilter_skipMatched()
423 EasyMock.expect(mockDevice.isExecutable("/some/path/file/run_me.not")).andReturn(true); in testFileExclusionRegexFilter_skipMatched()
424 EasyMock.expect(mockDevice.isExecutable("/some/path/file/run_me.so")).andReturn(true); in testFileExclusionRegexFilter_skipMatched()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/command/
DCommandSchedulerFuncTest.java272 ITestDevice mockDevice = EasyMock.createNiceMock(ITestDevice.class); in testBatteryLowLevel() local
273 EasyMock.expect(mockDevice.getSerialNumber()).andReturn("serial").anyTimes(); in testBatteryLowLevel()
275 EasyMock.expect(mockDevice.getIDevice()).andReturn(mockIDevice).anyTimes(); in testBatteryLowLevel()
276 EasyMock.expect(mockDevice.getDeviceState()).andReturn( in testBatteryLowLevel()
285 EasyMock.replay(mockDevice); in testBatteryLowLevel()
287 mMockDeviceManager.addDevice(mockDevice); in testBatteryLowLevel()
314 ITestDevice mockDevice = EasyMock.createNiceMock(ITestDevice.class); in testBatteryLowLevel_interruptible() local
315 EasyMock.expect(mockDevice.getSerialNumber()).andReturn("serial").anyTimes(); in testBatteryLowLevel_interruptible()
317 EasyMock.expect(mockDevice.getBattery()).andReturn(10); in testBatteryLowLevel_interruptible()
318 EasyMock.expect(mockDevice.getIDevice()).andReturn(mockIDevice).anyTimes(); in testBatteryLowLevel_interruptible()
[all …]
DCommandSchedulerTest.java354 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testExecCommand() local
355 EasyMock.expect(mockDevice.getSerialNumber()).andStubReturn("serial"); in testExecCommand()
356 EasyMock.expect(mockDevice.getDeviceState()).andStubReturn(TestDeviceState.ONLINE); in testExecCommand()
357 mockDevice.setRecoveryMode(EasyMock.eq(RecoveryMode.AVAILABLE)); in testExecCommand()
358 EasyMock.expect(mockDevice.getIDevice()).andStubReturn(mockIDevice); in testExecCommand()
364 EasyMock.expect(mockDevice.waitForDeviceShell(EasyMock.anyLong())).andReturn(true); in testExecCommand()
371 ((MockDeviceManager) manager).addDevice(mockDevice); in testExecCommand()
376 replayMocks(mockDevice, mockListener); in testExecCommand()
1267 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testExecCommand_versioning() local
1268 EasyMock.expect(mockDevice.getSerialNumber()).andStubReturn("serial"); in testExecCommand_versioning()
[all …]
/tools/tradefederation/contrib/tests/src/com/android/monkey/
DMonkeyBaseTest.java62 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testUptime() local
63 monkey.setDevice(mockDevice); in testUptime()
64 EasyMock.expect(mockDevice.executeShellCommand("cat /proc/uptime")) in testUptime()
66 EasyMock.replay(mockDevice); in testUptime()
73 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testUptime_fail() local
74 monkey.setDevice(mockDevice); in testUptime_fail()
75 EasyMock.expect(mockDevice.getSerialNumber()).andStubReturn("serial"); in testUptime_fail()
76 EasyMock.expect(mockDevice.executeShellCommand("cat /proc/uptime")).andReturn(""); in testUptime_fail()
77 EasyMock.expect(mockDevice.executeShellCommand("cat /proc/uptime")) in testUptime_fail()
79 EasyMock.replay(mockDevice); in testUptime_fail()
/tools/tradefederation/core/tests/src/com/android/tradefed/device/metric/
DLogcatTimingMetricCollectorTest.java75 ITestDevice mockDevice = mock(ITestDevice.class); in setup() local
76 when(mockDevice.getSerialNumber()).thenReturn("serial1"); in setup()
78 mDevices.add(mockDevice); in setup()
80 when(mContext.getDeviceName(same(mockDevice))).thenReturn("device1"); in setup()
86 .createLogcatReceiver(same(mockDevice), anyString()); in setup()
121 ITestDevice mockDevice = mock(ITestDevice.class); in testCollect_multipleDevice_perRun() local
123 when(mockDevice.getSerialNumber()).thenReturn("serial2"); in testCollect_multipleDevice_perRun()
125 mDevices.add(mockDevice); in testCollect_multipleDevice_perRun()
126 when(mContext.getDeviceName(same(mockDevice))).thenReturn("device2"); in testCollect_multipleDevice_perRun()
127 doReturn(mockReceiver).when(mCollector).createLogcatReceiver(same(mockDevice), anyString()); in testCollect_multipleDevice_perRun()
DHostStatsdMetricCollectorTest.java69 Stream.of("device_1", "device_2").map(this::mockDevice).collect(Collectors.toList());
151 private ITestDevice mockDevice(String serial) { in mockDevice() method in HostStatsdMetricCollectorTest
/tools/tradefederation/core/tests/src/com/android/tradefed/targetprep/
DFastbootDeviceFlasherTest.java223 ITestDevice mockDevice = EasyMock.createMock(ITestDevice.class); in testFlashBaseband_noVersion() local
225 setFastbootResponseExpectations(mockDevice, "version-baseband: \n"); in testFlashBaseband_noVersion()
226 setFastbootResponseExpectations(mockDevice, "version-baseband: \n"); in testFlashBaseband_noVersion()
228 setFastbootFlashExpectations(mockDevice, "radio"); in testFlashBaseband_noVersion()
229 mockDevice.rebootIntoBootloader(); in testFlashBaseband_noVersion()
230 EasyMock.replay(mockDevice, mMockRunUtil); in testFlashBaseband_noVersion()
237 flasher.checkAndFlashBaseband(mockDevice, build); in testFlashBaseband_noVersion()
238 EasyMock.verify(mockDevice, mMockRunUtil); in testFlashBaseband_noVersion()
756 private static void setFastbootResponseExpectations(ITestDevice mockDevice, String response) in setFastbootResponseExpectations() argument
763 mockDevice.executeFastbootCommand((String)EasyMock.anyObject(), in setFastbootResponseExpectations()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/device/cloud/
DGceSshTunnelMonitorTest.java153 IManagedTestDevice mockDevice = EasyMock.createMock(IManagedTestDevice.class); in testCreateSshTunnel() local
154 EasyMock.expect(mockDevice.getSerialNumber()).andReturn("INIT_SERIAL"); in testCreateSshTunnel()
155 mockDevice.setIDevice((RemoteAvdIDevice) EasyMock.anyObject()); in testCreateSshTunnel()
156 mockDevice.setFastbootEnabled(false); in testCreateSshTunnel()
158 EasyMock.replay(mockDevice); in testCreateSshTunnel()
159 mMonitor.createSshTunnel(mockDevice, mHost.getHost(), mHost.getPortOrDefault(5555)); in testCreateSshTunnel()
160 EasyMock.verify(mockDevice); in testCreateSshTunnel()
/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/targetprep/multi/
DMixImageZipPreparerTest.java177 ITestDevice mockDevice = Mockito.mock(ITestDevice.class); in setUpDevice() local
186 Mockito.when(mMockContext.getDevice(DEVICE_LABEL)).thenReturn(mockDevice); in setUpDevice()
187 Mockito.when(mMockContext.getBuildInfo(mockDevice)).thenReturn(mDeviceBuild); in setUpDevice()
191 ITestDevice mockDevice = Mockito.mock(ITestDevice.class); in setUpDeviceWithSuper() local
200 Mockito.when(mMockContext.getDevice(DEVICE_LABEL)).thenReturn(mockDevice); in setUpDeviceWithSuper()
201 Mockito.when(mMockContext.getBuildInfo(mockDevice)).thenReturn(mDeviceBuild); in setUpDeviceWithSuper()