Home
last modified time | relevance | path

Searched +full:mock +full:- +full:maker (Results 1 – 25 of 43) sorted by relevance

12

/external/mockito-kotlin/.github/workflows/
Dci.yml5 # - skipping CI: add [skip ci] to the commit message
6 # - skipping release: add [skip release] to the commit message
13 - main
15 - 3.*
16 - 4.*
19 - main
24 # SINGLE-JOB
27 runs-on: ubuntu-latest
32 - name: 1. Check out code
35 - name: 2. Set up Java 8
[all …]
/external/mockito/src/test/java/org/mockito/
DMockitoTest.java25 List mock = Mockito.mock(List.class); in shouldRemoveStubbableFromProgressAfterStubbing() local
26 Mockito.when(mock.add("test")).thenReturn(true); in shouldRemoveStubbableFromProgressAfterStubbing()
35 () -> { in shouldValidateMockWhenVerifying()
40 "Argument passed to verify() is of type String and is not a mock!") in shouldValidateMockWhenVerifying()
48 () -> { in shouldValidateMockWhenVerifyingWithExpectedNumberOfInvocations()
53 "Argument passed to verify() is of type String and is not a mock!") in shouldValidateMockWhenVerifyingWithExpectedNumberOfInvocations()
60 () -> { in shouldValidateMockWhenVerifyingNoMoreInteractions()
64 .hasMessageContaining("Argument(s) passed is not a mock!"); in shouldValidateMockWhenVerifyingNoMoreInteractions()
70 () -> { in shouldValidateMockWhenVerifyingNoInteractions()
74 .hasMessageContaining("Argument(s) passed is not a mock!"); in shouldValidateMockWhenVerifyingNoInteractions()
[all …]
/external/mockito/src/main/java/org/mockito/internal/creation/bytebuddy/
DInlineDelegateByteBuddyMockMaker.java21 import org.mockito.mock.MockCreationSettings;
45 * Agent and subclass based mock maker.
47 …* This mock maker which uses a combination of the Java instrumentation API and sub-classing rather…
48 …* a new sub-class to create a mock. This way, it becomes possible to mock final types and methods.…
49 …* maker <strong>must to be activated explicitly</strong> for supporting mocking final types and me…
52 …* This mock maker can be activated by creating the file <code>/mockito-extensions/org.mockito.plug…
53 …* containing the text <code>mock-maker-inline</code> or <code>org.mockito.internal.creation.bytebu…
56 …* This mock maker will make a best effort to avoid subclass creation when creating a mock. Otherwi…
57 ….internal.creation.bytebuddy.SubclassByteBuddyMockMaker</code> to create the mock class. That means
62 * assert mock(Foo.class).getClass() == Foo.class;
[all …]
DSubclassByteBuddyMockMaker.java16 import org.mockito.mock.MockCreationSettings;
19 * Subclass based mock maker.
21 …* This mock maker tries to create a subclass to represent a mock. It uses the given mock settings,…
22 * the type to mock, extra interfaces, and serialization support.
25 …* The type to mock has to be not final and not part of the JDK. THe created mock will implement ex…
56 "ClassCastException occurred while creating the mockito mock :", in createMock()
57 " class to mock : " + describeClass(settings.getTypeToMock()), in createMock()
62 … "You might experience classloading issues, please ask the mockito mailing-list.", in createMock()
67 "Unable to create mock instance of type '" in createMock()
90 MockCreationSettings<T> settings, T mock) { in ensureMockIsAssignableToMockedType() argument
[all …]
DByteBuddyCrossClassLoaderSerializationSupport.java28 import org.mockito.mock.MockCreationSettings;
29 import org.mockito.mock.MockName;
30 import org.mockito.mock.SerializableMode;
34 …* This is responsible for serializing a mock, it is enabled if the mock is implementing {@link Ser…
38 * if the mock settings is set to be serializable the mock engine will implement the
48 …* knowledge on how to serialize a mockito mock that is based on ByteBuddy and will ignore othe…
51 * <p><strong>Only one instance per mock! See {@link MockMethodInterceptor}</strong></p>
73 …* <p>When first entering in this method, it's because some is serializing the mock, with s…
76 * objectOutputStream.writeObject(mock);
80 … execute it, which is wanted to replace the mock by another type that will encapsulate the actu…
[all …]
/external/mockito/src/main/java/org/mockito/plugins/
DMockMaker.java10 import org.mockito.mock.MockCreationSettings;
21 * <p>By default, an internal byte-buddy/asm/objenesis based implementation is used.</p>
24 * and avoid using the default byte-buddy/asm/objenesis implementation.
32 * <ol style="list-style-type: lower-alpha">
38 …* A file "<code>mockito-extensions/org.mockito.plugins.MockMaker</code>". The content of t…
45 …* <p>Note that if several <code>mockito-extensions/org.mockito.plugins.MockMaker</code> files exis…
48 * @see org.mockito.mock.MockCreationSettings
66 * @param settings Mock creation settings like type to mock, extra interfaces and so on.
70 * @param <T> Type of the mock to return, actually the <code>settings.getTypeToMock</code>.
71 * @return The mock instance.
[all …]
/external/dexmaker/dexmaker-mockito-inline-extended/src/main/java/com/android/dx/mockito/inline/
DInlineStaticMockMaker.java8 * http://www.apache.org/licenses/LICENSE-2.0
25 import org.mockito.mock.MockCreationSettings;
39 * Creates mock markers and adds stubbing hooks to static method
60 * One time setup to allow the system to mocking via this mock maker.
70 throw new IllegalStateException("Mockito could not self-attach a jvmti agent to " +
79 // https://android-developers.googleblog.com/2018/02/
80 // improving-stability-by-reducing-usage.html
111 * All currently active mock markers. We modify the class's byte code. Some objects of the class
124 * Create a new mock maker.
128 throw new RuntimeException("Could not initialize inline mock maker.\n" + "\n" + in InlineStaticMockMaker()
[all …]
/external/mockito/src/main/java/org/mockito/
DMockitoFramework.java94 * This method is only meaningful if inline mock maker is in use.
95 * Otherwise this method is a no-op and need not be used.
101 …* To find out why inline mock maker keeps track of the mock objects see {@link org.mockito.plugins…
106 … * If you're using a different {@link org.mockito.plugins.MockMaker} then this method is a no-op.
131 * Clears up internal state of specific inline mock.
132 * This method is a single-mock variant of {@link #clearInlineMocks()}.
135 * @param mock to clear up
139 void clearInlineMock(Object mock); in clearInlineMock() argument
DMockito.java23 import org.mockito.mock.SerializableMode;
42 * The Mockito library enables mock creation, verification and stubbing.
48 * It motivates Mockito developers to keep documentation up-to-date with the code that they write,
56 * <a href="#0.2">0.2 Configuration-free inline mock making</a><br/>
63 * <a href="#7">7. Making sure interaction(s) never happened on mock </a><br/>
65 * <a href="#9">9. Shorthand for mocks creation - <code>&#064;Mock</code> annotation </a><br/>
66 * <a href="#10">10. Stubbing consecutive calls (iterator-style stubbing) </a><br/>
80 * <a href="#24">24. One-liner stubs (Since 1.9.0)</a><br/>
103 * <a href="#47">47. New API for clearing mock state in inline mocking (Since 2.25.0)</a><br/>
117 …* see '<a href="https://github.com/mockito/mockito/wiki/What%27s-new-in-Mockito-2">What's new in M…
[all …]
DMockitoAnnotations.java21 * <li>Minimizes repetitive mock creation code.</li>
23 … the verification error easier to read because <b>field name</b> is used to identify the mock.</li>
29 * &#064;Mock private ArticleCalculator calculator;
30 * &#064;Mock private ArticleDatabase database;
31 * &#064;Mock private UserProvider userProvider;
60 …* You can also put openMocks() in your JUnit runner (&#064;RunWith) or use built-in runner: {@link…
61 …thod mocks are used, it is required to close the initialization. Additionally, if using third-party
62 * mock-makers, other life-cycles might be handled by the open-release routine.
68 …* &#064;{@link org.mockito.Mock}, &#064;{@link Spy}, &#064;{@link Captor}, &#064;{@link InjectMoc…
77 …"testClass cannot be null. For info how to use @Mock annotations see examples in javadoc for Mocki… in openMocks()
[all …]
/external/rust/android-crates-io/crates/tower/src/balance/pool/
Dtest.rs4 use tower_test::{assert_request_eq, mock};
11 let (mock, handle) = mock::pair::<(), load::Constant<mock::Mock<(), &'static str>, usize>>(); in basic()
14 let mut pool = mock::Spawn::new(Builder::new().build(mock, ())); in basic()
18 let (svc1_m, svc1) = mock::pair(); in basic()
35 let (mock, handle) = mock::pair::<(), load::Constant<mock::Mock<(), &'static str>, usize>>(); in high_load()
42 .build(mock, ()); in high_load()
43 let mut pool = mock::Spawn::new(pool); in high_load()
47 let (svc1_m, svc1) = mock::pair(); in high_load()
60 // it should ask the maker for another service, so we give it one in high_load()
61 let (svc2_m, svc2) = mock::pair(); in high_load()
[all …]
/external/mockito/subprojects/android/src/main/java/org/mockito/android/internal/creation/
DAndroidByteBuddyMockMaker.java11 import org.mockito.mock.MockCreationSettings;
27 "You included the 'mockito-android' dependency in a non-Android environment.", in AndroidByteBuddyMockMaker()
28 …"The Android mock maker was disabled. You should only include the latter in your 'androidTestCompi… in AndroidByteBuddyMockMaker()
29 …"If disabling was a mistake, you can set the 'org.mockito.mock.android' property to 'true' to over… in AndroidByteBuddyMockMaker()
31 …"Visit https://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/Mockito.html#0.1 for mo… in AndroidByteBuddyMockMaker()
43 public MockHandler getHandler(Object mock) { in getHandler() argument
44 return delegate.getHandler(mock); in getHandler()
48 public void resetMock(Object mock, MockHandler newHandler, MockCreationSettings settings) { in resetMock() argument
49 delegate.resetMock(mock, newHandler, settings); in resetMock()
/external/mockito/src/main/java/org/mockito/internal/configuration/plugins/
DDefaultMockitoPlugins.java22 static final String INLINE_ALIAS = "mock-maker-inline";
23 static final String PROXY_ALIAS = "mock-maker-proxy";
24 static final String MODULE_ALIAS = "member-accessor-module";
27 // Keep the mapping: plugin interface name -> plugin implementation class name
/external/dexmaker/dexmaker-mockito-inline/src/main/java/com/android/dx/mockito/inline/
DInlineDexmakerMockMaker.java8 * http://www.apache.org/licenses/LICENSE-2.0
31 import org.mockito.mock.MockCreationSettings;
53 * Generates mock instances on Android's runtime that can mock final methods.
82 * One time setup to allow the system to mocking via this mock maker.
113 "Mockito could not self-attach a jvmti agent to the current VM. This "
122 // https://android-developers.googleblog.com/2018/02/
123 // improving-stability-by-reducing-usage.html
176 * Create a new mock maker.
181 "Could not initialize inline mock maker.\n" in InlineDexmakerMockMaker()
251 T mock; in createMock() local
[all …]
/external/dexmaker/dexmaker-mockito-tests/src/main/java/com/android/dx/mockito/tests/
DCleanStackTrace.java8 * http://www.apache.org/licenses/LICENSE-2.0
23 import static org.mockito.Mockito.mock;
43 TestAbstractClass t = mock(TestAbstractClass.class); in cleanStackTraceAbstractClass()
59 TestClass t = mock(TestClass.class); in cleanStackTraceRegularClass()
67 // Depending on the mock maker TestClass.returnA might be in the stack trace or not in cleanStackTraceRegularClass()
82 TestInterface t = mock(TestInterface.class); in cleanStackTraceInterface()
/external/aws-sdk-java-v2/core/http-auth-aws/src/test/resources/mockito-extensions/
Dorg.mockito.plugins.MockMaker1 mock-maker-inline
/external/dokka/core/src/test/resources/mockito-extensions/
Dorg.mockito.plugins.MockMaker1 mock-maker-inline
/external/mockito-kotlin/ops/
Dorg.mockito.plugins.MockMaker1 mock-maker-inline
DmockMakerInline.sh3 set -ev
5 if [ ${MOCK_MAKER} = "mock-maker-inline" ]; then
6 mkdir -p tests/src/test/resources/mockito-extensions
7 cp ops/org.mockito.plugins.MockMaker tests/src/test/resources/mockito-extensions/
/external/mockito/subprojects/inline/src/main/resources/mockito-extensions/
Dorg.mockito.plugins.MockMaker1 mock-maker-inline
/external/mockito/src/main/java/org/mockito/internal/util/
DMockUtil.java15 import org.mockito.mock.MockCreationSettings;
16 import org.mockito.mock.MockName;
41 T mock; in createMock() local
43 mock = in createMock()
47 () -> { in createMock()
53 mock = mockMaker.createMock(settings, mockHandler); in createMock()
56 return mock; in createMock()
59 public static void resetMock(Object mock) { in resetMock() argument
60 MockHandler oldHandler = getMockHandler(mock); in resetMock()
64 mock = resolve(mock); in resetMock()
[all …]
/external/mockito/subprojects/inline/
Dinline.gradle1 description = "Mockito preconfigured inline mock maker (intermediate and to be superseeded by autom…
3 apply from: "$rootDir/gradle/java-library.gradle"
19 jvmArgs '--illegal-access=deny'
/external/mockito/src/main/java/org/mockito/internal/creation/proxy/
DProxyMockMaker.java12 import org.mockito.mock.MockCreationSettings;
25 …* A mock maker that is using the {@link Proxy} utility and is therefore only capable of mocking in…
80 public MockHandler getHandler(Object mock) { in getHandler() argument
81 if (!Proxy.isProxyClass(mock.getClass())) { in getHandler()
84 InvocationHandler handler = Proxy.getInvocationHandler(mock); in getHandler()
92 public void resetMock(Object mock, MockHandler newHandler, MockCreationSettings settings) { in resetMock() argument
93 ((MockInvocationHandler) Proxy.getInvocationHandler(mock)).handler.set(newHandler); in resetMock()
106 return mockable() ? "" : "non-interface"; in isTypeMockable()
143 … + "non-official API or the current functionality is not supported",
/external/mockito/src/main/java/org/mockito/internal/exceptions/
DReporter.java36 import org.mockito.mock.SerializableMode;
52 "Mocking methods declared on non-public parent classes is not supported.";
73 " when(mock.isOk()).thenReturn(true);", in unfinishedStubbing()
74 " when(mock.isOk()).thenThrow(exception);", in unfinishedStubbing()
75 " doThrow(exception).when(mock).someVoidMethod();", in unfinishedStubbing()
79 …" 3. you are stubbing the behaviour of another mock inside before 'thenReturn' instruction is comp… in unfinishedStubbing()
91 … " when(mock.isOk()).thenReturn(true).thenReturn(false).thenThrow(exception);", in incorrectUseOfApi()
92 " when(mock.isOk()).thenReturn(true, false).thenThrow(exception);", in incorrectUseOfApi()
99 "when() requires an argument which has to be 'a method call on a mock'.", in missingMethodInvocation()
101 " when(mock.getArticles()).thenReturn(articles);", in missingMethodInvocation()
[all …]
/external/cronet/tot/net/quic/
Dbidirectional_stream_quic_impl_unittest.cc2 // Use of this source code is governed by a BSD-style license that can be
131 loop_->Quit(); in OnStreamReady()
140 loop_->Quit(); in OnHeadersReceived()
154 data_received_.append(read_buf_->data(), bytes_read); in OnDataRead()
163 loop_->Quit(); in OnDataSent()
172 loop_->Quit(); in OnTrailersReceived()
183 loop_->Quit(); in OnFailed()
191 stream_->Start(request_info, net_log, send_request_headers_automatically_, in Start()
198 stream_->SendRequestHeaders(); in SendRequestHeaders()
212 stream_->SendvData(data, lengths, end_of_stream); in SendvData()
[all …]

12