本文整理汇总了Java中com.google.common.testing.NullPointerTester.setDefault方法的典型用法代码示例。如果您正苦于以下问题:Java NullPointerTester.setDefault方法的具体用法?Java NullPointerTester.setDefault怎么用?Java NullPointerTester.setDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.testing.NullPointerTester
的用法示例。
在下文中一共展示了NullPointerTester.setDefault方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: null_parameters_are_invalid
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@Test
public void null_parameters_are_invalid() {
Actors.ActorHandle actorHandle = actors.create(actorConfig);
NullPointerTester tester = new NullPointerTester();
tester.setDefault(ActorSender.class, actorSender);
tester.setDefault(ResourceManager.class, resourceManager);
tester.testAllPublicConstructors(Actors.class);
tester.testAllPublicInstanceMethods(actors);
tester.testAllPublicInstanceMethods(actorHandle);
}
示例2: testNullContracts
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@Test
public void testNullContracts() throws Exception {
// given
NullPointerTester nullPointerTester = new NullPointerTester();
nullPointerTester.setDefault(SetWithUpperBound.class, new SetWithUpperBound<Integer>(5));
nullPointerTester.setDefault(VisibilityTimeoutExtender.class, Mockito.mock(
VisibilityTimeoutExtender.class));
// when
nullPointerTester.testInstanceMethods(uut, NullPointerTester.Visibility.PACKAGE);
nullPointerTester.testAllPublicConstructors(uut.getClass());
}
示例3: null_parameters_are_invalid
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@Test
public void null_parameters_are_invalid() {
NullPointerTester tester = new NullPointerTester();
tester.setDefault(ActorKey.class, new ActorKey("dummy"));
tester.setDefault(ActorInputMessage.class, ActorInputMessage.dumpMetrics());
tester.setDefault(JgroupsEndpoint.class, endpoint);
tester.testAllPublicConstructors(JgroupsSender.class);
tester.testAllPublicInstanceMethods(sender);
}
示例4: null_parameters_are_invalid
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@Test
public void null_parameters_are_invalid() {
NullPointerTester tester = new NullPointerTester();
tester.setDefault(Metric.class, DUMMY_METRIC);
tester.testAllPublicConstructors(Metrics.class);
tester.testAllPublicInstanceMethods(metrics);
}
示例5: 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);
}
示例6: null_parameters_invalid
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@Test
public void null_parameters_invalid() {
NullPointerTester tester = new NullPointerTester();
tester.setDefault(AgentKey.class, DUMMY_AGENT);
tester.testAllPublicConstructors(ActorManagers.class);
tester.testAllPublicInstanceMethods(actorManagers);
}
示例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_are_invalid
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@Test
public void null_parameters_are_invalid() {
JgroupsActorMessage actorMessage = actorMessage();
NullPointerTester tester = new NullPointerTester();
tester.setDefault(ActorInputMessage.class, ActorInputMessage.dumpMetrics());
tester.setDefault(ActorKey.class, DUMMY_ACTOR);
tester.testAllPublicConstructors(JgroupsActorMessage.class);
tester.testAllPublicInstanceMethods(actorMessage);
}
示例10: testNullContracts
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@Test
public void testNullContracts() throws Exception {
// given
NullPointerTester nullPointerTester = new NullPointerTester();
nullPointerTester.ignore(uut.getClass().getDeclaredMethod("canEqual", Object.class));
nullPointerTester.ignore(uut.getClass().getDeclaredMethod("equals", Object.class));
nullPointerTester.setDefault(QueueName.class, new QueueName("asiudb"));
// when
nullPointerTester.testInstanceMethods(uut, NullPointerTester.Visibility.PACKAGE);
nullPointerTester.testAllPublicConstructors(uut.getClass());
}
示例11: 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);
}
示例12: 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.setDefault(JgroupsSender.class, jgroupsSender);
tester.testAllPublicConstructors(JgroupsActorClusterClient.class);
tester.testAllPublicInstanceMethods(clusterClient);
}
示例13: null_parameters_invalid
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@Test
public void null_parameters_invalid() {
NullPointerTester tester = new NullPointerTester();
tester.setDefault(AgentKey.class, AgentUtil.DUMMY_AGENT);
tester.testAllPublicConstructors(AgentRegistryListenerLogger.class);
tester.testAllPublicInstanceMethods(loggerListener);
}
示例14: null_parameters_are_invalid
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@Test
public void null_parameters_are_invalid() {
NullPointerTester tester = new NullPointerTester();
tester.setDefault(JgroupsViewMultiplexer.class, viewMultiplexer);
tester.testAllPublicConstructors(JgroupsActorRegistryClusterClient.class);
tester.testAllPublicInstanceMethods(registryClusterClient);
}
示例15: null_parameters_for_constructor
import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@Test
public void null_parameters_for_constructor() {
NullPointerTester tester = new NullPointerTester();
tester.setDefault(DeployConfig.class, DUMMY_CONFIG.getDeployConfig());
tester.setDefault(ActorKey.class, DUMMY_ACTOR);
tester.testAllPublicConstructors(ActorConfig.class);
tester.testAllPublicConstructors(DeployConfig.class);
}