Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 1,013 for seconds (0.22 sec)

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

        runLatch.await();
        taskLatch.countDown();
    
        ExecutionException e =
            assertThrows(ExecutionException.class, () -> task.get(5, TimeUnit.SECONDS));
        assertEquals(IllegalStateException.class, e.getCause().getClass());
    
        assertTrue(listenerLatch.await(5, TimeUnit.SECONDS));
        assertTrue(task.isDone());
        assertFalse(task.isCancelled());
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 4.7K bytes
    - Viewed (0)
  2. guava-testlib/src/com/google/common/testing/GcFinalization.java

          return;
        }
        long timeoutSeconds = timeoutSeconds();
        long deadline = System.nanoTime() + SECONDS.toNanos(timeoutSeconds);
        do {
          System.runFinalization();
          if (future.isDone()) {
            return;
          }
          System.gc();
          try {
            future.get(1L, SECONDS);
            return;
          } catch (CancellationException | ExecutionException ok) {
            return;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  3. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/KotlinSourceModernTest.kt

        var throttleBytesPerPeriod: Long = mockResponse.throttleBytesPerPeriod
        throttleBytesPerPeriod = mockResponse.throttleBytesPerPeriod
        var throttlePeriod: Long = mockResponse.getThrottlePeriod(TimeUnit.SECONDS)
        mockResponse = mockResponse.setBodyDelay(0L, TimeUnit.SECONDS)
        val bodyDelay: Long = mockResponse.getBodyDelay(TimeUnit.SECONDS)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.3K bytes
    - Viewed (1)
  4. okhttp/src/test/java/okhttp3/CacheControlTest.kt

      }
    
      @Test
      @Throws(Exception::class)
      fun completeBuilder() {
        val cacheControl =
          CacheControl.Builder()
            .noCache()
            .noStore()
            .maxAge(1.seconds)
            .maxStale(2.seconds)
            .minFresh(3.seconds)
            .onlyIfCached()
            .noTransform()
            .immutable()
            .build()
        assertThat(cacheControl.toString()).isEqualTo(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 13:41:01 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/util/concurrent/UninterruptibleFutureTest.java

        future.set(RESULT);
        /*
         * getUninterruptibly should call the timed get method once with a
         * wait of 0 seconds (and it should succeed, since the result is already
         * available).
         */
        assertEquals(RESULT, getUninterruptibly(future, 0, SECONDS));
      }
    
      public void testMakeUninterruptible_timedGetNegativeTimeoutAttempted()
          throws TimeoutException, ExecutionException {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 9.1K bytes
    - Viewed (0)
  6. guava-testlib/src/com/google/common/util/concurrent/testing/MockFutureListener.java

     * the License.
     */
    
    package com.google.common.util.concurrent.testing;
    
    import static com.google.common.util.concurrent.MoreExecutors.directExecutor;
    import static java.util.concurrent.TimeUnit.SECONDS;
    
    import com.google.common.annotations.GwtIncompatible;
    import com.google.common.util.concurrent.ListenableFuture;
    import java.util.concurrent.CountDownLatch;
    import java.util.concurrent.ExecutionException;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri May 12 18:12:42 GMT 2023
    - 3K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/util/concurrent/FuturesGetCheckedTest.java

            "foo", getChecked(immediateFuture("foo"), TwoArgConstructorException.class, 0, SECONDS));
      }
    
      public void testGetCheckedTimed_interrupted() {
        SettableFuture<String> future = SettableFuture.create();
        Thread.currentThread().interrupt();
        try {
          getChecked(future, TwoArgConstructorException.class, 0, SECONDS);
          fail();
        } catch (TwoArgConstructorException expected) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 16.4K bytes
    - Viewed (0)
  8. okhttp-coroutines/src/test/kotlin/okhttp3/coroutines/ExecuteAsyncTest.kt

      @Test
      fun timeoutCall() {
        runTest {
          server.enqueue(
            MockResponse.Builder()
              .bodyDelay(5, TimeUnit.SECONDS)
              .body("abc")
              .build(),
          )
    
          val call = client.newCall(request)
    
          try {
            withTimeout(1.seconds) {
              call.executeAsync().use {
                withContext(Dispatchers.IO) {
                  it.body.string()
                }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/util/concurrent/SmoothRateLimiter.java

       *
       * How this works is best explained with an example:
       *
       * For a RateLimiter that produces 1 token per second, every second that goes by with the
       * RateLimiter being unused, we increase storedPermits by 1. Say we leave the RateLimiter unused
       * for 10 seconds (i.e., we expected a request at time X, but we are at time X + 10 seconds before
       * a request actually arrives; this is also related to the point made in the last paragraph), thus
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 04 09:45:04 GMT 2023
    - 19.3K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/cache/CacheBuilderTest.java

            CacheBuilder.newBuilder().refreshAfterWrite(3600, SECONDS);
        assertThrows(IllegalStateException.class, () -> builder.refreshAfterWrite(3600, SECONDS));
      }
    
      @GwtIncompatible // java.time.Duration
      public void testRefresh_setTwice_duration() {
        CacheBuilder<Object, Object> builder =
            CacheBuilder.newBuilder().refreshAfterWrite(java.time.Duration.ofSeconds(3600));
        assertThrows(
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Oct 03 20:10:02 GMT 2023
    - 25.5K bytes
    - Viewed (0)
Back to top