• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SetFeature类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: 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:sander120786,项目名称:guava-libraries,代码行数:18,代码来源:TestsForSetsInJavaUtil.java


示例17: 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:sander120786,项目名称:guava-libraries,代码行数:22,代码来源:TestsForSetsInJavaUtil.java


示例18: 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:sander120786,项目名称:guava-libraries,代码行数:20,代码来源:TestsForSetsInJavaUtil.java


示例19: 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:sander120786,项目名称:guava-libraries,代码行数:17,代码来源:TestsForSetsInJavaUtil.java


示例20: 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:sander120786,项目名称:guava-libraries,代码行数:17,代码来源:TestsForSetsInJavaUtil.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IntegerParameter类代码示例发布时间:2022-05-22
下一篇:
Java MutableDataHolder类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap