Home
last modified time | relevance | path

Searched refs:spy (Results 1 – 25 of 32) sorted by relevance

12

/external/mockito/src/test/java/org/mockitousage/spies/
DSpyingOnRealObjectsTest.java29 List<String> spy = Mockito.spy(list); field in SpyingOnRealObjectsTest
33 spy.add("one"); in shouldVerify()
34 spy.add("two"); in shouldVerify()
36 assertEquals("one", spy.get(0)); in shouldVerify()
37 assertEquals("two", spy.get(1)); in shouldVerify()
39 verify(spy).add("one"); in shouldVerify()
40 verify(spy).add("two"); in shouldVerify()
45 spy(new Object()); in shouldBeAbleToMockObjectBecauseWhyNot()
50 spy.add("one"); in shouldStub()
51 when(spy.get(0)) in shouldStub()
[all …]
DPartialMockingWithSpiesTest.java16 import static org.mockito.Mockito.spy;
69 Person spy = spy(new Person()); field in PartialMockingWithSpiesTest
74 String name = spy.getName(); in shouldCallRealMethdsEvenDelegatedToOtherSelfMethod()
83 when(spy.getName()).thenReturn("foo"); in shouldAllowStubbingOfMethodsThatDelegateToOtherMethods()
86 assertEquals("foo", spy.getName()); in shouldAllowStubbingOfMethodsThatDelegateToOtherMethods()
93 .when(spy).getNameButDelegateToMethodThatThrows(); in shouldAllowStubbingWithThrowablesMethodsThatDelegateToOtherMethods()
97 spy.getNameButDelegateToMethodThatThrows(); in shouldAllowStubbingWithThrowablesMethodsThatDelegateToOtherMethods()
108 spy.getNameButDelegateToMethodThatThrows(); in shouldStackTraceGetFilteredOnUserExceptions()
122 spy.getNameButDelegateToMethodThatThrows(); in verifyTheStackTrace()
128 spy.getName(); in shouldVerify()
[all …]
DStubbingSpiesDoesNotYieldNPETest.java14 import static org.mockito.Mockito.spy;
35 Foo spy = spy(foo); in shouldNotThrowNPE() local
37 spy.len(anyString()); in shouldNotThrowNPE()
38 spy.size(anyMap()); in shouldNotThrowNPE()
39 spy.size(anyList()); in shouldNotThrowNPE()
40 spy.size(anyCollection()); in shouldNotThrowNPE()
41 spy.size(anySet()); in shouldNotThrowNPE()
DSpyingOnInterfacesTest.java26 import static org.mockito.Mockito.spy;
104 Object object = spy(impl.newInstance()); in shouldAllowSpyingOnDefaultMethod()
/external/clang/tools/scan-build-py/tests/unit/
Dtest_runner.py134 spy = Spy()
135 result = sut.run_analyzer(opts, spy.call)
136 return (result, spy.arg)
212 spy = Spy()
214 self.assertEqual(spy.success,
215 sut.filter_debug_flags(opts, spy.call))
216 return spy.arg['flags']
224 spy = Spy()
225 self.assertEqual(spy.success,
226 sut.set_file_path_relative(input, spy.call))
[all …]
/external/mockito/src/test/java/org/mockitousage/annotation/
DSpyInjectionTest.java18 @Spy List<Object> spy = new LinkedList<Object>(); field in SpyInjectionTest
22 private List<?> spy; field in SpyInjectionTest.HasSpy
23 public void setSpy(List<?> spy) { in setSpy() argument
24 this.spy = spy; in setSpy()
30 MockUtil.isMock(hasSpy.spy); in shouldDoStuff()
DInjectionOfInlinedMockDeclarationTest.java15 import static org.mockito.Mockito.spy;
21 @InjectMocks private Receiver spiedReceiver = spy(new Receiver());
26 private Tuner tuner = spy(new Tuner());
/external/guava/guava-tests/test/com/google/common/io/
DAppendableWriterTest.java88 SpyAppendable spy = new SpyAppendable(); in testCloseFlush() local
89 Writer writer = new AppendableWriter(spy); in testCloseFlush()
92 assertFalse(spy.flushed); in testCloseFlush()
93 assertFalse(spy.closed); in testCloseFlush()
96 assertTrue(spy.flushed); in testCloseFlush()
97 assertFalse(spy.closed); in testCloseFlush()
100 assertTrue(spy.flushed); in testCloseFlush()
101 assertTrue(spy.closed); in testCloseFlush()
/external/mockito/src/test/java/org/mockitousage/constructor/
DCreatingMocksWithConstructorTest.java16 import static org.mockito.Mockito.spy;
50 AbstractMessage mock = spy(AbstractMessage.class); in can_spy_abstract_classes()
68 spy(HasConstructor.class); in exception_message_when_constructor_not_found()
95 spy(IMethods.class); in mocking_interfaces_with_constructor()
119 AbstractThing thing = spy(AbstractThing.class); in abstract_method_returns_default()
125 AbstractThing thing = spy(AbstractThing.class); in abstract_method_stubbed()
132 List<?> list = spy(List.class); in interface_method_stubbed()
145 SomeConcreteClass<Integer> testBug = spy(new SomeConcreteClass<Integer>()); in handles_bridge_methods_correctly()
/external/mockito/src/test/java/org/mockitousage/bugs/
DImplementationOfGenericAbstractMethodNotInvokedOnSpyTest.java6 import static org.mockito.Mockito.spy;
26 GenericAbstract<Number> spy = spy(new ImplementsGenericMethodOfAbstract<Number>()); in should_invoke_method_to_implement() local
28 assertThat(spy.public_method(73L)).isEqualTo("concrete value"); in should_invoke_method_to_implement()
/external/guava/guava-tests/test/com/google/common/util/concurrent/
DJdkFutureAdaptersTest.java59 ExecutorSpy spy = new ExecutorSpy(directExecutor()); in testListenInPoolThreadIgnoresExecutorWhenDelegateIsDone() local
61 listenInPoolThread(abstractFuture, spy); in testListenInPoolThreadIgnoresExecutorWhenDelegateIsDone()
66 assertFalse(spy.wasExecuted); in testListenInPoolThreadIgnoresExecutorWhenDelegateIsDone()
77 assertFalse(spy.wasExecuted); in testListenInPoolThreadIgnoresExecutorWhenDelegateIsDone()
87 ExecutorSpy spy = new ExecutorSpy(executorService); in testListenInPoolThreadUsesGivenExecutor() local
89 listenInPoolThread(abstractFuture, spy); in testListenInPoolThreadUsesGivenExecutor()
94 assertFalse(spy.wasExecuted); in testListenInPoolThreadUsesGivenExecutor()
103 assertTrue(spy.wasExecuted); in testListenInPoolThreadUsesGivenExecutor()
DFuturesTest.java441 ExecutorSpy spy = new ExecutorSpy(directExecutor());
443 assertFalse(spy.wasExecuted);
447 Functions.identity(), spy);
450 assertTrue(spy.wasExecuted);
454 FunctionSpy<Object, String> spy =
457 Future<String> transformed = Futures.lazyTransform(input, spy);
458 assertEquals(0, spy.getApplyCount());
460 assertEquals(1, spy.getApplyCount());
462 assertEquals(2, spy.getApplyCount());
/external/apache-commons-math/src/main/java/org/apache/commons/math/dfp/
DDfpMath.java347 Dfp[] spy = new Dfp[2]; in log() local
348 spy[0] = pow(a.getTwo(), p2); // use spy[0] temporarily as a divisor in log()
349 spx[0] = spx[0].divide(spy[0]); in log()
350 spx[1] = spx[1].divide(spy[0]); in log()
352 spy[0] = a.newInstance("1.33333"); // Use spy[0] for comparison in log()
353 while (spx[0].add(spx[1]).greaterThan(spy[0])) { in log()
364 spy = splitMult(a.getField().getLn2Split(), spx); in log()
366 spz[0] = spz[0].add(spy[0]); in log()
367 spz[1] = spz[1].add(spy[1]); in log()
371 spy = splitMult(a.getField().getLn5Split(), spx); in log()
[all …]
/external/mockito/src/test/java/org/mockito/internal/util/
DMockUtilTest.java59 assertTrue(MockUtil.isSpy(Mockito.spy(new ArrayList()))); in should_validate_spy()
60 assertTrue(MockUtil.isSpy(Mockito.spy(ArrayList.class))); in should_validate_spy()
DDefaultMockingDetailsTest.java41 assertTrue(mockingDetails(spy( new Gork())).isMock()); in should_know_spy()
42 assertTrue(mockingDetails(spy(Gork.class)).isMock()); in should_know_spy()
/external/mockito/src/test/java/org/mockitousage/basicapi/
DMocksSerializationForAnnotationTest.java258 List<Object> spy = mock(ArrayList.class, withSettings() in should_serialize_with_real_object_spy() local
262 when(spy.size()).thenReturn(100); in should_serialize_with_real_object_spy()
265 ByteArrayOutputStream serialized = serializeMock(spy); in should_serialize_with_real_object_spy()
DMocksSerializationTest.java279 List<Object> spy = mock(ArrayList.class, withSettings() in should_serialize_with_real_object_spy() local
283 when(spy.size()).thenReturn(100); in should_serialize_with_real_object_spy()
286 ByteArrayOutputStream serialized = serializeMock(spy); in should_serialize_with_real_object_spy()
/external/mockito/src/main/java/org/mockito/
DMockito.java1787 public static <T> T spy(T object) { in spy() method in Mockito
1821 public static <T> T spy(Class<T> classToSpy) { in spy() method in Mockito
/external/mockito/src/test/java/org/mockitousage/misuse/
DSpyStubbingMisuseTest.java20 Producer out = spy(new Producer(mfoo)); in nestedWhenTest()
/external/mockito/src/test/java/org/mockito/internal/
DInvalidStateDetectionTest.java219 spy(new Object()); in detect()
/external/icu/icu4j/demos/src/com/ibm/icu/dev/demo/translit/resources/
DTransliterator_Kanji_English.txt259 偵>'[spy]';
5431 遉>'[spy]';
/external/svox/pico_resources/tools/LingwareBuilding/PicoLingware_source_files/pkb/en-US/
Den-US_klex.pkb1083 …sore sponsorsespoonespotDspouse)sprang3springsespurespy)squeezeestabl…
/external/curl/docs/
DTheArtOfHttpScripting598 thus makes it harder for attackers to spy on sensitive information.
/external/icu/icu4c/source/data/misc/
Dmetadata.txt1058 spy{
/external/icu/icu4j/main/shared/data/
DTransliterator_Han_Latin_Definition.txt5969 情報 < \(spy\)\-intelligence;
13848 䀡 < to\-spy\-on;
18153 詗 < to\-spy;
18268 睪 < spy\-on;
21217 偵 < spy;
27350 情報 > \(spy\)\-intelligence;
35907 間諜 > spy;
45577 䀡 > to\-spy\-on;
49991 詗 > to\-spy;
49998 覰 > to\-spy;
[all …]

12