本文整理汇总了Java中com.google.common.testing.NullPointerTester.testAllPublicStaticMethods方法的典型用法代码示例。如果您正苦于以下问题:Java NullPointerTester.testAllPublicStaticMethods方法的具体用法?Java NullPointerTester.testAllPublicStaticMethods怎么用?Java NullPointerTester.testAllPublicStaticMethods使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.testing.NullPointerTester
的用法示例。
在下文中一共展示了NullPointerTester.testAllPublicStaticMethods方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testNullPointers
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@GwtIncompatible // NullPointerTester
public void testNullPointers() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(Joiner.class);
tester.testInstanceMethods(Joiner.on(","), NullPointerTester.Visibility.PACKAGE);
tester.testInstanceMethods(Joiner.on(",").skipNulls(), NullPointerTester.Visibility.PACKAGE);
tester.testInstanceMethods(
Joiner.on(",").useForNull("x"), NullPointerTester.Visibility.PACKAGE);
tester.testInstanceMethods(
Joiner.on(",").withKeyValueSeparator("="), NullPointerTester.Visibility.PACKAGE);
}
示例2: testNullPointers
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@GwtIncompatible // NullPointerTester
public void testNullPointers() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicConstructors(MinMaxPriorityQueue.class);
tester.testAllPublicStaticMethods(MinMaxPriorityQueue.class);
tester.testAllPublicInstanceMethods(MinMaxPriorityQueue.<String>create());
}
示例3: testNullPointers
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@GwtIncompatible // NullPointerTester
public void testNullPointers() {
NullPointerTester npTester = new NullPointerTester();
npTester.testAllPublicConstructors(Optional.class);
npTester.testAllPublicStaticMethods(Optional.class);
npTester.testAllPublicInstanceMethods(Optional.absent());
npTester.testAllPublicInstanceMethods(Optional.of("training"));
}
示例4: null_parameters_are_invalid
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@Test
public void null_parameters_are_invalid() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicConstructors(ClusterClients.class);
tester.testAllPublicStaticMethods(ClusterClients.class);
}
示例5: testNullPointers
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
public void testNullPointers() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(Range.class);
tester.testAllPublicStaticMethods(Range.class);
tester.testAllPublicInstanceMethods(Range.all());
tester.testAllPublicInstanceMethods(Range.open(1, 3));
}
示例6: testNullPointers
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@GwtIncompatible // NullPointerTester
public void testNullPointers() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(Splitter.class);
tester.testAllPublicInstanceMethods(Splitter.on(','));
tester.testAllPublicInstanceMethods(Splitter.on(',').trimResults());
}
示例7: testNulls
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@Test public void testNulls() {
NullPointerTester tester = new NullPointerTester();
asList(BiStream.class.getDeclaredMethods()).stream()
.filter(m -> m.getName().equals("of")
|| m.getName().equals("append") && m.getParameterTypes().length == 2)
.forEach(tester::ignore);
tester.testAllPublicStaticMethods(BiStream.class);
tester.testAllPublicInstanceMethods(BiStream.empty());
}
示例8: testChecksForNull
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
public void testChecksForNull() throws Exception {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicInstanceMethods(new HashingInputStream(Hashing.md5(), buffer));
tester.testAllPublicStaticMethods(HashingInputStream.class);
tester.testAllPublicConstructors(HashingInputStream.class);
}
示例9: testNullArguments
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@GwtIncompatible // NullPointerTester
public void testNullArguments() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(CaseFormat.class);
for (CaseFormat format : CaseFormat.values()) {
tester.testAllPublicInstanceMethods(format);
}
}
示例10: testNullPointerExceptions
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@GwtIncompatible // NullPointerTester
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);
}
示例11: testNullPointer
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@GwtIncompatible // com.google.common.testing.NullPointerTester
public void testNullPointer() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicConstructors(MediaType.class);
tester.testAllPublicStaticMethods(MediaType.class);
tester.testAllPublicInstanceMethods(MediaType.parse("text/plain"));
}
示例12: testNullPointerExceptions
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@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());
}
示例13: testNullPointerExceptions
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@GwtIncompatible // NullPointerTester
public void testNullPointerExceptions() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(Collections2.class);
}
示例14: testNulls
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
public void testNulls() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(InetAddresses.class);
}
示例15: testNullPointerExceptions
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@GwtIncompatible // NullPointerTester
public void testNullPointerExceptions() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(ObjectArrays.class);
}