Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for ArbitraryInstances (0.21 sec)

  1. guava-testlib/src/com/google/common/testing/ArbitraryInstances.java

     *
     * @author Kevin Bourrillion
     * @author Ben Yu
     * @since 12.0
     */
    @GwtIncompatible
    @J2ktIncompatible
    @ElementTypesAreNonnullByDefault
    public final class ArbitraryInstances {
    
      private static final Ordering<Field> BY_FIELD_NAME =
          new Ordering<Field>() {
            @Override
            public int compare(Field left, Field right) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 21.2K bytes
    - Viewed (0)
  2. android/guava-testlib/src/com/google/common/testing/ArbitraryInstances.java

     *
     * @author Kevin Bourrillion
     * @author Ben Yu
     * @since 12.0
     */
    @GwtIncompatible
    @J2ktIncompatible
    @ElementTypesAreNonnullByDefault
    public final class ArbitraryInstances {
    
      private static final Ordering<Field> BY_FIELD_NAME =
          new Ordering<Field>() {
            @Override
            public int compare(Field left, Field right) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 20.8K bytes
    - Viewed (0)
  3. android/guava-testlib/test/com/google/common/testing/ArbitraryInstancesTest.java

        assertTrue(ArbitraryInstances.get(NavigableMap.class).isEmpty());
        assertTrue(ArbitraryInstances.get(LinkedList.class).isEmpty());
        assertTrue(ArbitraryInstances.get(Deque.class).isEmpty());
        assertTrue(ArbitraryInstances.get(Queue.class).isEmpty());
        assertTrue(ArbitraryInstances.get(PriorityQueue.class).isEmpty());
        assertTrue(ArbitraryInstances.get(BitSet.class).isEmpty());
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 21.8K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/base/PreconditionsTest.java

    import com.google.common.annotations.J2ktIncompatible;
    import com.google.common.collect.ImmutableList;
    import com.google.common.collect.ImmutableSet;
    import com.google.common.collect.Lists;
    import com.google.common.testing.ArbitraryInstances;
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.List;
    import junit.framework.AssertionFailedError;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Sep 17 18:14:12 UTC 2024
    - 19K bytes
    - Viewed (0)
  5. android/guava-testlib/src/com/google/common/testing/ClassSanityTester.java

        T defaultValue = (T) defaultValues.getInstance(rawType);
        if (defaultValue != null) {
          return defaultValue;
        }
        @SuppressWarnings("unchecked") // ArbitraryInstances always returns generics-safe dummies.
        T value = (T) ArbitraryInstances.get(rawType);
        if (value != null) {
          return value;
        }
        if (rawType.isInterface()) {
          return new SerializableDummyProxy(this).newProxy(type);
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 23 14:18:12 UTC 2024
    - 32.7K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java

        }
        return params;
      }
    
      private static final ImmutableSet<String> NOT_WORKING_ON_MOCKS =
          ImmutableSet.of("latestPermitAgeSec", "setRate", "getAvailablePermits");
    
      // We would use ArbitraryInstances, but it returns 0, invalid for many RateLimiter methods.
      private static final ImmutableClassToInstanceMap<Object> PARAMETER_VALUES =
          ImmutableClassToInstanceMap.builder()
              .put(int.class, 1)
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Oct 21 14:28:19 UTC 2024
    - 21.8K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java

        }
        return params;
      }
    
      private static final ImmutableSet<String> NOT_WORKING_ON_MOCKS =
          ImmutableSet.of("latestPermitAgeSec", "setRate", "getAvailablePermits");
    
      // We would use ArbitraryInstances, but it returns 0, invalid for many RateLimiter methods.
      private static final ImmutableClassToInstanceMap<Object> PARAMETER_VALUES =
          ImmutableClassToInstanceMap.builder()
              .put(int.class, 1)
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Oct 21 14:28:19 UTC 2024
    - 21.8K bytes
    - Viewed (0)
  8. android/guava-testlib/src/com/google/common/testing/NullPointerTester.java

        if (defaultValue != null) {
          return defaultValue;
        }
        @SuppressWarnings("unchecked") // All arbitrary instances are generics-safe
        T arbitrary = (T) ArbitraryInstances.get(type.getRawType());
        if (arbitrary != null) {
          return arbitrary;
        }
        if (type.getRawType() == Class.class) {
          // If parameter is Class<? extends Foo>, we return Foo.class
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jun 11 16:13:05 UTC 2024
    - 22.6K bytes
    - Viewed (0)
  9. guava-testlib/src/com/google/common/testing/NullPointerTester.java

        if (defaultValue != null) {
          return defaultValue;
        }
        @SuppressWarnings("unchecked") // All arbitrary instances are generics-safe
        T arbitrary = (T) ArbitraryInstances.get(type.getRawType());
        if (arbitrary != null) {
          return arbitrary;
        }
        if (type.getRawType() == Class.class) {
          // If parameter is Class<? extends Foo>, we return Foo.class
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jun 11 16:13:05 UTC 2024
    - 23.2K bytes
    - Viewed (0)
  10. guava-testlib/src/com/google/common/testing/FreshValueGenerator.java

      }
    
      private <T> @Nullable T defaultGenerate(Class<T> rawType) {
        if (rawType.isInterface()) {
          // always create a new proxy
          return newProxy(rawType);
        }
        return ArbitraryInstances.get(rawType);
      }
    
      private <T> T newProxy(final Class<T> interfaceType) {
        return Reflection.newProxy(interfaceType, new FreshInvocationHandler(interfaceType));
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 23 14:22:54 UTC 2024
    - 28.7K bytes
    - Viewed (0)
Back to top