Package com.google.common.testing

Examples of com.google.common.testing.NullPointerTester.testAllPublicInstanceMethods()


  public void testNullParameters() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    tester.setDefault(Callable.class, Callables.returning(null));
    CacheLoader<Object, Object> loader = identityLoader();
    tester.testAllPublicInstanceMethods(makeCache(createCacheBuilder(), loader));
  }

  // stats tests

  public void testStats() {
View Full Code Here


  @GwtIncompatible("NullPointerTester")
  public void testNullPointers() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(Splitter.class);
    tester.testAllPublicInstanceMethods(Splitter.on(","));
    tester.testAllPublicInstanceMethods(Splitter.on(",").trimResults());
  }

  private static <E> List<E> asList(Collection<E> collection){
    return ImmutableList.copyOf(collection);
View Full Code Here

  @GwtIncompatible("NullPointerTester")
  public void testNullPointers() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(Splitter.class);
    tester.testAllPublicInstanceMethods(Splitter.on(","));
    tester.testAllPublicInstanceMethods(Splitter.on(",").trimResults());
  }

  private static <E> List<E> asList(Collection<E> collection){
    return ImmutableList.copyOf(collection);
  }
View Full Code Here

    }
  }

  public void testNullParameters() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicInstanceMethods(makeLocalCache(createCacheBuilder()));
    CacheLoader<Object, Object> loader = identityLoader();
    tester.testAllPublicInstanceMethods(makeLocalCache(createCacheBuilder()));
  }

  public void testSerializationProxyLoading() {
View Full Code Here

  public void testNullParameters() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicInstanceMethods(makeLocalCache(createCacheBuilder()));
    CacheLoader<Object, Object> loader = identityLoader();
    tester.testAllPublicInstanceMethods(makeLocalCache(createCacheBuilder()));
  }

  public void testSerializationProxyLoading() {
    CacheLoader<Object, Object> loader = new SerializableCacheLoader();
    RemovalListener<Object, Object> listener = new SerializableRemovalListener<Object, Object>();
View Full Code Here

  }

  public void testNullParameters() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    Function<Object, Object> computingFunction = new IdentityLoader<Object>();
    tester.testAllPublicInstanceMethods(makeComputingMap(createMapMaker(), computingFunction));
  }

  static final class ConstantLoader<K, V> implements Function<K, V> {
    private final V constant;
View Full Code Here

    tester.setDefault(Comparable.class, 0);

    tester.testAllPublicStaticMethods(Range.class);
    tester.testAllPublicStaticMethods(Ranges.class);

    tester.testAllPublicInstanceMethods(Ranges.all());
    tester.testAllPublicInstanceMethods(Ranges.open(1, 3));
  }

}
View Full Code Here

    tester.testAllPublicStaticMethods(Range.class);
    tester.testAllPublicStaticMethods(Ranges.class);

    tester.testAllPublicInstanceMethods(Ranges.all());
    tester.testAllPublicInstanceMethods(Ranges.open(1, 3));
  }

}
View Full Code Here

  }

  @GwtIncompatible("NullPointerTester")
  public void testNullPointerExceptions() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicInstanceMethods(c);
  }

  protected Collection<String> createSample() {
    Collection<String> c = create();
    c.add("a");
View Full Code Here

  @GwtIncompatible("NullPointerTester")
  public void testNullPointers() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(ImmutableSortedMap.class);
    tester.testAllPublicInstanceMethods(
        ImmutableSortedMap.<String, Integer>naturalOrder());
    tester.testAllPublicInstanceMethods(ImmutableSortedMap.of());
    tester.testAllPublicInstanceMethods(ImmutableSortedMap.of("one", 1));
    tester.testAllPublicInstanceMethods(
        ImmutableSortedMap.of("one", 1, "two", 2, "three", 3));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.