本文整理汇总了Java中com.google.common.testing.NullPointerTester类的典型用法代码示例。如果您正苦于以下问题:Java NullPointerTester类的具体用法?Java NullPointerTester怎么用?Java NullPointerTester使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NullPointerTester类属于com.google.common.testing包,在下文中一共展示了NullPointerTester类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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));
}
示例2: testNulls
import com.google.common.testing.NullPointerTester; //导入依赖的package包/类
public <T> void testNulls() {
new NullPointerTester()
.testAllPublicStaticMethods(TypeToken.class);
new NullPointerTester()
.setDefault(TypeParameter.class, new TypeParameter<T>() {})
.testAllPublicInstanceMethods(TypeToken.of(String.class));
}
示例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: testNullPointers
import com.google.common.testing.NullPointerTester; //导入依赖的package包/类
@GwtIncompatible // NullPointerTester
public void testNullPointers() {
NullPointerTester tester = new NullPointerTester();
tester.setDefault(BigInteger.class, ONE);
tester.setDefault(int.class, 1);
tester.setDefault(long.class, 1L);
tester.testAllPublicStaticMethods(BigIntegerMath.class);
}
示例5: testStaticNullPointers
import com.google.common.testing.NullPointerTester; //导入依赖的package包/类
@GwtIncompatible // NullPointerTester
public void testStaticNullPointers() throws Exception {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicStaticMethods(CharMatcher.class);
tester.testAllPublicInstanceMethods(CharMatcher.any());
tester.testAllPublicInstanceMethods(CharMatcher.anyOf("abc"));
}
示例6: testNullContracts
import com.google.common.testing.NullPointerTester; //导入依赖的package包/类
@Test
public void testNullContracts() throws Exception {
// given
NullPointerTester nullPointerTester = new NullPointerTester();
nullPointerTester.setDefault(VisibilityTimeoutExtenderFactory.class,
timeoutExtenderFactory);
nullPointerTester.setDefault(Queue.class, queue);
// when
nullPointerTester.testInstanceMethods(uut, NullPointerTester.Visibility.PACKAGE);
nullPointerTester.testConstructors(uut.getClass(), Visibility.PACKAGE);
}
示例7: null_parameters_are_invalid
import com.google.common.testing.NullPointerTester; //导入依赖的package包/类
@Test
public void null_parameters_are_invalid() {
NullPointerTester tester = new NullPointerTester();
tester.setDefault(ActorManagers.class, new ActorManagers());
tester.setDefault(AgentKey.class, DUMMY_AGENT);
tester.testAllPublicConstructors(Agent.class);
tester.testAllPublicInstanceMethods(agent);
}
示例8: null_parameters_are_invalid
import com.google.common.testing.NullPointerTester; //导入依赖的package包/类
@Test
public void null_parameters_are_invalid() {
NullPointerTester tester = new NullPointerTester();
tester.setDefault(ActorManagers.class, actorManagers);
tester.testAllPublicConstructors(Agents.class);
tester.testAllPublicInstanceMethods(agents);
}
示例9: null_parameters_invalid
import com.google.common.testing.NullPointerTester; //导入依赖的package包/类
@Test
public void null_parameters_invalid() {
NullPointerTester tester = new NullPointerTester();
tester.setDefault(ActorInputMessage.class, ActorInputMessage.dumpMetrics());
tester.setDefault(ActorKey.class, DUMMY_ACTOR);
tester.setDefault(AgentKey.class, TEST_AGENT);
tester.testAllPublicConstructors(JMSAgentClusterClient.class);
tester.testAllPublicInstanceMethods(client);
}
示例10: null_parameters_are_invalid
import com.google.common.testing.NullPointerTester; //导入依赖的package包/类
@Test
public void null_parameters_are_invalid() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicConstructors(JMSMetricsRepositoryListener.class);
tester.testAllPublicInstanceMethods(jmsListener);
}
示例11: null_parameters_are_invalid
import com.google.common.testing.NullPointerTester; //导入依赖的package包/类
@Test
public void null_parameters_are_invalid() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicConstructors(JMSMetricsRepositoryClusterClient.class);
tester.testAllPublicInstanceMethods(clusterClient);
}
示例12: 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"));
}
示例13: null_parameters_are_invalid
import com.google.common.testing.NullPointerTester; //导入依赖的package包/类
@Test
public void null_parameters_are_invalid() {
NullPointerTester tester = new NullPointerTester();
tester.setDefault(AgentKey.class, TEST_AGENT);
tester.testAllPublicConstructors(JMSAgentRegistrySender.class);
tester.testAllPublicInstanceMethods(sender);
}
示例14: null_parameters_are_invalid
import com.google.common.testing.NullPointerTester; //导入依赖的package包/类
@Test
public void null_parameters_are_invalid() {
NullPointerTester tester = new NullPointerTester();
tester.testAllPublicConstructors(JMSClusterClientFactory.class);
tester.testAllPublicInstanceMethods(clientFactory);
}
示例15: null_parameters_are_invalid
import com.google.common.testing.NullPointerTester; //导入依赖的package包/类
@Test
public void null_parameters_are_invalid() {
NullPointerTester tester = new NullPointerTester();
tester.setDefault(ActorInputMessage.class, ActorInputMessage.dumpMetrics());
tester.setDefault(ActorKey.class, DUMMY_ACTOR);
tester.testAllPublicConstructors(JMSActorRegistryClusterClient.class);
tester.testAllPublicInstanceMethods(actorRegistryClient);
}