Examples of NullPointerTester


Examples of com.google.common.testing.NullPointerTester

  }

  private static class Nested {}

  public void testNulls() throws IOException {
    new NullPointerTester().testAllPublicStaticMethods(ClassPath.class);
    new NullPointerTester()
        .testAllPublicInstanceMethods(ClassPath.from(getClass().getClassLoader()));
  }
View Full Code Here

Examples of com.google.common.testing.NullPointerTester

    return big.bitLength() <= 31;
  }

  @GwtIncompatible("NullPointerTester")
  public void testNullPointers() {
    NullPointerTester tester = new NullPointerTester();
    tester.setDefault(int.class, 1);
    tester.testAllPublicStaticMethods(IntMath.class);
  }
View Full Code Here

Examples of com.google.common.testing.NullPointerTester

    thread1.callAndAssertThrows(IllegalMonitorStateException.class, waitFor(), guard);
  }

  public void testNulls() {
    monitor.enter()// Inhibit IllegalMonitorStateException
    new NullPointerTester()
        .setDefault(TimeUnit.class, TimeUnit.SECONDS)
        .setDefault(Monitor.Guard.class, new TestGuard(true))
        .testAllPublicInstanceMethods(monitor);
  }
View Full Code Here

Examples of com.google.common.testing.NullPointerTester

    assertEquals(expectedHash, in.hash());
  }

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

    tester.testAllPublicInstanceMethods(new HashingInputStream(Hashing.md5(), buffer));
    tester.testAllPublicStaticMethods(HashingInputStream.class);
    tester.testAllPublicConstructors(HashingInputStream.class);
  }
View Full Code Here

Examples of com.google.common.testing.NullPointerTester

* @author Erik Kline
*/
public class InetAddressesTest extends TestCase {

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

    tester.testAllPublicStaticMethods(InetAddresses.class);
  }
View Full Code Here

Examples of com.google.common.testing.NullPointerTester

    SerializableTester.reserializeAndAssert(Optional.of("foo"));
  }

  @GwtIncompatible("NullPointerTester")
  public void testNullPointers() {
    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

Examples of com.google.common.testing.NullPointerTester

    return InternetDomainName.from(domain);
  }

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

    tester.testAllPublicStaticMethods(InternetDomainName.class);
    tester.testAllPublicInstanceMethods(InternetDomainName.from("google.com"));
  }
View Full Code Here

Examples of com.google.common.testing.NullPointerTester

        new DontStringMeBro(), null, new DontStringMeBro()));
  }

  @GwtIncompatible("NullPointerTester")
  public void testNullPointers() {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(Joiner.class);
    tester.testInstanceMethods(Joiner.on(","), NullPointerTester.Visibility.PACKAGE);
    tester.testInstanceMethods(Joiner.on(",").skipNulls(), NullPointerTester.Visibility.PACKAGE);
    tester.testInstanceMethods(
        Joiner.on(",").useForNull("x"), NullPointerTester.Visibility.PACKAGE);
    tester.testInstanceMethods(
        Joiner.on(",").withKeyValueSeparator("="), NullPointerTester.Visibility.PACKAGE);
  }
View Full Code Here

Examples of com.google.common.testing.NullPointerTester

    assertEquals("null [5, 6]", Preconditions.format(null, 5, 6));
  }

  @GwtIncompatible("NullPointerTester")
  public void testNullPointers() {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(Preconditions.class);
  }
View Full Code Here

Examples of com.google.common.testing.NullPointerTester

    }
  }

  @GwtIncompatible("NullPointerTester")
  public void testNullPointerExceptions() {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(Ordering.class);

    // any Ordering<Object> instance that accepts nulls should be good enough
    tester.testAllPublicInstanceMethods(Ordering.usingToString().nullsFirst());
  }
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.