Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 152 for mock (0.22 sec)

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

                  public T apply(Object delegate) {
                    T mock = mock(forwarderClass, CALLS_REAL_METHODS);
                    try {
                      T stubber = doReturn(delegate).when(mock);
                      DELEGATE_METHOD.invoke(stubber);
                    } catch (Exception e) {
                      throw new RuntimeException(e);
                    }
                    return mock;
                  }
                });
      }
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Jan 05 19:41:03 GMT 2023
    - 2.5K bytes
    - Viewed (0)
  2. android/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 26 12:43:10 GMT 2024
    - Last Modified: Wed Dec 16 19:54:45 GMT 2020
    - 7.6K bytes
    - Viewed (0)
  3. 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)
  4. android/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 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3.3K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/util/concurrent/ForwardingObjectTester.java

                  public T apply(Object delegate) {
                    T mock = mock(forwarderClass, CALLS_REAL_METHODS);
                    try {
                      T stubber = doReturn(delegate).when(mock);
                      DELEGATE_METHOD.invoke(stubber);
                    } catch (Exception e) {
                      throw new RuntimeException(e);
                    }
                    return mock;
                  }
                });
      }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Jan 05 19:41:03 GMT 2023
    - 2.5K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/io/CloseablesTest.java

        // 'swallowException' when the mock does not throw an exception.
        setupCloseable(false);
        doClose(mockCloseable, false, false);
    
        setupCloseable(false);
        doClose(mockCloseable, true, false);
      }
    
      public void testClose_closeableWithEatenException() throws IOException {
        // make sure that no exception is thrown if 'swallowException' is true
        // when the mock does throw an exception.
        setupCloseable(true);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4K bytes
    - Viewed (0)
  7. 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)
  8. maven-core/src/test/java/org/apache/maven/graph/DefaultGraphBuilderTest.java

        private final ProjectBuilder projectBuilder = mock(ProjectBuilder.class);
        private final MavenSession session = mock(MavenSession.class);
        private final MavenExecutionRequest mavenExecutionRequest = mock(MavenExecutionRequest.class);
    
        private final ProjectsSelector projectsSelector = new DefaultProjectsSelector(projectBuilder);
    
        // Not using mocks for these strategies - a mock would just copy the actual implementation.
    
    Java
    - Registered: Sun Apr 28 03:35:10 GMT 2024
    - Last Modified: Tue Dec 05 09:23:26 GMT 2023
    - 27.8K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/io/CloseablesTest.java

        // 'swallowException' when the mock does not throw an exception.
        setupCloseable(false);
        doClose(mockCloseable, false, false);
    
        setupCloseable(false);
        doClose(mockCloseable, true, false);
      }
    
      public void testClose_closeableWithEatenException() throws IOException {
        // make sure that no exception is thrown if 'swallowException' is true
        // when the mock does throw an exception.
        setupCloseable(true);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4K bytes
    - Viewed (0)
  10. 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)
Back to top