Search in sources :

Example 91 with NullPointerTester

use of com.google.common.testing.NullPointerTester in project bazel by bazelbuild.

the class DependencyTest method factoriesPassNullableTester.

@Test
public void factoriesPassNullableTester() throws Exception {
    update();
    new NullPointerTester().setDefault(Label.class, Label.parseAbsolute("//a")).setDefault(BuildConfiguration.class, getTargetConfiguration()).testAllPublicStaticMethods(Dependency.class);
}
Also used : BuildConfiguration(com.google.devtools.build.lib.analysis.config.BuildConfiguration) NullPointerTester(com.google.common.testing.NullPointerTester) Test(org.junit.Test)

Example 92 with NullPointerTester

use of com.google.common.testing.NullPointerTester in project bazel by bazelbuild.

the class ExtraDataListTest method testNulls.

@Test
public void testNulls() {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicConstructors(ExtraDataList.class);
    tester.testAllPublicInstanceMethods(new ExtraDataList());
}
Also used : NullPointerTester(com.google.common.testing.NullPointerTester) Test(org.junit.Test)

Example 93 with NullPointerTester

use of com.google.common.testing.NullPointerTester in project guava by hceylan.

the class FunctionsTest method testNullPointerExceptions.

@GwtIncompatible("NullPointerTester")
public void testNullPointerExceptions() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(Functions.class);
}
Also used : NullPointerTester(com.google.common.testing.NullPointerTester) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 94 with NullPointerTester

use of com.google.common.testing.NullPointerTester in project guava by hceylan.

the class JoinerTest method testNullPointers.

@GwtIncompatible("NullPointerTester")
public void testNullPointers() throws Exception {
    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("="));
}
Also used : NullPointerTester(com.google.common.testing.NullPointerTester) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 95 with NullPointerTester

use of com.google.common.testing.NullPointerTester in project guava by hceylan.

the class SplitterTest method testNullPointers.

@GwtIncompatible("NullPointerTester")
public void testNullPointers() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(Splitter.class);
    tester.testAllPublicInstanceMethods(Splitter.on(","));
    tester.testAllPublicInstanceMethods(Splitter.on(",").trimResults());
}
Also used : NullPointerTester(com.google.common.testing.NullPointerTester) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Aggregations

NullPointerTester (com.google.common.testing.NullPointerTester)171 GwtIncompatible (com.google.common.annotations.GwtIncompatible)100 Test (org.junit.Test)26 UnhashableObject (com.google.common.collect.testing.UnhashableObject)2 BoundedContext (io.spine.server.BoundedContext)2 FileSystem (java.nio.file.FileSystem)2 Sets.newEnumSet (com.google.common.collect.Sets.newEnumSet)1 Sets.newHashSet (com.google.common.collect.Sets.newHashSet)1 Sets.powerSet (com.google.common.collect.Sets.powerSet)1 AnEnum (com.google.common.collect.testing.AnEnum)1 SafeTreeSet (com.google.common.collect.testing.SafeTreeSet)1 ExecutionList (com.google.common.util.concurrent.ExecutionList)1 BuildConfiguration (com.google.devtools.build.lib.analysis.config.BuildConfiguration)1 FieldDescriptor (com.google.protobuf.Descriptors.FieldDescriptor)1 StringValue (com.google.protobuf.StringValue)1 TestActorRequestFactory (io.spine.client.TestActorRequestFactory)1 Command (io.spine.core.Command)1 EventEnvelope (io.spine.core.EventEnvelope)1 AnAggregateRoot (io.spine.server.aggregate.given.AggregateRootTestEnv.AnAggregateRoot)1 TestEventFactory (io.spine.server.command.TestEventFactory)1