Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 96 for Mock (0.15 sec)

  1. android/guava-tests/test/com/google/common/cache/ForwardingCacheTest.java

         * the type is irrelevant at runtime.
         */
        mock = mock(Cache.class);
        forward =
            new ForwardingCache<String, Boolean>() {
              @Override
              protected Cache<String, Boolean> delegate() {
                return mock;
              }
            };
      }
    
      public void testGetIfPresent() throws ExecutionException {
        when(mock.getIfPresent("key")).thenReturn(Boolean.TRUE);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 17 12:41:04 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/hash/FunnelsTest.java

        PrimitiveSink primitiveSink = mock(PrimitiveSink.class);
        Funnels.byteArrayFunnel().funnel(new byte[] {4, 3, 2, 1}, primitiveSink);
        verify(primitiveSink).putBytes(new byte[] {4, 3, 2, 1});
      }
    
      public void testForBytes_null() {
        assertNullsThrowException(Funnels.byteArrayFunnel());
      }
    
      public void testForStrings() {
        PrimitiveSink primitiveSink = mock(PrimitiveSink.class);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Oct 02 16:24:50 GMT 2020
    - 5.9K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/io/testdata/alice_in_wonderland.txt

    King, the Queen, and Alice, were in custody and under sentence of
    execution.
    
      Then the Queen left off, quite out of breath, and said to
    Alice, `Have you seen the Mock Turtle yet?'
    
      `No,' said Alice.  `I don't even know what a Mock Turtle is.'
    
      `It's the thing Mock Turtle Soup is made from,' said the Queen.
    
      `I never saw one, or heard of one,' said Alice.
    
      `Come on, then,' said the Queen, `and he shall tell you his
    Plain Text
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Mon Oct 29 21:35:03 GMT 2012
    - 145.2K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/cache/ForwardingLoadingCacheTest.java

         * the type is irrelevant at runtime.
         */
        mock = mock(LoadingCache.class);
        forward =
            new ForwardingLoadingCache<String, Boolean>() {
              @Override
              protected LoadingCache<String, Boolean> delegate() {
                return mock;
              }
            };
      }
    
      public void testGet() throws ExecutionException {
        when(mock.get("key")).thenReturn(Boolean.TRUE);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Apr 17 12:41:04 GMT 2023
    - 3.4K bytes
    - Viewed (0)
  5. android/guava-testlib/src/com/google/common/util/concurrent/testing/MockFutureListener.java

    import com.google.common.util.concurrent.ListenableFuture;
    import java.util.concurrent.CountDownLatch;
    import java.util.concurrent.ExecutionException;
    import junit.framework.Assert;
    
    /**
     * A simple mock implementation of {@code Runnable} that can be used for testing ListenableFutures.
     *
     * @author Nishant Thakkar
     * @since 10.0
     */
    @GwtIncompatible
    public class MockFutureListener implements Runnable {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri May 12 18:12:42 GMT 2023
    - 3K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java

        @Override
        public String toString() {
          return events.toString();
        }
      }
    
      @AndroidIncompatible // Mockito loses its ability to mock doGetRate as of Android 21
      public void testMockingMockito() throws Exception {
        RateLimiter mock = Mockito.mock(RateLimiter.class);
        for (Method method : RateLimiter.class.getMethods()) {
          if (!isStatic(method.getModifiers())
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.6K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/hash/HashingOutputStreamTest.java

      private final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    
      @SuppressWarnings("DoNotMock")
      @Override
      protected void setUp() throws Exception {
        super.setUp();
        hasher = mock(Hasher.class);
        hashFunction = mock(HashFunction.class);
    
        when(hashFunction.newHasher()).thenReturn(hasher);
      }
    
      public void testWrite_putSingleByte() throws Exception {
        int b = 'q';
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Oct 02 16:24:50 GMT 2020
    - 3.1K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java

      }
    
      @AndroidIncompatible // Mocking ExecutorService is forbidden there. TODO(b/218700094): Don't mock.
      public void testGetExitingExecutorService_executorDelegatesToOriginal() {
        TestApplication application = new TestApplication();
        ThreadPoolExecutor executor = mock(ThreadPoolExecutor.class);
        ThreadFactory threadFactory = mock(ThreadFactory.class);
        when(executor.getThreadFactory()).thenReturn(threadFactory);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 28.2K bytes
    - Viewed (3)
  9. guava-tests/test/com/google/common/collect/ImmutableSortedMultisetTest.java

    import static com.google.common.truth.Truth.assertThat;
    import static java.util.Arrays.asList;
    import static org.junit.Assert.assertThrows;
    import static org.mockito.Mockito.mock;
    import static org.mockito.Mockito.when;
    
    import com.google.common.collect.Multiset.Entry;
    import com.google.common.collect.testing.ListTestSuiteBuilder;
    import com.google.common.collect.testing.MinimalCollection;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 20:09:59 GMT 2024
    - 22.6K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/io/FlushablesTest.java

        // 'swallowException' when the mock does not throw an exception.
        setupFlushable(false);
        doFlush(mockFlushable, false, false);
    
        setupFlushable(false);
        doFlush(mockFlushable, true, false);
      }
    
      public void testFlush_flushableWithEatenException() throws IOException {
        // make sure that no exception is thrown if 'swallowException' is true
        // when the mock does throw an exception on flush.
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3.3K bytes
    - Viewed (0)
Back to top