/external/mockito/src/org/mockito/ |
MockingDetails.java | 9 * For example, you can identify whether a particular object is either a mock or a spy.
18 * @return true if the object is a mock or a spy.
25 * Informs if the object is a spy.
26 * @return true if the object is a spy.
|
Spy.java | 13 * Allows shorthand wrapping of field instances in an spy object.
21 * @Spy Foo spyOnFoo = new Foo("argument");
23 * @Spy Bar spyOnBar;
35 * Foo spyOnFoo = Mockito.spy(new Foo("argument"));
36 * Bar spyOnFoo = Mockito.spy(new Bar());
40 * <strong>The field annotated with @Spy can be initialized by Mockito if a zero argument constructor
44 * <strong>The field annotated with @Spy can be initialized explicitly at declaration point.
64 * List spy = spy(list);
66 * //Impossible: real method is called so spy.get(0) throws IndexOutOfBoundsException (the list is yet empty) [all...] |
AdditionalAnswers.java | 114 * or spy using the usual spy API. Possible use cases: 123 * The difference with the regular spy: 126 * The regular spy ({@link Mockito#spy(Object)}) contains <strong>all</strong> state from the spied instance 127 * and the methods are invoked on the spy. The spied instance is only used at mock creation to copy the state from. 128 * If you call a method on a regular spy and it internally calls other methods on this spy, those calls are remembered 136 * Mock that delegates is less powerful than the regular spy but it is useful when the regular spy cannot be created [all...] |
Mockito.java | 51 * <a href="#21">21. New annotations: <code>@Captor</code>, <code>@Spy</code>, <code>@InjectMocks</code> (Since 1.8.3) </a><br/>
464 * <li>stub methods on spy objects (see below)</li>
486 * <h3 id="13">13. <a class="meaningful_link" href="#spy">Spying on real objects</a></h3>
488 * You can create spies of real objects. When you use the spy then the <b>real</b> methods are called
505 * List spy = spy(list);
508 * when(spy.size()).thenReturn(100);
510 * //using the spy calls <b>*real*</b> methods
511 * spy.add("one");
512 * spy.add("two"); 1321 public static <T> T spy(T object) { method in class:Mockito [all...] |
MockSettings.java | 84 * Specifies the instance to spy on. Makes sense only for spies/partial mocks. 103 * Foo foo = spy(fooInstance); 106 * About stubbing for a partial mock, as it is a spy it will always call the real method, unless you use the 111 * List spy = spy(list); 113 * //Impossible: real method is called so spy.get(0) throws IndexOutOfBoundsException (the list is yet empty) 114 * when(spy.get(0)).thenReturn("foo"); 117 * doReturn("foo").when(spy).get(0); 120 * @param instance to spy on
|
InjectMocks.java | 18 * <li>Allows shorthand mock and spy injection.</li>
19 * <li>Minimizes repetitive mock and spy injection.</li>
56 * @Spy private UserProvider userProvider = new ConsumerUserProvider();
134 * Again, note that @InjectMocks will only inject mocks/spies created using the @Spy or @Mock annotation.
146 * @see Spy
|
/external/mockito/src/org/mockito/internal/util/ |
DefaultMockingDetails.java | 10 * Class to inspect any object, and identify whether a particular object is either a mock or a spy. This is
24 * @return true if the object is a mock or a spy.
31 * Find out whether the object is a spy.
32 * @return true if the object is a spy.
|
MockitoSpy.java | 8 * Mark internally a Mockito spy.
|
/external/libxml2/test/schemas/ |
570702_0.xml | 2 <!-- edited with XML Spy v4.3 U (http://www.xmlspy.com) by asdf (fdsa) --> 3 <!--Sample XML file generated by XML Spy v4.3 U (http://www.xmlspy.com)-->
|
/external/guava/guava-tests/test/com/google/common/io/ |
AppendableWriterTest.java | 88 SpyAppendable spy = new SpyAppendable(); local 89 Writer writer = new AppendableWriter(spy); 92 assertFalse(spy.flushed); 93 assertFalse(spy.closed); 96 assertTrue(spy.flushed); 97 assertFalse(spy.closed); 100 assertTrue(spy.flushed); 101 assertTrue(spy.closed);
|
/external/mockito/src/org/mockito/internal/configuration/ |
SpyAnnotationEngine.java | 21 * Process fields annotated with @Spy.
24 * Will try transform the field in a spy as with <code>Mockito.spy()</code>.
49 if (field.isAnnotationPresent(Spy.class) && !field.isAnnotationPresent(InjectMocks.class)) {
50 assertNoIncompatibleAnnotations(Spy.class, field, Mock.class, org.mockito.MockitoAnnotations.Mock.class, Captor.class);
|
/external/mockito/src/org/mockito/internal/configuration/injection/ |
SpyOnInjectedFieldsHandler.java | 9 import org.mockito.Spy; 21 * Handler for field annotated with @InjectMocks and @Spy. 35 if(!fieldReader.isNull() && field.isAnnotationPresent(Spy.class)) {
|
/external/mockito/src/org/mockito/configuration/ |
AnnotationEngine.java | 13 * Configures mock creation logic behind @Mock, @Captor and @Spy annotations
23 * Creates mock, ArgumentCaptor or wraps field instance in spy object.
|
/libcore/jsr166-tests/src/test/java/jsr166/ |
Collection8Test.java | 54 Consumer<Object> spy = (o) -> { found.add(o); }; local 55 c.stream().forEach(spy); 59 c.stream().forEach(spy); 64 c.stream().forEach(spy); 71 c.stream().forEach(spy);
|
/external/guava/guava-tests/test/com/google/common/util/concurrent/ |
JdkFutureAdaptersTest.java | 59 ExecutorSpy spy = new ExecutorSpy(directExecutor()); local 61 listenInPoolThread(abstractFuture, spy); 66 assertFalse(spy.wasExecuted); 75 // 'spy' should have been ignored since 'abstractFuture' was done before 77 assertFalse(spy.wasExecuted); 87 ExecutorSpy spy = new ExecutorSpy(executorService); local 89 listenInPoolThread(abstractFuture, spy); 94 assertFalse(spy.wasExecuted); 103 assertTrue(spy.wasExecuted);
|
/external/mockito/src/org/mockito/internal/debugging/ |
VerboseMockInvocationLogger.java | 60 printStream.println("############ Logging method invocation #" + mockInvocationsCounter + " on mock/spy ########"); 65 // printStream.println("Handling method call on a mock/spy.");
|
/external/mockito/src/org/mockito/exceptions/ |
Reporter.java | 440 "Cannot mock/spy " + clazz.toString(), 441 "Mockito cannot mock/spy following:", 458 "3. A spy is stubbed using when(spy.foo()).then() syntax. It is safer to stub spies - ", 459 " - with doReturn|Throw() family of methods. More in javadocs for Mockito.spy() method.", 485 "2. A spy is stubbed using when(spy.foo()).then() syntax. It is safer to stub spies - ", 486 " - with doReturn|Throw() family of methods. More in javadocs for Mockito.spy() method.", 570 " spy = mock( ->ArrayList.class<- , withSettings().spiedInstance( ->new ArrayList()<- );", 572 " spy = mock( ->List.class<- , withSettings().spiedInstance( ->new ArrayList()<- ); [all...] |
/packages/apps/Messaging/tests/src/com/android/messaging/datamodel/media/ |
ImageRequestTest.java | 32 import org.mockito.Spy; 40 @Spy protected ImageUtils spyImageUtils; 48 spyImageUtils = Mockito.spy(new ImageUtils());
|
/external/mockito/src/org/mockito/internal/configuration/injection/scanner/ |
MockScanner.java | 9 import org.mockito.Spy; 80 return null != field.getAnnotation(Spy.class)
|
/packages/apps/Dialer/InCallUI/tests/src/com/android/incallui/ |
MockCallListWrapper.java | 20 import static org.mockito.Mockito.spy; 41 mCallList = spy(new CallList());
|
/frameworks/opt/telephony/tests/telephonytests/src/com/android/internal/telephony/ |
TestFixture.java | 28 * that the test double as returned from this method be a Mockito mock or spy, so that a test
|
/libcore/luni/src/test/resources/ |
simple.xml | 2 <!-- Edited with XML Spy v2007 (http://www.altova.com) -->
|
/packages/services/Telecomm/tests/src/com/android/server/telecom/tests/ |
TestFixture.java | 28 * that the test double as returned from this method be a Mockito mock or spy, so that a test
|
/packages/services/Telephony/tests/src/com/android/phone/vvm/omtp/scheduling/ |
BaseTaskTest.java | 21 import static org.mockito.Mockito.spy; 91 BaseTask task = spy(new DummyBaseTask());
|
/frameworks/base/tests/SoundTriggerTests/src/android/hardware/soundtrigger/stubhal/ |
GenericSoundModelTest.java | 22 import static org.mockito.Mockito.spy; 133 TestRecognitionStatusCallback spyCallback = spy(new TestRecognitionStatusCallback()); 157 TestRecognitionStatusCallback spyCallback = spy(new TestRecognitionStatusCallback()); 215 TestRecognitionStatusCallback spyCallback = spy(new TestRecognitionStatusCallback());
|