Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 105 for mock (0.15 sec)

  1. android/guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java

        MockExecutor mock = new MockExecutor();
        TestExecutor testExecutor = new TestExecutor(mock);
        assertFalse(testExecutor.awaitTermination(10, TimeUnit.MILLISECONDS));
        mock.assertLastMethodCalled("awaitTermination");
        assertFalse(testExecutor.isTerminated());
        mock.assertLastMethodCalled("isTerminated");
        assertFalse(testExecutor.isShutdown());
        mock.assertLastMethodCalled("isShutdown");
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Jan 05 19:41:03 GMT 2023
    - 9.8K bytes
    - Viewed (0)
  2. 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 19 12:43:09 GMT 2024
    - Last Modified: Mon Apr 17 12:41:04 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  3. android/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 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 28.2K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/util/concurrent/WrappingScheduledExecutorServiceTest.java

          };
    
      public void testSchedule() {
        MockExecutor mock = new MockExecutor();
        TestExecutor testExecutor = new TestExecutor(mock);
    
        @SuppressWarnings("unused") // https://errorprone.info/bugpattern/FutureReturnValueIgnored
        Future<?> possiblyIgnoredError = testExecutor.schedule(DO_NOTHING, 10, TimeUnit.MINUTES);
        mock.assertLastMethodCalled("scheduleRunnable", 10, TimeUnit.MINUTES);
    
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Wed Dec 16 19:54:45 GMT 2020
    - 7.6K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/hash/HashingInputStreamTest.java

      private ByteArrayInputStream buffer;
    
      @SuppressWarnings("DoNotMock")
      @Override
      protected void setUp() throws Exception {
        super.setUp();
        hasher = mock(Hasher.class);
        hashFunction = mock(HashFunction.class);
        buffer = new ByteArrayInputStream(testBytes);
    
        when(hashFunction.newHasher()).thenReturn(hasher);
      }
    
      public void testRead_putSingleByte() throws Exception {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Oct 02 16:24:50 GMT 2020
    - 5K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/collect/ForwardingMapTest.java

     */
    
    package com.google.common.collect;
    
    import static java.lang.reflect.Modifier.STATIC;
    import static org.mockito.ArgumentMatchers.any;
    import static org.mockito.Mockito.atLeast;
    import static org.mockito.Mockito.mock;
    import static org.mockito.Mockito.verify;
    import static org.mockito.Mockito.verifyNoMoreInteractions;
    
    import com.google.common.base.Function;
    import com.google.common.collect.testing.MapTestSuiteBuilder;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 12.7K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/collect/ForwardingMapTest.java

     */
    
    package com.google.common.collect;
    
    import static java.lang.reflect.Modifier.STATIC;
    import static org.mockito.ArgumentMatchers.any;
    import static org.mockito.Mockito.atLeast;
    import static org.mockito.Mockito.mock;
    import static org.mockito.Mockito.verify;
    import static org.mockito.Mockito.verifyNoMoreInteractions;
    
    import com.google.common.base.Function;
    import com.google.common.collect.testing.MapTestSuiteBuilder;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 12.7K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. 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 19 12:43:09 GMT 2024
    - Last Modified: Fri May 12 18:12:42 GMT 2023
    - 3K bytes
    - Viewed (0)
Back to top