Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 40 for getUnchecked (0.07 sec)

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

            };
    
        UncheckedExecutionException expected =
            assertThrows(UncheckedExecutionException.class, () -> cache.getUnchecked(new Object()));
        assertThat(expected).hasCauseThat().isEqualTo(cause);
    
        Object newValue = new Object();
        valueRef.set(newValue);
        assertSame(newValue, cache.getUnchecked(new Object()));
      }
    
      public void testGetUnchecked_unchecked() {
        final RuntimeException cause = new RuntimeException();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 5K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/cache/LoadingCache.java

      /**
       * @deprecated Provided to satisfy the {@code Function} interface; use {@link #get} or {@link
       *     #getUnchecked} instead.
       * @throws UncheckedExecutionException if an exception was thrown while loading the value. (As
       *     described in the documentation for {@link #getUnchecked}, {@code LoadingCache} should be
       *     used as a {@code Function} only with cache loaders that throw only unchecked exceptions.)
       */
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Aug 06 17:12:03 UTC 2022
    - 8.3K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/cache/CacheEvictionTest.java

                .build(loader);
    
        // 1 won't be cached
        assertThat(cache.getUnchecked(1)).isEqualTo(1);
        assertThat(cache.asMap().keySet()).isEmpty();
    
        CacheTesting.processPendingNotifications(cache);
        assertThat(removalListener.getCount()).isEqualTo(1);
    
        // 2 will be cached
        assertThat(cache.getUnchecked(2)).isEqualTo(2);
        assertThat(cache.asMap().keySet()).containsExactly(2);
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 15K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/cache/CacheLoadingTest.java

            assertThrows(UncheckedExecutionException.class, () -> cache.getUnchecked(1));
        assertThat(ue).hasCauseThat().isSameInstanceAs(e);
    
        assertEquals("1", cache.getUnchecked(1));
        assertEquals(0, removalListener.getCount());
    
        count.set(0);
        cache.refresh(2);
        checkLoggedCause(e);
    
        assertEquals("2", cache.getUnchecked(2));
        assertEquals(0, removalListener.getCount());
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 86.3K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/cache/CacheRefreshTest.java

        assertEquals(Integer.valueOf(3), cache.getUnchecked(2));
        expectedReloads++;
        assertEquals(expectedLoads, loader.getLoadCount());
        assertEquals(expectedReloads, loader.getReloadCount());
    
        ticker.advance(1, MILLISECONDS);
        assertEquals(Integer.valueOf(1), cache.getUnchecked(0));
        assertEquals(Integer.valueOf(-1), cache.getUnchecked(1));
        assertEquals(Integer.valueOf(3), cache.getUnchecked(2));
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Dec 04 17:37:03 UTC 2017
    - 3.9K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/cache/LocalLoadingCacheTest.java

        Object one = new Object();
        cache.getUnchecked(one);
        assertEquals(EMPTY_STATS, cache.stats());
    
        cache.getUnchecked(one);
        assertEquals(EMPTY_STATS, cache.stats());
    
        Object two = new Object();
        cache.getUnchecked(two);
        assertEquals(EMPTY_STATS, cache.stats());
    
        Object three = new Object();
        cache.getUnchecked(three);
        assertEquals(EMPTY_STATS, cache.stats());
      }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 12.4K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/cache/LocalLoadingCacheTest.java

        Object one = new Object();
        cache.getUnchecked(one);
        assertEquals(EMPTY_STATS, cache.stats());
    
        cache.getUnchecked(one);
        assertEquals(EMPTY_STATS, cache.stats());
    
        Object two = new Object();
        cache.getUnchecked(two);
        assertEquals(EMPTY_STATS, cache.stats());
    
        Object three = new Object();
        cache.getUnchecked(three);
        assertEquals(EMPTY_STATS, cache.stats());
      }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 12.4K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/util/concurrent/FuturesGetUncheckedTest.java

    import java.util.concurrent.Future;
    import junit.framework.TestCase;
    
    /** Unit tests for {@link Futures#getUnchecked(Future)}. */
    @GwtCompatible(emulated = true)
    public class FuturesGetUncheckedTest extends TestCase {
      public void testGetUnchecked_success() {
        assertEquals("foo", getUnchecked(immediateFuture("foo")));
      }
    
      @J2ktIncompatible
      @GwtIncompatible // Thread.interrupt
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Oct 21 15:41:36 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/util/concurrent/FuturesGetUncheckedTest.java

    import java.util.concurrent.Future;
    import junit.framework.TestCase;
    
    /** Unit tests for {@link Futures#getUnchecked(Future)}. */
    @GwtCompatible(emulated = true)
    public class FuturesGetUncheckedTest extends TestCase {
      public void testGetUnchecked_success() {
        assertEquals("foo", getUnchecked(immediateFuture("foo")));
      }
    
      @J2ktIncompatible
      @GwtIncompatible // Thread.interrupt
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Oct 21 15:41:36 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/cache/PopulatedCachesTest.java

            Object newKey = new Object();
            assertNull(cache.asMap().put(newKey, entry.getValue()));
            // this getUnchecked() call shouldn't be a cache miss; verified below
            assertEquals(newValue, cache.getUnchecked(entry.getKey()));
            assertEquals(entry.getValue(), cache.getUnchecked(newKey));
            // don't let the new entry get GCed
            warmed.add(entryOf(newKey, entry.getValue()));
          }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 02 18:21:29 UTC 2024
    - 15K bytes
    - Viewed (0)
Back to top