Search in sources :

Example 36 with NullPointerTester

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

the class EvictingQueueTest method testNullPointerExceptions.

// NullPointerTester
@GwtIncompatible
public void testNullPointerExceptions() {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(EvictingQueue.class);
    tester.testAllPublicConstructors(EvictingQueue.class);
    EvictingQueue<String> queue = EvictingQueue.create(5);
    // The queue must be non-empty so it throws a NPE correctly
    queue.add("one");
    tester.testAllPublicInstanceMethods(queue);
}
Also used : NullPointerTester(com.google.common.testing.NullPointerTester) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 37 with NullPointerTester

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

the class Collections2Test method testNullPointerExceptions.

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

Example 38 with NullPointerTester

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

the class AtomicsTest method testNullPointers.

public void testNullPointers() {
    NullPointerTester tester = new NullPointerTester();
    // there aren't any
    tester.testAllPublicConstructors(Atomics.class);
    tester.testAllPublicStaticMethods(Atomics.class);
}
Also used : NullPointerTester(com.google.common.testing.NullPointerTester)

Example 39 with NullPointerTester

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

the class RateLimiterTest method testNulls.

public void testNulls() {
    NullPointerTester tester = new NullPointerTester().setDefault(SleepingStopwatch.class, stopwatch).setDefault(int.class, 1).setDefault(double.class, 1.0d);
    tester.testStaticMethods(RateLimiter.class, Visibility.PACKAGE);
    tester.testInstanceMethods(RateLimiter.create(stopwatch, 5.0), Visibility.PACKAGE);
}
Also used : NullPointerTester(com.google.common.testing.NullPointerTester)

Example 40 with NullPointerTester

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

the class ThreadFactoryBuilderTest method testNulls.

public void testNulls() {
    NullPointerTester npTester = new NullPointerTester();
    npTester.testAllPublicConstructors(ThreadFactoryBuilder.class);
    npTester.testAllPublicStaticMethods(ThreadFactoryBuilder.class);
    npTester.testAllPublicInstanceMethods(builder);
}
Also used : NullPointerTester(com.google.common.testing.NullPointerTester)

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