当前位置: 首页>>代码示例>>Java>>正文


Java NullPointerTester类代码示例

本文整理汇总了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));
}
 
开发者ID:paul-hammant,项目名称:googles-monorepo-demo,代码行数:10,代码来源:RangeNonGwtTest.java

示例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));
}
 
开发者ID:paul-hammant,项目名称:googles-monorepo-demo,代码行数:8,代码来源:TypeTokenTest.java

示例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"));
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:9,代码来源:OptionalTest.java

示例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);
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:9,代码来源:BigIntegerMathTest.java

示例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"));
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:8,代码来源:CharMatcherTest.java

示例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);
}
 
开发者ID:Mercateo,项目名称:sqs-utils,代码行数:13,代码来源:LongRunningMessageHandlerTest.java

示例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);
}
 
开发者ID:florentw,项目名称:bench,代码行数:10,代码来源:AgentTest.java

示例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);
}
 
开发者ID:florentw,项目名称:bench,代码行数:9,代码来源:AgentsTest.java

示例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);
}
 
开发者ID:florentw,项目名称:bench,代码行数:11,代码来源:JMSAgentClusterClientTest.java

示例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);
}
 
开发者ID:florentw,项目名称:bench,代码行数:8,代码来源:JMSMetricsRepositoryListenerTest.java

示例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);
}
 
开发者ID:florentw,项目名称:bench,代码行数:8,代码来源:JMSMetricsRepositoryClusterClientTest.java

示例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"));
}
 
开发者ID:paul-hammant,项目名称:googles-monorepo-demo,代码行数:8,代码来源:MediaTypeTest.java

示例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);
}
 
开发者ID:florentw,项目名称:bench,代码行数:9,代码来源:JMSAgentRegistrySenderTest.java

示例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);
}
 
开发者ID:florentw,项目名称:bench,代码行数:8,代码来源:JMSClusterClientFactoryTest.java

示例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);
}
 
开发者ID:florentw,项目名称:bench,代码行数:10,代码来源:JMSActorRegistryClusterClientTest.java


注:本文中的com.google.common.testing.NullPointerTester类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。