use of com.google.common.testing.NullPointerTester in project guava by hceylan.
the class ImmutableSortedMapTest method testNullPointers.
@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));
}
use of com.google.common.testing.NullPointerTester in project guava by hceylan.
the class OrderingTest method testNullPointerExceptions.
@GwtIncompatible("NullPointerTester")
public void testNullPointerExceptions() throws Exception {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(Ordering.class);
// any Ordering<Object> instance that accepts nulls should be good enough
tester.testAllPublicInstanceMethods(Ordering.usingToString().nullsFirst());
}
use of com.google.common.testing.NullPointerTester in project guava by hceylan.
the class SetsTest method testNullPointerExceptions.
@GwtIncompatible("NullPointerTester")
public void testNullPointerExceptions() throws Exception {
NullPointerTester tester = new NullPointerTester();
tester.setDefault(Enum.class, SomeEnum.A);
// 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);
}
use of com.google.common.testing.NullPointerTester in project guava by hceylan.
the class MapMakerTest method testNullParameters.
public void testNullParameters() throws Exception {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicInstanceMethods(new MapMaker());
}
use of com.google.common.testing.NullPointerTester in project guava by hceylan.
the class MapsTest method testNullPointerExceptions.
@GwtIncompatible("NullPointerTester")
public void testNullPointerExceptions() throws Exception {
NullPointerTester tester = new NullPointerTester();
tester.setDefault(BiMap.class, ImmutableBiMap.of());
tester.setDefault(EntryTransformer.class, ALWAYS_NULL);
tester.setDefault(Equivalence.class, Equivalences.equals());
tester.setDefault(SortedMap.class, Maps.newTreeMap());
tester.testAllPublicStaticMethods(Maps.class);
}
Aggregations