Home
last modified time | relevance | path

Searched refs:withSettings (Results 1 – 25 of 48) sorted by relevance

12

/external/mockito/src/test/java/org/mockitousage/constructor/
DCreatingMocksWithConstructorTest.java22 import static org.mockito.Mockito.withSettings;
47 …Message mock = mock(Message.class, withSettings().useConstructor().defaultAnswer(CALLS_REAL_METHOD… in can_create_mock_with_constructor()
54 …AbstractMessage mock = mock(AbstractMessage.class, withSettings().useConstructor().defaultAnswer(C… in can_mock_abstract_classes()
66 …AbstractMessage mock = mock(AbstractMessage.class, withSettings().useConstructor("hello!").default… in can_spy_abstract_classes_with_constructor_args()
72 …AbstractMessage mock = mock(AbstractMessage.class, withSettings().useConstructor(7).defaultAnswer(… in can_spy_abstract_classes_with_constructor_primitive_args()
78 …AbstractMessage mock = mock(AbstractMessage.class, withSettings().useConstructor(new Object[]{null… in can_spy_abstract_classes_with_constructor_array_of_nulls()
84 …AbstractMessage mock = mock(AbstractMessage.class, withSettings().useConstructor((String) null).de… in can_spy_abstract_classes_with_casted_null()
91 …mock(AbstractMessage.class, withSettings().useConstructor(null).defaultAnswer(CALLS_REAL_METHODS)); in can_spy_abstract_classes_with_null_varargs()
101 …InnerClass mock = mock(InnerClass.class, withSettings().useConstructor().outerInstance(this).defau… in can_mock_inner_classes()
114 …mock(ThrowingConstructorClass.class, withSettings().useConstructor().defaultAnswer(CALLS_REAL_METH… in explains_constructor_exceptions()
[all …]
/external/mockito/src/test/java/org/mockitousage/basicapi/
DMocksSerializationTest.java49 Bar barMock = mock(Bar.class, withSettings().serializable()); in should_allow_method_delegation()
60 IMethods mock = mock(IMethods.class, withSettings().serializable()); in should_allow_mock_to_be_serializable()
69 IMethods mock = mock(IMethods.class, withSettings().serializable()); in should_allow_mock_and_boolean_value_to_serializable()
83 IMethods mock = mock(IMethods.class, withSettings().serializable()); in should_allow_mock_and_string_value_to_be_serializable()
98 IMethods mock = mock(IMethods.class, withSettings().serializable()); in should_all_mock_and_serializable_value_to_be_serialized()
112 IMethods mock = mock(IMethods.class, withSettings().serializable()); in should_serialize_method_call_with_parameters_that_are_serializable()
126 IMethods mock = mock(IMethods.class, withSettings().serializable()); in should_serialize_method_calls_using_any_string_matcher()
140 IMethods mock = mock(IMethods.class, withSettings().serializable()); in should_verify_called_n_times_for_serialized_mock()
156 IMethods mock = mock(IMethods.class, withSettings().serializable()); in should_verify_even_if_some_methods_called_after_serialization()
200 IMethods mock = mock(IMethods.class, withSettings().serializable()); in should_stub_even_if_some_methods_called_after_serialization()
[all …]
DMockingMultipleInterfacesTest.java15 import static org.mockito.Mockito.withSettings;
29 Foo mock = mock(Foo.class, withSettings().extraInterfaces(IFoo.class, IBar.class)); in should_allow_multiple_interfaces()
40 mock(Foo.class, withSettings().extraInterfaces(IFoo.class, null)); in should_scream_when_null_passed_instead_of_an_interface()
52 mock(Foo.class, withSettings().extraInterfaces()); in should_scream_when_no_args_passed()
64 mock(Foo.class, withSettings().extraInterfaces((Class[]) null)); in should_scream_when_null_passed_instead_of_an_array()
76 mock(Foo.class, withSettings().extraInterfaces(Foo.class)); in should_scream_when_non_interface_passed()
88 mock(IMethods.class, withSettings().extraInterfaces(IMethods.class)); in should_scream_when_the_same_interfaces_passed()
109 Object mocked = mock(interface1, withSettings().extraInterfaces(interface2)); in should_mock_class_with_interfaces_of_different_class_loader_AND_different_classpaths()
DMocksCreationTest.java36 IMethods mock = mock(IMethods.class, withSettings() in shouldCombineMockNameAndSmartNulls()
56 IMethods mock = mock(IMethods.class, withSettings() in shouldCombineMockNameAndExtraInterfaces()
72 IMethods mock = mock(IMethods.class, withSettings().name("great mockie")); in shouldSpecifyMockNameViaSettings()
87 mock(List.class, withSettings().spiedInstance(list)); in shouldScreamWhenSpyCreatedWithWrongType()
97 mock(LinkedList.class, withSettings().spiedInstance(list)); in shouldAllowCreatingSpiesWithCorrectType()
/external/mockito/src/test/java/org/mockito/
DStaticMockingExperimentTest.java28 import static org.mockito.Mockito.withSettings;
61 …n = Mockito.framework().getInvocationFactory().createInvocation(mock, withSettings().build(Foo.cla… in verify_static_method()
72 …n = Mockito.framework().getInvocationFactory().createInvocation(mock, withSettings().build(Foo.cla… in verify_static_method()
80 …g = Mockito.framework().getInvocationFactory().createInvocation(mock, withSettings().build(Foo.cla… in verify_static_method()
89 …n = Mockito.framework().getInvocationFactory().createInvocation(mock, withSettings().build(Foo.cla… in verification_failure_static_method()
95 …g = Mockito.framework().getInvocationFactory().createInvocation(mock, withSettings().build(Foo.cla… in verification_failure_static_method()
107 …n = Mockito.framework().getInvocationFactory().createInvocation(mock, withSettings().build(Foo.cla… in stubbing_static_method()
119 …g = Mockito.framework().getInvocationFactory().createInvocation(mock, withSettings().build(Foo.cla… in stubbing_static_method()
131 … .createInvocation(mock, withSettings().build(Foo.class), staticMethod, realMethod, "foo"); in do_answer_stubbing_static_method()
139 …g = Mockito.framework().getInvocationFactory().createInvocation(mock, withSettings().build(Foo.cla… in do_answer_stubbing_static_method()
[all …]
DInvocationFactoryTest.java18 import static org.mockito.Mockito.withSettings;
32 withSettings().build(TestClass.class), in call_method_that_throws_a_throwable()
54 withSettings().build(TestClass.class), in call_method_that_returns_a_string()
70 withSettings().build(TestClass.class), in deprecated_api_still_works()
/external/mockito/src/test/java/org/mockitousage/debugging/
DVerboseLoggingOfInvocationsOnMockTest.java55 Foo foo = mock(Foo.class, withSettings().verboseLogging()); in shouldNotPrintInvocationOnMockWithoutSetting()
71 Foo foo = mock(Foo.class, withSettings().verboseLogging()); in shouldPrintUnstubbedInvocationOnMockToStdOut()
87 Foo foo = mock(Foo.class, withSettings().verboseLogging()); in shouldPrintStubbedInvocationOnMockToStdOut()
105 Foo foo = mock(Foo.class, withSettings().verboseLogging()); in shouldPrintThrowingInvocationOnMockToStdOut()
127 withSettings().spiedInstance(new FooImpl()).verboseLogging()); in shouldPrintRealInvocationOnSpyToStdOut()
144 Foo foo = mock(Foo.class, withSettings().verboseLogging()); in usage()
DInvocationListenerCallbackTest.java25 import static org.mockito.Mockito.withSettings;
38 Foo foo = mock(Foo.class, withSettings().invocationListeners(listener)); in should_call_single_listener_when_mock_return_normally()
55 Foo foo = mock(Foo.class, withSettings().invocationListeners(listener1, listener2)); in should_call_listeners_in_order()
70 Foo foo = mock(Foo.class, withSettings().invocationListeners(listener1, listener1)); in should_allow_same_listener()
85 Foo foo = mock(Foo.class, withSettings().invocationListeners(listener1, listener2)); in should_call_all_listener_when_mock_return_normally()
101 Foo foo = mock(Foo.class, withSettings().invocationListeners(listener1, listener2)); in should_call_all_listener_when_mock_throws_exception()
/external/mockito/src/test/java/org/mockitousage/stubbing/
DStubbingWithDelegateVarArgsTest.java12 import static org.mockito.Mockito.withSettings;
31 Foo foo = mock(Foo.class, withSettings() in should_not_fail_when_calling_varargs_method()
38 Foo foo = mock(Foo.class, withSettings() in should_not_fail_when_calling_varargs_method_without_arguments()
46 Foo foo = mock(Foo.class, withSettings() in should_not_fail_when_calling_varargs_method_with_null_argument()
/external/mockito/src/test/java/org/mockitousage/verification/
DVerificationStartedListenerTest.java38 …List mock2 = mock(List.class, Mockito.withSettings().verificationStartedListeners(new Verification… in verified_mock_can_be_replaced()
61 …List mock = mock(List.class, Mockito.withSettings().verificationStartedListeners(new VerificationS… in verification_started_event_contains_correct_mock()
81 …List mock2 = mock(List.class, Mockito.withSettings().verificationStartedListeners(new Verification… in listeners_are_executed_in_sequence()
110 Mockito.withSettings().verificationStartedListeners(null); in shows_clean_exception_when_null_array_passed()
121 …Mockito.withSettings().verificationStartedListeners(mock(VerificationStartedListener.class), null); in shows_clean_exception_when_null_listener_passed()
/external/mockito/src/test/java/org/mockitousage/stacktrace/
DModellingDescriptiveMessagesTest.java175 mock(IMethods.class, withSettings().extraInterfaces(List.class, null)); in shouldScreamWhenNullPassedInsteadOfAnInterface()
181 mock(IMethods.class, withSettings().extraInterfaces(LinkedList.class)); in shouldScreamWhenNonInterfacePassed()
187 mock(IMethods.class, withSettings().extraInterfaces(IMethods.class)); in shouldScreamWhenExtraIsTheSame()
193 mock(IMethods.class, withSettings().extraInterfaces()); in shouldScreamWhenExtraInterfacesEmpty()
199 mock(IMethods.class, withSettings().extraInterfaces((Class<?>[]) null)); in shouldScreamWhenExtraInterfacesIsANullArray()
/external/mockito/src/test/java/org/mockito/internal/listeners/
DVerificationStartedNotifierTest.java20 import static org.mockito.Mockito.withSettings;
82 final Set mock = mock(Set.class, withSettings().extraInterfaces(List.class)); in decent_exception_when_setting_mock_that_does_not_implement_all_desired_interfaces()
102 final Set mock = mock(Set.class, withSettings().extraInterfaces(List.class, Map.class)); in accepts_replacement_mock_if_all_types_are_compatible()
103 … final Set compatibleMock = mock(Set.class, withSettings().extraInterfaces(List.class, Map.class)); in accepts_replacement_mock_if_all_types_are_compatible()
/external/mockito/src/main/java/org/mockito/
DMockito.java1804 return mock(classToMock, withSettings()); in mock()
1824 return mock(classToMock, withSettings() in mock()
1867 return mock(classToMock, withSettings().defaultAnswer(defaultAnswer)); in mock()
1979 return MOCKITO_CORE.mock((Class<T>) object.getClass(), withSettings() in spy()
2014 return MOCKITO_CORE.mock(classToSpy, withSettings() in spy()
2944 public static MockSettings withSettings() { in withSettings() method in Mockito
/external/dexmaker/dexmaker-mockito-inline/src/main/java/com/android/dx/mockito/inline/
DInvocationHandlerAdapter.java29 import static org.mockito.Mockito.withSettings;
76 withSettings().build(mock.getClass()), method, new RealMethodBehavior() { in interceptEntryHook()
113 withSettings().build(proxy.getClass().getSuperclass()), method,
/external/mockito/src/test/java/org/mockitousage/serialization/
DDeepStubsSerializableTest.java22 …SampleClass sampleClass = mock(SampleClass.class, withSettings().defaultAnswer(RETURNS_DEEP_STUBS)… in should_serialize_and_deserialize_mock_created_with_deep_stubs()
37 …ListContainer deep_stubbed = mock(ListContainer.class, withSettings().defaultAnswer(RETURNS_DEEP_S… in should_serialize_and_deserialize_parameterized_class_mocked_with_deep_stubs()
51 …ListContainer deep_stubbed = mock(ListContainer.class, withSettings().defaultAnswer(RETURNS_DEEP_S… in should_discard_generics_metadata_when_serialized_then_disabling_deep_stubs_with_generics()
/external/mockito/src/test/java/org/mockitousage/performance/
DStubOnlyAvoidMemoryConsumptionTest.java16 Object obj = mock(Object.class, withSettings().stubOnly()); in using_stub_only_wont_thrown_an_OutOfMemoryError()
27 Object obj = mock(Object.class, withSettings()); in without_stub_only_mocks_will_store_invocations_leading_to_an_OutOfMemoryError()
/external/mockito/subprojects/inline/src/test/java/org/mockitoinline/
DStressTest.java12 import static org.mockito.Mockito.withSettings;
29 TestClass serializableMock = mock(TestClass.class, withSettings().serializable()); in call_a_lot_of_mocks()
/external/icu/android_icu4j/src/main/java/android/icu/impl/duration/
DBasicPeriodBuilderFactory.java361 return withSettings(newSettings);
366 protected abstract PeriodBuilder withSettings(BasicPeriodBuilderFactory.Settings settingsToUse);
392 protected PeriodBuilder withSettings(BasicPeriodBuilderFactory.Settings settingsToUse) {
421 protected PeriodBuilder withSettings(BasicPeriodBuilderFactory.Settings settingsToUse) {
456 protected PeriodBuilder withSettings(BasicPeriodBuilderFactory.Settings settingsToUse) {
507 protected PeriodBuilder withSettings(BasicPeriodBuilderFactory.Settings settingsToUse) {
/external/icu/icu4j/main/classes/core/src/com/ibm/icu/impl/duration/
DBasicPeriodBuilderFactory.java360 return withSettings(newSettings);
365 protected abstract PeriodBuilder withSettings(BasicPeriodBuilderFactory.Settings settingsToUse);
391 protected PeriodBuilder withSettings(BasicPeriodBuilderFactory.Settings settingsToUse) {
420 protected PeriodBuilder withSettings(BasicPeriodBuilderFactory.Settings settingsToUse) {
455 protected PeriodBuilder withSettings(BasicPeriodBuilderFactory.Settings settingsToUse) {
506 protected PeriodBuilder withSettings(BasicPeriodBuilderFactory.Settings settingsToUse) {
/external/mockito/src/main/java/org/mockito/internal/stubbing/defaultanswers/
DReturnsDeepStubs.java23 import static org.mockito.Mockito.withSettings;
104 withSettings().extraInterfaces(returnTypeGenericMetadata.rawExtraInterfaces()) in withSettingsUsing()
105 : withSettings(); in withSettingsUsing()
/external/mockito/src/main/java/org/mockito/internal/configuration/
DSpyAnnotationEngine.java23 import static org.mockito.Mockito.withSettings;
76 withSettings().spiedInstance(instance) in spyInstance()
83 MockSettings settings = withSettings().defaultAnswer(CALLS_REAL_METHODS) in spyNewInstance()
/external/mockito/src/main/java/org/mockito/internal/configuration/injection/
DSpyOnInjectedFieldsHandler.java17 import static org.mockito.Mockito.withSettings;
43 Object mock = Mockito.mock(instance.getClass(), withSettings() in processInjection()
/external/mockito/src/test/java/org/mockitousage/plugins/
DMockitoPluginsTest.java20 import static org.mockito.Mockito.withSettings;
41 …Instantiator instantiator = provider.getInstantiator(withSettings().build(MockitoPluginsTest.class… in instantiator_provider_backwards_compatibility()
/external/dexmaker/dexmaker-mockito/src/main/java/com/android/dx/mockito/
DInvocationHandlerAdapter.java28 import static org.mockito.Mockito.withSettings;
53 withSettings().build(proxy.getClass().getSuperclass()), method, in invoke()
/external/mockito/src/test/java/org/mockitousage/strictness/
DStrictnessWhenRuleStrictnessIsUpdatedTest.java22 import static org.mockito.Mockito.withSettings;
44 final IMethods lenientMock = mock(IMethods.class, withSettings().lenient()); in strictness_per_mock()

12