Home
last modified time | relevance | path

Searched refs:mockRunnable (Results 1 – 2 of 2) sorted by relevance

/tools/tradefederation/core/javatests/com/android/tradefed/util/
DRunUtilTest.java162 IRunUtil.IRunnableResult mockRunnable = mock(IRunUtil.IRunnableResult.class); in testRunTimed() local
163 when(mockRunnable.getCommand()).thenReturn(new ArrayList<>()); in testRunTimed()
164 when(mockRunnable.run()).thenReturn(Boolean.TRUE); in testRunTimed()
167 CommandStatus.SUCCESS, mRunUtil.runTimed(SHORT_TIMEOUT_MS, mockRunnable, true)); in testRunTimed()
173 IRunUtil.IRunnableResult mockRunnable = mock(IRunUtil.IRunnableResult.class); in testRunTimed_failed() local
174 when(mockRunnable.getCommand()).thenReturn(new ArrayList<>()); in testRunTimed_failed()
175 when(mockRunnable.run()).thenReturn(Boolean.FALSE); in testRunTimed_failed()
177 assertEquals(CommandStatus.FAILED, mRunUtil.runTimed(SHORT_TIMEOUT_MS, mockRunnable, true)); in testRunTimed_failed()
183 IRunUtil.IRunnableResult mockRunnable = mock(IRunUtil.IRunnableResult.class); in testRunTimed_exception() local
184 when(mockRunnable.getCommand()).thenReturn(new ArrayList<>()); in testRunTimed_exception()
[all …]
DRunUtilFuncTest.java55 MyRunnable mockRunnable = new MyRunnable() { in testRunTimed_timeout() local
67 mockRunnable, true)); in testRunTimed_timeout()
68 assertTrue(mockRunnable.mCanceled); in testRunTimed_timeout()
78 IRunUtil.IRunnableResult mockRunnable = new IRunUtil.IRunnableResult() { in testRunTimedRetry() local
92 mockRunnable)); in testRunTimedRetry()