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


Java NullPointerTester.testAllPublicStaticMethods方法代码示例

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

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

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

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

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

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

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

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

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

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

示例13: testNullPointerExceptions

import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@GwtIncompatible // NullPointerTester
public void testNullPointerExceptions() {
  NullPointerTester tester = new NullPointerTester();
  tester.testAllPublicStaticMethods(Collections2.class);
}
 
开发者ID:paul-hammant,项目名称:googles-monorepo-demo,代码行数:6,代码来源:Collections2Test.java

示例14: testNulls

import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
public void testNulls() {
  NullPointerTester tester = new NullPointerTester();

  tester.testAllPublicStaticMethods(InetAddresses.class);
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:6,代码来源:InetAddressesTest.java

示例15: testNullPointerExceptions

import com.google.common.testing.NullPointerTester; //导入方法依赖的package包/类
@GwtIncompatible // NullPointerTester
public void testNullPointerExceptions() {
  NullPointerTester tester = new NullPointerTester();
  tester.testAllPublicStaticMethods(ObjectArrays.class);
}
 
开发者ID:paul-hammant,项目名称:googles-monorepo-demo,代码行数:6,代码来源:ObjectArraysTest.java


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