use of com.google.common.testing.NullPointerTester in project google-cloud-java by GoogleCloudPlatform.
the class CloudStorageFileSystemProviderTest method testNullness.
@Test
public void testNullness() throws Exception {
try (FileSystem fs = FileSystems.getFileSystem(URI.create("gs://blood"))) {
NullPointerTester tester = new NullPointerTester();
tester.ignore(CloudStorageFileSystemProvider.class.getMethod("equals", Object.class));
tester.setDefault(URI.class, URI.create("gs://blood"));
tester.setDefault(Path.class, fs.getPath("and/one"));
tester.setDefault(OpenOption.class, CREATE);
tester.setDefault(CopyOption.class, COPY_ATTRIBUTES);
// can't do that, setStorageOptions accepts a null argument.
// TODO(jart): Figure out how to re-enable this.
// tester.testAllPublicStaticMethods(CloudStorageFileSystemProvider.class);
tester.testAllPublicInstanceMethods(new CloudStorageFileSystemProvider());
}
}
use of com.google.common.testing.NullPointerTester in project google-cloud-java by GoogleCloudPlatform.
the class CloudStorageOptionsTest method testNullness.
@Test
public void testNullness() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(CloudStorageOptions.class);
}
use of com.google.common.testing.NullPointerTester in project core-java by SpineEventEngine.
the class FieldShould method pass_the_null_tolerance_check.
@Test
public void pass_the_null_tolerance_check() {
final FieldDescriptor defaultFieldDescriptor = StringValue.getDefaultInstance().getDescriptorForType().getFields().get(0);
new NullPointerTester().setDefault(TypeUrl.class, TypeUrl.of(StringValue.class)).setDefault(FieldDescriptor.class, defaultFieldDescriptor).testAllPublicStaticMethods(Messages.class);
}
use of com.google.common.testing.NullPointerTester in project core-java by SpineEventEngine.
the class EntityColumnCacheShould method pass_null_check.
@Test
public void pass_null_check() {
new NullPointerTester().testAllPublicStaticMethods(EntityColumnCache.class);
new NullPointerTester().testAllPublicInstanceMethods(entityColumnCache);
}
use of com.google.common.testing.NullPointerTester in project core-java by SpineEventEngine.
the class EventRoutingShould method pass_null_tolerance.
@Test
public void pass_null_tolerance() {
final NullPointerTester nullPointerTester = new NullPointerTester().setDefault(EventContext.class, EventContext.getDefaultInstance());
nullPointerTester.testAllPublicInstanceMethods(eventRouting);
nullPointerTester.testAllPublicStaticMethods(EventRouting.class);
}
Aggregations