/external/mockito/src/main/java/org/mockito/internal/stubbing/ |
D | BaseStubbing.java | 32 private OngoingStubbing<T> thenThrow(Throwable throwable) { in thenThrow() method in BaseStubbing 36 public OngoingStubbing<T> thenThrow(Throwable... throwables) { in thenThrow() method in BaseStubbing 38 return thenThrow((Throwable) null); in thenThrow() 43 stubbing = thenThrow(t); in thenThrow() 45 stubbing = stubbing.thenThrow(t); in thenThrow() 51 public OngoingStubbing<T> thenThrow(Class<? extends Throwable> throwableType) { in thenThrow() method in BaseStubbing 56 …public OngoingStubbing<T> thenThrow(Class<? extends Throwable> toBeThrown, Class<? extends Throwab… in thenThrow() method in BaseStubbing 58 thenThrow((Throwable) null); in thenThrow() 60 OngoingStubbing<T> stubbing = thenThrow(toBeThrown); in thenThrow() 62 stubbing = stubbing.thenThrow(t); in thenThrow()
|
/external/mockito/src/test/java/org/mockitousage/stubbing/ |
D | StubbingWithThrowablesTest.java | 40 when(mock.add("throw")).thenThrow(expected); in shouldStubWithThrowable() 77 when(mock.get(1)).thenThrow(new ExceptionOne()); in shouldFailStubbingThrowableOnTheSameInvocationDueToAcceptableLimitation() 80 when(mock.get(1)).thenThrow(new ExceptionTwo()); in shouldFailStubbingThrowableOnTheSameInvocationDueToAcceptableLimitation() 91 when(reader.read()).thenThrow(ioException); in shouldAllowSettingCheckedException() 105 when(mock.add("quake")).thenThrow(error); in shouldAllowSettingError() 117 when(mock.add(null)).thenThrow((Exception) null); in shouldNotAllowNullExceptionType() 123 when(mock.add(null)).thenThrow(NaughtyException.class); in shouldInstantiateExceptionClassOnInteraction() 137 when(mock.add("monkey island")).thenThrow(new Exception()); in shouldNotAllowSettingInvalidCheckedException() 142 when(mock.add("monkey island")).thenThrow((Throwable) null); in shouldNotAllowSettingNullThrowable() 147 when(mock.add("monkey island")).thenThrow((Throwable[]) null); in shouldNotAllowSettingNullThrowableArray() [all …]
|
D | StubbingConsecutiveAnswersTest.java | 59 .thenThrow(new NullPointerException(), new RuntimeException()) in should_return_consecutive_value_and_throw_exceptions_set_by_shorten_return_methods() 61 .thenThrow(new IllegalArgumentException()); in should_return_consecutive_value_and_throw_exceptions_set_by_shorten_return_methods() 83 when(mock.simpleMethod()).thenThrow(new RuntimeException()) in should_throw_consecutively() 84 .thenThrow(new IllegalArgumentException()) in should_throw_consecutively() 85 .thenThrow(new NullPointerException()); in should_throw_consecutively() 110 when(mock.simpleMethod()).thenThrow(new RuntimeException(), in should_throw_consecutively_set_by_shorten_then_throw_method() 138 when(mock.simpleMethod()).thenThrow(IllegalArgumentException.class); in should_throw_classes() 155 when(mock.simpleMethod()).thenThrow(RuntimeException.class, in should_throw_consecutively_classes_set_by_shorten_then_throw_method() 183 .thenThrow(new IllegalArgumentException()) in should_mix_consecutive_returns_with_excepions() 185 .thenThrow(new NullPointerException()) in should_mix_consecutive_returns_with_excepions() [all …]
|
D | BasicStubbingTest.java | 63 when(mock.simpleMethod("one")).thenThrow(new RuntimeException()); in should_stubbing_not_be_treated_as_interaction()
|
/external/mockito/src/main/java/org/mockito/stubbing/ |
D | OngoingStubbing.java | 89 OngoingStubbing<T> thenThrow(Throwable... throwables); in thenThrow() method 114 OngoingStubbing<T> thenThrow(Class<? extends Throwable> throwableType); in thenThrow() method 149 …OngoingStubbing<T> thenThrow(Class<? extends Throwable> toBeThrown, Class<? extends Throwable>... … in thenThrow() method
|
/external/mockito/src/test/java/org/mockitousage/ |
D | CompilationWarningsTest.java | 36 … when(mock(IMethods.class).objectReturningMethodNoArgs()).thenThrow(new NullPointerException()); in no_warnings_for_most_common_api() 37 …when(mock(IMethods.class).objectReturningMethodNoArgs()).thenThrow(new NullPointerException(), new… in no_warnings_for_most_common_api() 38 … when(mock(IMethods.class).objectReturningMethodNoArgs()).thenThrow(NullPointerException.class); in no_warnings_for_most_common_api() 43 …when(mock(IMethods.class).objectReturningMethodNoArgs()).then(ignore()).thenThrow(new NullPointerE… in no_warnings_for_most_common_api() 44 …when(mock(IMethods.class).objectReturningMethodNoArgs()).then(ignore()).thenThrow(new NullPointerE… in no_warnings_for_most_common_api() 45 …when(mock(IMethods.class).objectReturningMethodNoArgs()).then(ignore()).thenThrow(NullPointerExcep… in no_warnings_for_most_common_api() 80 …when(mock(IMethods.class).objectReturningMethodNoArgs()).thenThrow(NullPointerException.class, Ill… in heap_pollution_JDK7plus_warning_avoided_BUT_now_unchecked_generic_array_creation_warnings_ON_JDK5plus_environment()
|
/external/mockito/src/test/java/org/mockitousage/misuse/ |
D | InvalidUsageTest.java | 59 when(mock.simpleMethod()).thenThrow(new Exception()); in shouldNotAllowSettingInvalidCheckedException() 64 when(mock.simpleMethod()).thenThrow(new Throwable[] {null}); in shouldNotAllowSettingNullThrowable() 70 when(mock.simpleMethod()).thenThrow((Throwable) null); in shouldNotAllowSettingNullThrowableVararg() 75 when(mock.simpleMethod()).thenThrow(new RuntimeException(), null); in shouldNotAllowSettingNullConsecutiveThrowable()
|
/external/mockito/src/test/java/org/mockitousage/stacktrace/ |
D | StackTraceFilteringTest.java | 125 when(mock.oneArg(true)).thenThrow(new Exception()); in shouldFilterStackTraceWhenThrowingExceptionFromMockHandler() 134 when(mock.simpleMethod()).thenThrow(new RuntimeException()); in shouldShowProperExceptionStackTrace()
|
/external/mockito/src/main/java/org/mockito/ |
D | BDDMockito.java | 172 return new BDDOngoingStubbingImpl<T>(mockitoOngoingStubbing.thenThrow(throwables)); in willThrow() 176 return new BDDOngoingStubbingImpl<T>(mockitoOngoingStubbing.thenThrow(throwableType)); in willThrow() 180 …return new BDDOngoingStubbingImpl<T>(mockitoOngoingStubbing.thenThrow(throwableType, throwableType… in willThrow()
|
/external/mockito/src/test/java/org/mockitousage/bugs/ |
D | NPEWhenMockingThrowablesTest.java | 28 when(mock.simpleMethod()).thenThrow(mock2); in shouldNotThrowNPE()
|
D | NPEWhenCustomExceptionStackTraceReturnNullTest.java | 26 when(mock.simpleMethod()).thenThrow(new NullStackTraceException()); in shouldNotThrowNPE()
|
/external/mockito/src/test/java/org/mockitousage/matchers/ |
D | VerificationAndStubbingUsingMatchersTest.java | 34 when(three.simpleMethod(startsWith("test"))).thenThrow(new RuntimeException()); in shouldStubUsingMatchers()
|
/external/mockito/src/test/java/org/mockitousage/basicapi/ |
D | ResetTest.java | 75 when(mock.simpleMethod("one")).thenThrow(new RuntimeException()); in shouldStubbingNotBeTreatedAsInteraction()
|
/external/volley/src/test/java/com/android/volley/toolbox/ |
D | AndroidAuthenticatorTest.java | 56 when(mFuture.getResult()).thenThrow(new AuthenticatorException("sadness!")); in failedGetAuthToken()
|
/external/mockito/src/test/java/org/mockito/internal/configuration/plugins/ |
D | PluginFinderTest.java | 102 when(switcher.isEnabled(anyString())).thenThrow(new RuntimeException("Boo!")); in problems_loading_impl()
|
/external/mockito/src/test/java/org/mockitousage/annotation/ |
D | MockInjectionUsingConstructorTest.java | 60 when(calculator.countArticles("new")).thenThrow(new IllegalArgumentException()); in innerMockShouldRaiseAnExceptionThatChangesOuterMockBehavior()
|
/external/volley/src/test/java/com/android/volley/ |
D | RequestQueueIntegrationTest.java | 197 when(mMockNetwork.performRequest(request)).thenThrow(new VolleyError()); in add_requestFinishedListenerError()
|
/external/guava/guava-tests/test/com/google/common/util/concurrent/ |
D | MoreExecutorsTest.java | 527 when(service.awaitTermination(2, TimeUnit.SECONDS)).thenThrow(new InterruptedException()); in testAddDelayedShutdownHook_interrupted() 671 .thenThrow(new InterruptedException()); in testShutdownAndAwaitTermination_interruptedInternal()
|