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


Java SetFeature类代码示例

本文整理汇总了Java中com.google.common.collect.testing.features.SetFeature的典型用法代码示例。如果您正苦于以下问题:Java SetFeature类的具体用法?Java SetFeature怎么用?Java SetFeature使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SetFeature类属于com.google.common.collect.testing.features包,在下文中一共展示了SetFeature类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testsForCheckedNavigableSet

import com.google.common.collect.testing.features.SetFeature; //导入依赖的package包/类
public Test testsForCheckedNavigableSet() {
  return SortedSetTestSuiteBuilder.using(
      new TestStringSortedSetGenerator() {
        @Override
        public NavigableSet<String> create(String[] elements) {
          NavigableSet<String> innerSet = new TreeSet<String>();
          Collections.addAll(innerSet, elements);
          return Collections.checkedNavigableSet(innerSet, String.class);
        }
      })
      .named("checkedNavigableSet/TreeSet, natural")
      .withFeatures(
          SetFeature.GENERAL_PURPOSE,
          CollectionFeature.KNOWN_ORDER,
          CollectionFeature.SERIALIZABLE,
          CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
          CollectionFeature.RESTRICTS_ELEMENTS,
          CollectionSize.ANY)
      .suppressing(suppressForCheckedNavigableSet())
      .createTestSuite();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:22,代码来源:TestsForSetsInJavaUtil.java

示例2: testsForHashSet

import com.google.common.collect.testing.features.SetFeature; //导入依赖的package包/类
public Test testsForHashSet() {
  return SetTestSuiteBuilder.using(
          new TestStringSetGenerator() {
            @Override
            public Set<String> create(String[] elements) {
              return new HashSet<String>(MinimalCollection.of(elements));
            }
          })
      .named("HashSet")
      .withFeatures(
          SetFeature.GENERAL_PURPOSE,
          CollectionFeature.SERIALIZABLE,
          CollectionFeature.ALLOWS_NULL_VALUES,
          CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
          CollectionSize.ANY)
      .suppressing(suppressForHashSet())
      .createTestSuite();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:19,代码来源:TestsForSetsInJavaUtil.java

示例3: testsForLinkedHashSet

import com.google.common.collect.testing.features.SetFeature; //导入依赖的package包/类
public Test testsForLinkedHashSet() {
  return SetTestSuiteBuilder.using(
          new TestStringSetGenerator() {
            @Override
            public Set<String> create(String[] elements) {
              return new LinkedHashSet<String>(MinimalCollection.of(elements));
            }
          })
      .named("LinkedHashSet")
      .withFeatures(
          SetFeature.GENERAL_PURPOSE,
          CollectionFeature.SERIALIZABLE,
          CollectionFeature.ALLOWS_NULL_VALUES,
          CollectionFeature.KNOWN_ORDER,
          CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
          CollectionSize.ANY)
      .suppressing(suppressForLinkedHashSet())
      .createTestSuite();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:20,代码来源:TestsForSetsInJavaUtil.java

示例4: testsForEnumSet

import com.google.common.collect.testing.features.SetFeature; //导入依赖的package包/类
public Test testsForEnumSet() {
  return SetTestSuiteBuilder.using(
          new TestEnumSetGenerator() {
            @Override
            public Set<AnEnum> create(AnEnum[] elements) {
              return (elements.length == 0)
                  ? EnumSet.noneOf(AnEnum.class)
                  : EnumSet.copyOf(MinimalCollection.of(elements));
            }
          })
      .named("EnumSet")
      .withFeatures(
          SetFeature.GENERAL_PURPOSE,
          CollectionFeature.SERIALIZABLE,
          CollectionFeature.KNOWN_ORDER,
          CollectionFeature.RESTRICTS_ELEMENTS,
          CollectionSize.ANY)
      .suppressing(suppressForEnumSet())
      .createTestSuite();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:21,代码来源:TestsForSetsInJavaUtil.java

示例5: testsForSynchronizedNavigableSet

import com.google.common.collect.testing.features.SetFeature; //导入依赖的package包/类
/**
 * Tests regular NavigableSet behavior of synchronizedNavigableSet(treeSet);
 * does not test the fact that it's synchronized.
 */
public Test testsForSynchronizedNavigableSet() {
  return NavigableSetTestSuiteBuilder.using(
          new TestStringSortedSetGenerator() {
            @Override
            public SortedSet<String> create(String[] elements) {
              NavigableSet<String> delegate = new TreeSet<>(MinimalCollection.of(elements));
              return Collections.synchronizedNavigableSet(delegate);
            }
          })
      .named("synchronizedNavigableSet/TreeSet, natural")
      .withFeatures(
          SetFeature.GENERAL_PURPOSE,
          CollectionFeature.SERIALIZABLE,
          CollectionFeature.KNOWN_ORDER,
          CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
          CollectionSize.ANY)
      .suppressing(suppressForSynchronizedNavigableSet())
      .createTestSuite();

}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:25,代码来源:TestsForSetsInJavaUtil.java

示例6: testsForTreeSetNatural

import com.google.common.collect.testing.features.SetFeature; //导入依赖的package包/类
public Test testsForTreeSetNatural() {
  return NavigableSetTestSuiteBuilder.using(
          new TestStringSortedSetGenerator() {
            @Override
            public SortedSet<String> create(String[] elements) {
              return new TreeSet<String>(MinimalCollection.of(elements));
            }
          })
      .named("TreeSet, natural")
      .withFeatures(
          SetFeature.GENERAL_PURPOSE,
          CollectionFeature.SERIALIZABLE,
          CollectionFeature.KNOWN_ORDER,
          CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
          CollectionSize.ANY)
      .suppressing(suppressForTreeSetNatural())
      .createTestSuite();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:19,代码来源:TestsForSetsInJavaUtil.java

示例7: testsForTreeSetWithComparator

import com.google.common.collect.testing.features.SetFeature; //导入依赖的package包/类
public Test testsForTreeSetWithComparator() {
  return NavigableSetTestSuiteBuilder.using(
          new TestStringSortedSetGenerator() {
            @Override
            public SortedSet<String> create(String[] elements) {
              SortedSet<String> set = new TreeSet<String>(arbitraryNullFriendlyComparator());
              Collections.addAll(set, elements);
              return set;
            }
          })
      .named("TreeSet, with comparator")
      .withFeatures(
          SetFeature.GENERAL_PURPOSE,
          CollectionFeature.SERIALIZABLE,
          CollectionFeature.ALLOWS_NULL_VALUES,
          CollectionFeature.KNOWN_ORDER,
          CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
          CollectionSize.ANY)
      .suppressing(suppressForTreeSetWithComparator())
      .createTestSuite();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:22,代码来源:TestsForSetsInJavaUtil.java

示例8: testsForCheckedSet

import com.google.common.collect.testing.features.SetFeature; //导入依赖的package包/类
public Test testsForCheckedSet() {
  return SetTestSuiteBuilder.using(
          new TestStringSetGenerator() {
            @Override
            public Set<String> create(String[] elements) {
              Set<String> innerSet = new HashSet<String>();
              Collections.addAll(innerSet, elements);
              return Collections.checkedSet(innerSet, String.class);
            }
          })
      .named("checkedSet/HashSet")
      .withFeatures(
          SetFeature.GENERAL_PURPOSE,
          CollectionFeature.SERIALIZABLE,
          CollectionFeature.ALLOWS_NULL_VALUES,
          CollectionFeature.RESTRICTS_ELEMENTS,
          CollectionSize.ANY)
      .suppressing(suppressForCheckedSet())
      .createTestSuite();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:21,代码来源:TestsForSetsInJavaUtil.java

示例9: testsForCheckedSortedSet

import com.google.common.collect.testing.features.SetFeature; //导入依赖的package包/类
public Test testsForCheckedSortedSet() {
  return SortedSetTestSuiteBuilder.using(
      new TestStringSortedSetGenerator() {
        @Override
        public SortedSet<String> create(String[] elements) {
          SortedSet<String> innerSet = new TreeSet<String>();
          Collections.addAll(innerSet, elements);
          return Collections.checkedSortedSet(innerSet, String.class);
        }
      })
      .named("checkedSortedSet/TreeSet, natural")
      .withFeatures(
          SetFeature.GENERAL_PURPOSE,
          CollectionFeature.KNOWN_ORDER,
          CollectionFeature.SERIALIZABLE,
          CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
          CollectionFeature.RESTRICTS_ELEMENTS,
          CollectionSize.ANY)
      .suppressing(suppressForCheckedSortedSet())
      .createTestSuite();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:22,代码来源:TestsForSetsInJavaUtil.java

示例10: testsForBadlyCollidingHashSet

import com.google.common.collect.testing.features.SetFeature; //导入依赖的package包/类
public Test testsForBadlyCollidingHashSet() {
  return SetTestSuiteBuilder.using(
          new TestCollidingSetGenerator() {
            @Override
            public Set<Object> create(Object... elements) {
              return new HashSet<Object>(MinimalCollection.of(elements));
            }
          })
      .named("badly colliding HashSet")
      .withFeatures(
          SetFeature.GENERAL_PURPOSE,
          CollectionFeature.ALLOWS_NULL_VALUES,
          CollectionSize.SEVERAL)
      .suppressing(suppressForHashSet())
      .createTestSuite();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:17,代码来源:TestsForSetsInJavaUtil.java

示例11: testsForConcurrentSkipListSetNatural

import com.google.common.collect.testing.features.SetFeature; //导入依赖的package包/类
public Test testsForConcurrentSkipListSetNatural() {
  return SetTestSuiteBuilder.using(
          new TestStringSortedSetGenerator() {
            @Override
            public SortedSet<String> create(String[] elements) {
              return new ConcurrentSkipListSet<String>(MinimalCollection.of(elements));
            }
          })
      .named("ConcurrentSkipListSet, natural")
      .withFeatures(
          SetFeature.GENERAL_PURPOSE,
          CollectionFeature.SERIALIZABLE,
          CollectionFeature.KNOWN_ORDER,
          CollectionSize.ANY)
      .suppressing(suppressForConcurrentSkipListSetNatural())
      .createTestSuite();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:18,代码来源:TestsForSetsInJavaUtil.java

示例12: testsForConcurrentSkipListSetWithComparator

import com.google.common.collect.testing.features.SetFeature; //导入依赖的package包/类
public Test testsForConcurrentSkipListSetWithComparator() {
  return SetTestSuiteBuilder.using(
          new TestStringSortedSetGenerator() {
            @Override
            public SortedSet<String> create(String[] elements) {
              SortedSet<String> set =
                  new ConcurrentSkipListSet<String>(arbitraryNullFriendlyComparator());
              Collections.addAll(set, elements);
              return set;
            }
          })
      .named("ConcurrentSkipListSet, with comparator")
      .withFeatures(
          SetFeature.GENERAL_PURPOSE,
          CollectionFeature.SERIALIZABLE,
          CollectionFeature.KNOWN_ORDER,
          CollectionSize.ANY)
      .suppressing(suppressForConcurrentSkipListSetWithComparator())
      .createTestSuite();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:21,代码来源:TestsForSetsInJavaUtil.java

示例13: testsForHashSet

import com.google.common.collect.testing.features.SetFeature; //导入依赖的package包/类
public Test testsForHashSet() {
  return SetTestSuiteBuilder
      .using(new TestStringSetGenerator() {
          @Override public Set<String> create(String[] elements) {
            return new HashSet<String>(MinimalCollection.of(elements));
          }
        })
      .named("HashSet")
      .withFeatures(
          SetFeature.GENERAL_PURPOSE,
          CollectionFeature.SERIALIZABLE,
          CollectionFeature.ALLOWS_NULL_VALUES,
          CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
          CollectionSize.ANY)
      .suppressing(suppressForHashSet())
      .createTestSuite();
}
 
开发者ID:sander120786,项目名称:guava-libraries,代码行数:18,代码来源:TestsForSetsInJavaUtil.java

示例14: testsForLinkedHashSet

import com.google.common.collect.testing.features.SetFeature; //导入依赖的package包/类
public Test testsForLinkedHashSet() {
  return SetTestSuiteBuilder
      .using(new TestStringSetGenerator() {
          @Override public Set<String> create(String[] elements) {
            return new LinkedHashSet<String>(MinimalCollection.of(elements));
          }
        })
      .named("LinkedHashSet")
      .withFeatures(
          SetFeature.GENERAL_PURPOSE,
          CollectionFeature.SERIALIZABLE,
          CollectionFeature.ALLOWS_NULL_VALUES,
          CollectionFeature.KNOWN_ORDER,
          CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
          CollectionSize.ANY)
      .suppressing(suppressForLinkedHashSet())
      .createTestSuite();
}
 
开发者ID:sander120786,项目名称:guava-libraries,代码行数:19,代码来源:TestsForSetsInJavaUtil.java

示例15: testsForEnumSet

import com.google.common.collect.testing.features.SetFeature; //导入依赖的package包/类
public Test testsForEnumSet() {
  return SetTestSuiteBuilder
      .using(new TestEnumSetGenerator() {
          @Override public Set<AnEnum> create(AnEnum[] elements) {
            return (elements.length == 0)
                ? EnumSet.noneOf(AnEnum.class)
                : EnumSet.copyOf(MinimalCollection.of(elements));
          }
        })
      .named("EnumSet")
      .withFeatures(
          SetFeature.GENERAL_PURPOSE,
          CollectionFeature.SERIALIZABLE,
          CollectionFeature.KNOWN_ORDER,
          CollectionFeature.RESTRICTS_ELEMENTS,
          CollectionSize.ANY)
      .suppressing(suppressForEnumSet())
      .createTestSuite();
}
 
开发者ID:sander120786,项目名称:guava-libraries,代码行数:20,代码来源:TestsForSetsInJavaUtil.java


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