Package com.google.common.testing

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


    NullPointerTester tester = new NullPointerTester();
    tester.setDefault(BoundType.class, BoundType.OPEN);
    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


    // TODO: make NPT create empty arrays for defaults automatically
    tester.setDefault(Collection[].class, new Collection[0]);
    tester.setDefault(Enum[].class, new Enum[0]);
    tester.setDefault(Set[].class, new Set[0]);
    tester.testAllPublicStaticMethods(Sets.class);
  }

  public void testNewSetFromMap() {
    Set<Integer> set = Sets.newSetFromMap(new HashMap<Integer, Boolean>());
    set.addAll(SOME_COLLECTION);
View Full Code Here

  }

  @GwtIncompatible("NullPointerTester")
  public void testNullPointers() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(ImmutableMultiset.class);
  }

  @GwtIncompatible("SerializableTester")
  public void testSerialization_empty() {
    Collection<String> c = ImmutableMultiset.of();
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(
View Full Code Here

  }

  @GwtIncompatible("NullPointerTester")
  public void testNullPointers() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(ImmutableMap.class);
    tester.testAllPublicInstanceMethods(
        new ImmutableMap.Builder<Object, Object>());
    tester.testAllPublicInstanceMethods(ImmutableMap.of());
    tester.testAllPublicInstanceMethods(ImmutableMap.of("one", 1));
    tester.testAllPublicInstanceMethods(
View Full Code Here

  }

  public void testNullPointers() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicConstructors(MinMaxPriorityQueue.class);
    tester.testAllPublicStaticMethods(MinMaxPriorityQueue.class);
    tester.testAllPublicInstanceMethods(MinMaxPriorityQueue.<String>create());
  }

  private static void insertIntoReplica(
      Map<Integer, AtomicInteger> replica,
View Full Code Here

  public void testNullPointers() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    tester.setDefault(InvocationHandler.class, X_RETURNER);
    tester.setDefault(Type[].class, new Type[]{ Map.class });
    tester.setDefault(Type.class, String.class);
    tester.testAllPublicStaticMethods(Reflection.class);
  }
}
View Full Code Here

public class InetAddressesTest extends TestCase {

  public void testNulls() throws Exception {
    NullPointerTester tester = new NullPointerTester();

    tester.testAllPublicStaticMethods(InetAddresses.class);
  }

  public void testForStringBogusInput() {
    String[] bogusInputs = {
        "",
View Full Code Here

  }

  public void testNullPointers() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    tester.setDefault(TypeVariable.class, Types.newTypeVariable(List.class, "E"));
    tester.testAllPublicStaticMethods(TypeParameter.class);
  }
}
View Full Code Here

    NullPointerTester tester = new NullPointerTester();
    tester.setDefault(StringBuilder.class, new StringBuilder());
    // This is necessary because of the generics hackery we have to temporarily support parameters
    // which implement both Iterator and Iterable.
    tester.setDefault(Object.class, Iterators.emptyIterator());
    tester.testAllPublicStaticMethods(Joiner.class);
    tester.testAllPublicInstanceMethods(Joiner.on(","));
    tester.testAllPublicInstanceMethods(Joiner.on(",").skipNulls());
    tester.testAllPublicInstanceMethods(Joiner.on(",").useForNull("x"));
    tester.testAllPublicInstanceMethods(
        Joiner.on(",").withKeyValueSeparator("="));
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.