Package com.google.common.testing

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


    NullPointerTester tester = new NullPointerTester();
    tester.setDefault(BigInteger.class, ONE);
    tester.setDefault(RoundingMode.class, FLOOR);
    tester.setDefault(int.class, 1);
    tester.setDefault(long.class, 1L);
    tester.testAllPublicStaticMethods(BigIntegerMath.class);
  }
}
View Full Code Here


  }

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

    tester.testAllPublicStaticMethods(HostSpecifier.class);
    tester.testAllPublicInstanceMethods(HostSpecifier.fromValid("google.com"));
  }

  private void assertGood(String spec) throws ParseException {
    HostSpecifier.fromValid(spec)// Throws exception if not working correctly
View Full Code Here

  @GwtIncompatible("NullPointerTester")
  public void testNulls() throws Exception {
    final NullPointerTester tester = new NullPointerTester();

    tester.testAllPublicStaticMethods(InternetDomainName.class);
    tester.testAllPublicInstanceMethods(InternetDomainName.from("google.com"));
  }

}
View Full Code Here

  @GwtIncompatible("com.google.common.testing.NullPointerTester")
  public void testNullPointer() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicConstructors(MediaType.class);
    tester.testAllPublicStaticMethods(MediaType.class);
    tester.testAllPublicInstanceMethods(MediaType.parse("text/plain"));
  }

  public void testToString() {
    assertEquals("text/plain", MediaType.create("text", "plain").toString());
View Full Code Here

 
  public void testNullPointers() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    tester.setDefault(RoundingMode.class, FLOOR);
    tester.setDefault(double.class, 3.0);
    tester.testAllPublicStaticMethods(DoubleMath.class);
  }
}
View Full Code Here

  }

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

  @SuppressWarnings("unchecked") // varargs
  @GwtIncompatible("SerializbleTester")
  public void testCascadingSerialization() throws Exception {
View Full Code Here

  @GwtIncompatible("NullPointerTester")
  public void testNullPointers() throws Exception {
    NullPointerTester npTester = new NullPointerTester();
    npTester.testAllPublicConstructors(Optional.class);
    npTester.testAllPublicStaticMethods(Optional.class);
    npTester.testAllPublicInstanceMethods(Optional.absent());
    npTester.testAllPublicInstanceMethods(Optional.of("training"));
  }
}
View Full Code Here

  }

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

  public void testForMapWithoutDefault() {
    Map<String, Integer> map = Maps.newHashMap();
    map.put("One", 1);
View Full Code Here

  }

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

  private static final Object IGNORE_ME = new Object() {
    @Override public String toString() {
      fail();
View Full Code Here

  @GwtIncompatible("NullPointerTester")
  public void testNullPointers() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    tester.setDefault(int.class, 1);
    tester.setDefault(RoundingMode.class, FLOOR);
    tester.testAllPublicStaticMethods(IntMath.class);
  }
}
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.