Home
last modified time | relevance | path

Searched refs:mMockDevice (Results 1 – 25 of 94) sorted by relevance

1234

/tools/tradefederation/core/tests/src/com/android/tradefed/targetprep/
DInstallApexModuleTargetPreparerTest.java59 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 …]
DDeviceSetupTest.java48 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 …]
DFastbootDeviceFlasherTest.java54 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 …]
DGsiDeviceFlashPreparerTest.java57 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 …]
DPushFilePreparerTest.java55 private ITestDevice mMockDevice = null; field in PushFilePreparerTest
61 mMockDevice = EasyMock.createStrictMock(ITestDevice.class); in setUp()
62 EasyMock.expect(mMockDevice.getDeviceDescriptor()).andStubReturn(null); in setUp()
63 EasyMock.expect(mMockDevice.getSerialNumber()).andStubReturn("SERIAL"); in setUp()
67 context.addAllocatedDevice("device", mMockDevice); in setUp()
74 EasyMock.replay(mMockDevice); in testNoop()
76 EasyMock.verify(mMockDevice); in testNoop()
83 EasyMock.replay(mMockDevice); in testLocalNoExist()
92 EasyMock.verify(mMockDevice); in testLocalNoExist()
101 mMockDevice.pushFile((File)EasyMock.anyObject(), EasyMock.eq("/noexist/"))) in testRemoteNoExist()
[all …]
DGkiDeviceFlashPreparerTest.java57 private ITestDevice mMockDevice; field in GkiDeviceFlashPreparerTest
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 …]
DDeviceFlashPreparerTest.java59 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 …]
DDefaultTestsZipInstallerTest.java47 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 …]
DSwitchUserTargetPreparerTest.java46 @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 …]
DRootTargetPreparerTest.java37 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 …]
DCreateUserPreparerTest.java46 private ITestDevice mMockDevice; field in CreateUserPreparerTest
51 mMockDevice = Mockito.mock(ITestDevice.class); in setUp()
54 context.addAllocatedDevice("device", mMockDevice); in setUp()
60 doReturn(10).when(mMockDevice).getCurrentUser(); in testSetUp_tearDown()
61 doReturn(5).when(mMockDevice).createUser(Mockito.any()); in testSetUp_tearDown()
62 doReturn(true).when(mMockDevice).switchUser(5); in testSetUp_tearDown()
63 doReturn(true).when(mMockDevice).startUser(5, true); in testSetUp_tearDown()
66 doReturn(true).when(mMockDevice).removeUser(5); in testSetUp_tearDown()
67 doReturn(true).when(mMockDevice).switchUser(10); in testSetUp_tearDown()
98 doReturn(existingUsers).when(mMockDevice).getUserInfos(); in testSetUp_tearDown_reuseTestUser()
[all …]
DDisableSELinuxTargetPreparerTest.java37 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 …]
DAppSetupTest.java55 private ITestDevice mMockDevice; field in AppSetupTest
63 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp()
64 EasyMock.expect(mMockDevice.getSerialNumber()).andStubReturn(SERIAL); in setUp()
65 EasyMock.expect(mMockDevice.getDeviceDescriptor()).andStubReturn(null); in setUp()
66 EasyMock.expect(mMockDevice.isAppEnumerationSupported()).andStubReturn(false); in setUp()
82 EasyMock.replay(mMockDevice, mMockBuildInfo); in replayMocks()
86 EasyMock.verify(mMockDevice, mMockBuildInfo); in verifyMocks()
97 mAppSetup.setUp(mMockDevice, new BuildInfo()); in testSetup_notApps()
112 EasyMock.expect(mMockDevice.installPackage(EasyMock.eq(tmpFile), EasyMock.eq(true))) in testSetup_failToInstall()
115 mAppSetup.setUp(mMockDevice, mMockBuildInfo); in testSetup_failToInstall()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/device/
DDeviceStateMonitorTest.java43 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 …]
DDeviceSelectionOptionsTest.java45 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 …]
DWifiHelperTest.java36 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 …]
/tools/tradefederation/core/tests/src/com/android/tradefed/testtype/suite/
DITestSuiteTest.java118 private ITestDevice mMockDevice; field in ITestSuiteTest
299 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp()
300 EasyMock.expect(mMockDevice.getSerialNumber()).andStubReturn("SERIAL"); in setUp()
301 EasyMock.expect(mMockDevice.getIDevice()).andStubReturn(EasyMock.createMock(IDevice.class)); in setUp()
309 mTestSuite.setDevice(mMockDevice); in setUp()
314 mContext.addAllocatedDevice(ConfigurationDef.DEFAULT_DEVICE_NAME, mMockDevice); in setUp()
374 EasyMock.replay(mMockListener, mMockDevice, mMockBuildInfo, mMockSysChecker); in replayMocks()
381 EasyMock.verify(mMockListener, mMockDevice, mMockBuildInfo, mMockSysChecker); in verifyMocks()
433 mContext.addAllocatedDevice(ConfigurationDef.DEFAULT_DEVICE_NAME, mMockDevice); in testRun()
435 EasyMock.expect(mMockDevice.getIDevice()).andReturn(EasyMock.createMock(IDevice.class)); in testRun()
[all …]
DModuleDefinitionTest.java112 private ITestDevice mMockDevice; field in ModuleDefinitionTest
320 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp()
330 mModule.getModuleInvocationContext().addAllocatedDevice(DEFAULT_DEVICE_NAME, mMockDevice); in setUp()
341 EasyMock.replay(mMockListener, mMockLogSaver, mMockLogSaverListener, mMockDevice); in replayMocks()
356 EasyMock.verify(mMockListener, mMockLogSaver, mMockLogSaverListener, mMockDevice); in verifyMocks()
421 mModule.setDevice(mMockDevice); in testRun()
425 mMockTest.setDevice(EasyMock.eq(mMockDevice)); in testRun()
456 module.getModuleInvocationContext().addAllocatedDevice(DEFAULT_DEVICE_NAME, mMockDevice); in testDynamicDownloadThrows_ReportsRunFailed()
473 mModule.setDevice(mMockDevice); in testRun_tearDownException()
477 mMockTest.setDevice(EasyMock.eq(mMockDevice)); in testRun_tearDownException()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/suite/checker/
DDeviceSettingCheckerTest.java38 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 …]
DSystemServerFileDescriptorCheckerTest.java35 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 …]
/tools/tradefederation/core/tests/src/com/android/tradefed/device/metric/
DAtraceCollectorTest.java50 private ITestDevice mMockDevice; field in AtraceCollectorTest
66 mMockDevice = EasyMock.createNiceMock(ITestDevice.class); in setUp()
75 EasyMock.expect(mMockDevice.pullFile((String) EasyMock.anyObject())) in setUp()
77 EasyMock.expect(mMockDevice.getSerialNumber()).andStubReturn(M_SERIAL_NO); in setUp()
80 .andStubReturn(Arrays.asList(mMockDevice)); in setUp()
106 mMockDevice.executeShellCommand( in testStartsAtraceOnSetupNoOptions()
114 EasyMock.replay(mMockDevice); in testStartsAtraceOnSetupNoOptions()
117 EasyMock.verify(mMockDevice); in testStartsAtraceOnSetupNoOptions()
128 mMockDevice.executeShellCommand( in testStartsAtraceOnSetupNoCompression()
136 EasyMock.replay(mMockDevice); in testStartsAtraceOnSetupNoCompression()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/testtype/junit4/
DBaseHostJUnit4TestTest.java127 private ITestDevice mMockDevice; field in BaseHostJUnit4TestTest
136 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp()
137 EasyMock.expect(mMockDevice.isAppEnumerationSupported()).andStubReturn(false); in setUp()
139 mMockContext.addAllocatedDevice(ConfigurationDef.DEFAULT_DEVICE_NAME, mMockDevice); in setUp()
142 EasyMock.expect(mMockDevice.checkApiLevelAgainstNextRelease(EasyMock.anyInt())) in setUp()
147 mHostTest.setDevice(mMockDevice); in setUp()
165 EasyMock.replay(mMockListener, mMockBuild, mMockDevice); in testSimpleRun()
167 EasyMock.verify(mMockListener, mMockBuild, mMockDevice); in testSimpleRun()
178 mMockDevice.executeShellCommand( in testRunDeviceTests()
180 EasyMock.expect(mMockDevice.getIDevice()).andReturn(new StubDevice("serial")); in testRunDeviceTests()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/util/
DJavaCodeCoverageFlusherTest.java54 @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 …]
/tools/tradefederation/core/tests/src/com/android/tradefed/util/sl4a/
DSl4aClientTest.java42 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/build/
DBootstrapBuildProviderTest.java42 private ITestDevice mMockDevice; field in BootstrapBuildProviderTest
53 mMockDevice = EasyMock.createMock(ITestDevice.class); in setUp()
58 EasyMock.expect(mMockDevice.getBuildId()).andReturn("5"); in testGetBuild()
59 EasyMock.expect(mMockDevice.getIDevice()).andReturn(EasyMock.createMock(IDevice.class)); in testGetBuild()
60 EasyMock.expect(mMockDevice.waitForDeviceShell(EasyMock.anyLong())).andReturn(true); in testGetBuild()
61 EasyMock.expect(mMockDevice.getProperty(EasyMock.anyObject())).andStubReturn("property"); in testGetBuild()
62 EasyMock.expect(mMockDevice.getProductVariant()).andStubReturn("variant"); in testGetBuild()
63 EasyMock.expect(mMockDevice.getBuildFlavor()).andStubReturn("flavor"); in testGetBuild()
64 EasyMock.expect(mMockDevice.getBuildAlias()).andStubReturn("alias"); in testGetBuild()
65 EasyMock.replay(mMockDevice); in testGetBuild()
[all …]

1234