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


Java NullPointerTester.testInstanceMethods方法代码示例

本文整理汇总了Java中com.google.common.testing.NullPointerTester.testInstanceMethods方法的典型用法代码示例。如果您正苦于以下问题:Java NullPointerTester.testInstanceMethods方法的具体用法?Java NullPointerTester.testInstanceMethods怎么用?Java NullPointerTester.testInstanceMethods使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.common.testing.NullPointerTester的用法示例。


在下文中一共展示了NullPointerTester.testInstanceMethods方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:12,代码来源:JoinerTest.java

示例2: testNulls

import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
public void testNulls() {
  NullPointerTester tester = new NullPointerTester()
      .setDefault(SleepingStopwatch.class, stopwatch)
      .setDefault(int.class, 1)
      .setDefault(double.class, 1.0d);
  tester.testStaticMethods(RateLimiter.class, Visibility.PACKAGE);
  tester.testInstanceMethods(RateLimiter.create(stopwatch, 5.0), Visibility.PACKAGE);
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:9,代码来源:RateLimiterTest.java

示例3: testNullContracts

import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@Test
public void testNullContracts() throws Exception {
	NullPointerTester nullPointerTester = new NullPointerTester();
	Class<?> clazz = uut.getClass();

	nullPointerTester.testAllPublicConstructors(clazz);
	nullPointerTester.testAllPublicStaticMethods(clazz);

	nullPointerTester.testInstanceMethods(uut, NullPointerTester.Visibility.PROTECTED);
	nullPointerTester.testStaticMethods(clazz, NullPointerTester.Visibility.PROTECTED);
}
 
开发者ID:Mercateo,项目名称:rest-jersey-utils,代码行数:12,代码来源:RFCExceptionMapper0Test.java

示例4: testNullContracts

import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@Test
public void testNullContracts() throws Exception {
    // given
    NullPointerTester nullPointerTester = new NullPointerTester();
    nullPointerTester.setDefault(QueueName.class, new QueueName("name"));
    nullPointerTester.setDefault(VisibilityTimeoutExtenderFactory.class,
            timeoutExtenderFactory);
    nullPointerTester.setDefault(QueueFactory.class, queueFactory);

    // when
    nullPointerTester.testInstanceMethods(uut, NullPointerTester.Visibility.PACKAGE);
    nullPointerTester.testAllPublicConstructors(uut.getClass());
}
 
开发者ID:Mercateo,项目名称:sqs-utils,代码行数:14,代码来源:LongRunningMessageHandlerFactoryTest.java

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

示例6: testNullContracts

import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@Test
public void testNullContracts() throws Exception {
    // given
    NullPointerTester nullPointerTester = new NullPointerTester();

    // when
    nullPointerTester.testInstanceMethods(uut, NullPointerTester.Visibility.PACKAGE);
    nullPointerTester.testAllPublicConstructors(uut.getClass());
}
 
开发者ID:Mercateo,项目名称:sqs-utils,代码行数:10,代码来源:MessageHandlingRunnableTest.java

示例7: testNullContracts

import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@Test
public void testNullContracts() throws Exception {
    // given
    SetWithUpperBound<Integer> uut = new SetWithUpperBound<>(4);
    NullPointerTester nullPointerTester = new NullPointerTester();

    // when
    nullPointerTester.testInstanceMethods(uut, NullPointerTester.Visibility.PACKAGE);
    nullPointerTester.testAllPublicConstructors(uut.getClass());
}
 
开发者ID:Mercateo,项目名称:sqs-utils,代码行数:11,代码来源:SetWithUpperBoundTest.java

示例8: 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

示例9: testNullContracts

import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@Test
public void testNullContracts() throws Exception {
    // given
    NullPointerTester nullPointerTester = new NullPointerTester();
    nullPointerTester.setDefault(Queue.class, Mockito.mock(Queue.class));

    // when
    nullPointerTester.testInstanceMethods(uut, NullPointerTester.Visibility.PACKAGE);
    nullPointerTester.testAllPublicConstructors(uut.getClass());
}
 
开发者ID:Mercateo,项目名称:sqs-utils,代码行数:11,代码来源:VisibilityTimeoutExtenderFactoryTest.java

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


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