public void testPrivateClass() { NullPointerTester tester = new NullPointerTester(); for (Constructor<?> constructor : PrivateClassWithPrivateConstructor.class.getDeclaredConstructors()) { tester.testConstructor(constructor); } }
public void testNulls() throws IOException { new NullPointerTester().testAllPublicStaticMethods(ClassPath.class); new NullPointerTester() .testAllPublicInstanceMethods(ClassPath.from(getClass().getClassLoader())); }
private static void shouldFail(Object instance, Visibility visibility) { try { new NullPointerTester().testInstanceMethods(instance, visibility); } catch (AssertionFailedError expected) { return; } fail("Should detect problem in " + instance.getClass().getSimpleName()); }
@GwtIncompatible // NullPointerTester public void testNullPointers() { new NullPointerTester().testAllPublicStaticMethods(Multisets.class); } }
@GwtIncompatible // NullPointerTester public void testNullPointerExceptions() { NullPointerTester tester = new NullPointerTester(); tester.testAllPublicStaticMethods(Functions.class); }
@GwtIncompatible // NullPointerTester public void testNulls() { new NullPointerTester().testAllPublicStaticMethods(Chars.class); } }
public void testNull() throws Exception { new NullPointerTester() .setDefault(CountDownLatch.class, new CountDownLatch(0)) .setDefault(Semaphore.class, new Semaphore(999)) .testAllPublicStaticMethods(Uninterruptibles.class); }
@GwtIncompatible // NullPointerTester public void testNullPointers() { new NullPointerTester().testAllPublicStaticMethods(Throwables.class); } }
@GwtIncompatible // NullPointerTester public void testNulls() { new NullPointerTester().testAllPublicStaticMethods(Bytes.class); } }
@GwtIncompatible // NullPointerTester public void testNullPointerExceptions() { NullPointerTester tester = new NullPointerTester(); tester.testAllPublicStaticMethods(Iterators.class); }
@GwtIncompatible // NullPointerTester public void testNullPointers() { new NullPointerTester().testAllPublicStaticMethods(GeneralRange.class); } }
@GwtIncompatible // NullPointerTester public void testNullPointers() { NullPointerTester tester = new NullPointerTester(); tester.testAllPublicStaticMethods(Strings.class); } }
public void testNulls() { for (Method method : ParameterTest.class.getDeclaredMethods()) { for (Parameter param : Invokable.from(method).getParameters()) { new NullPointerTester().testAllPublicInstanceMethods(param); } } }
@GwtIncompatible // NullPointerTester public void testContains_nulls() throws Exception { NullPointerTester tester = new NullPointerTester(); Predicate<CharSequence> isWooPattern = Predicates.contains(Pattern.compile("Woo")); tester.testAllPublicInstanceMethods(isWooPattern); }
@GwtIncompatible // NullPointerTester public void testNullPointers() { 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(ImmutableMap.of("one", 1, "two", 2, "three", 3)); }
@GwtIncompatible // NullPointerTester public void testStringConverter_nullPointerTester() throws Exception { NullPointerTester tester = new NullPointerTester(); tester.testAllPublicInstanceMethods(Longs.stringConverter()); }
@GwtIncompatible // NullPointerTester public void testNulls() { final NullPointerTester tester = new NullPointerTester(); tester.testAllPublicStaticMethods(InternetDomainName.class); tester.testAllPublicInstanceMethods(InternetDomainName.from("google.com")); } }
public void testNulls() { NullPointerTester tester = new NullPointerTester().setDefault(String.class, "HmacMD5").setDefault(Key.class, MD5_KEY); tester.testAllPublicConstructors(MacHashFunction.class); tester.testAllPublicInstanceMethods(new MacHashFunction("HmacMD5", MD5_KEY, "toString")); }
@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()); }
@GwtIncompatible // NullPointerTester public void testNullPointers() { NullPointerTester tester = new NullPointerTester(); tester.testAllPublicConstructors(MinMaxPriorityQueue.class); tester.testAllPublicStaticMethods(MinMaxPriorityQueue.class); tester.testAllPublicInstanceMethods(MinMaxPriorityQueue.<String>create()); }