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

Java SetTestSuiteBuilder类代码示例

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

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



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

示例1: computeMultimapAsMapGetTestSuite

import com.google.common.collect.testing.SetTestSuiteBuilder; //导入依赖的package包/类
@Override
TestSuite computeMultimapAsMapGetTestSuite(
    FeatureSpecificTestSuiteBuilder<
            ?, ? extends OneSizeTestContainerGenerator<SetMultimap<K, V>, Entry<K, V>>>
        parentBuilder) {
  Set<Feature<?>> features = computeMultimapAsMapGetFeatures(parentBuilder.getFeatures());
  if (Collections.disjoint(features, EnumSet.allOf(CollectionSize.class))) {
    return new TestSuite();
  } else {
    return SetTestSuiteBuilder.using(
            new MultimapAsMapGetGenerator<K, V>(parentBuilder.getSubjectGenerator()))
        .withFeatures(features)
        .named(parentBuilder.getName() + ".asMap[].get[key]")
        .suppressing(parentBuilder.getSuppressedTests())
        .createTestSuite();
  }
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:18,代码来源:SetMultimapTestSuiteBuilder.java


示例2: suite

import com.google.common.collect.testing.SetTestSuiteBuilder; //导入依赖的package包/类
public static Test suite() {
  return SetTestSuiteBuilder.using(
          new TestStringSetGenerator() {
            @Override
            protected Set<String> create(String[] elements) {
              TestSet<String> inner = new TestSet<String>(new HashSet<String>(), null);
              Set<String> outer = Synchronized.set(inner, null);
              inner.mutex = outer;
              Collections.addAll(outer, elements);
              return outer;
            }
          })
      .named("Synchronized.set")
      .withFeatures(
          CollectionFeature.GENERAL_PURPOSE,
          CollectionFeature.ALLOWS_NULL_VALUES,
          CollectionSize.ANY,
          CollectionFeature.SERIALIZABLE)
      .createTestSuite();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:21,代码来源:SynchronizedSetTest.java


示例3: testsForFilter

import com.google.common.collect.testing.SetTestSuiteBuilder; //导入依赖的package包/类
@GwtIncompatible // suite
private static Test testsForFilter() {
  return SetTestSuiteBuilder.using(new TestStringSetGenerator() {
        @Override public Set<String> create(String[] elements) {
          Set<String> unfiltered = Sets.newLinkedHashSet();
          unfiltered.add("yyy");
          Collections.addAll(unfiltered, elements);
          unfiltered.add("zzz");
          return Sets.filter(unfiltered, Collections2Test.NOT_YYY_ZZZ);
        }
      })
      .named("Sets.filter")
      .withFeatures(
          CollectionFeature.SUPPORTS_ADD,
          CollectionFeature.SUPPORTS_REMOVE,
          CollectionFeature.ALLOWS_NULL_VALUES,
          CollectionFeature.KNOWN_ORDER,
          CollectionSize.ANY)
      .createTestSuite();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:21,代码来源:SetsTest.java


示例4: testsForFilterFiltered

import com.google.common.collect.testing.SetTestSuiteBuilder; //导入依赖的package包/类
@GwtIncompatible // suite
private static Test testsForFilterFiltered() {
  return SetTestSuiteBuilder.using(new TestStringSetGenerator() {
        @Override public Set<String> create(String[] elements) {
          Set<String> unfiltered = Sets.newLinkedHashSet();
          unfiltered.add("yyy");
          unfiltered.addAll(ImmutableList.copyOf(elements));
          unfiltered.add("zzz");
          unfiltered.add("abc");
          return Sets.filter(
              Sets.filter(unfiltered, Collections2Test.LENGTH_1),
              Collections2Test.NOT_YYY_ZZZ);
        }
      })
      .named("Sets.filter, filtered input")
      .withFeatures(
          CollectionFeature.SUPPORTS_ADD,
          CollectionFeature.SUPPORTS_REMOVE,
          CollectionFeature.KNOWN_ORDER,
          CollectionSize.ANY,
          CollectionFeature.ALLOWS_NULL_QUERIES)
      .createTestSuite();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:24,代码来源:SetsTest.java


示例5: computeMultimapAsMapGetTestSuite

import com.google.common.collect.testing.SetTestSuiteBuilder; //导入依赖的package包/类
@Override
TestSuite computeMultimapAsMapGetTestSuite(
    FeatureSpecificTestSuiteBuilder<?, ? extends
    OneSizeTestContainerGenerator<SetMultimap<K, V>, Entry<K, V>>> parentBuilder) {
  Set<Feature<?>> features = computeMultimapAsMapGetFeatures(parentBuilder.getFeatures());
  if (Collections.disjoint(features, EnumSet.allOf(CollectionSize.class))) {
    return new TestSuite();
  } else {
    return SetTestSuiteBuilder.using(
        new MultimapAsMapGetGenerator<K, V>(parentBuilder.getSubjectGenerator()))
        .withFeatures(features)
        .named(parentBuilder.getName() + ".asMap[].get[key]")
        .suppressing(parentBuilder.getSuppressedTests())
        .createTestSuite();
  }
}
 
开发者ID:sander120786,项目名称:guava-libraries,代码行数:17,代码来源:SetMultimapTestSuiteBuilder.java


示例6: suite

import com.google.common.collect.testing.SetTestSuiteBuilder; //导入依赖的package包/类
public static Test suite() {
  return SetTestSuiteBuilder.using(new TestStringSetGenerator() {
        @Override
        protected Set<String> create(String[] elements) {
          TestSet<String> inner = new TestSet<String>(new HashSet<String>(), MUTEX);
          Set<String> outer = Synchronized.set(inner, inner.mutex);
          Collections.addAll(outer, elements);
          return outer;
        }
      })
      .named("Synchronized.set")
      .withFeatures(CollectionFeature.GENERAL_PURPOSE,
          CollectionFeature.ALLOWS_NULL_VALUES,
          CollectionSize.ANY,
          CollectionFeature.SERIALIZABLE)
      .createTestSuite();
}
 
开发者ID:sander120786,项目名称:guava-libraries,代码行数:18,代码来源:SynchronizedSetTest.java


示例7: testsForFilter

import com.google.common.collect.testing.SetTestSuiteBuilder; //导入依赖的package包/类
@GwtIncompatible("suite")
private static Test testsForFilter() {
  return SetTestSuiteBuilder.using(new TestStringSetGenerator() {
        @Override public Set<String> create(String[] elements) {
          Set<String> unfiltered = Sets.newLinkedHashSet();
          unfiltered.add("yyy");
          Collections.addAll(unfiltered, elements);
          unfiltered.add("zzz");
          return Sets.filter(unfiltered, Collections2Test.NOT_YYY_ZZZ);
        }
      })
      .named("Sets.filter")
      .withFeatures(
          CollectionFeature.SUPPORTS_ADD,
          CollectionFeature.SUPPORTS_REMOVE,
          CollectionFeature.ALLOWS_NULL_VALUES,
          CollectionFeature.KNOWN_ORDER,
          CollectionSize.ANY)
      .createTestSuite();
}
 
开发者ID:sander120786,项目名称:guava-libraries,代码行数:21,代码来源:SetsTest.java


示例8: testsForFilterFiltered

import com.google.common.collect.testing.SetTestSuiteBuilder; //导入依赖的package包/类
@GwtIncompatible("suite")
private static Test testsForFilterFiltered() {
  return SetTestSuiteBuilder.using(new TestStringSetGenerator() {
        @Override public Set<String> create(String[] elements) {
          Set<String> unfiltered = Sets.newLinkedHashSet();
          unfiltered.add("yyy");
          unfiltered.addAll(ImmutableList.copyOf(elements));
          unfiltered.add("zzz");
          unfiltered.add("abc");
          return Sets.filter(
              Sets.filter(unfiltered, Collections2Test.LENGTH_1),
              Collections2Test.NOT_YYY_ZZZ);
        }
      })
      .named("Sets.filter, filtered input")
      .withFeatures(
          CollectionFeature.SUPPORTS_ADD,
          CollectionFeature.SUPPORTS_REMOVE,
          CollectionFeature.KNOWN_ORDER,
          CollectionSize.ANY,
          CollectionFeature.ALLOWS_NULL_QUERIES)
      .createTestSuite();
}
 
开发者ID:sander120786,项目名称:guava-libraries,代码行数:24,代码来源:SetsTest.java


示例9: testsForHashSet

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


示例10: testsForSimpleList

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


示例11: suite

import com.google.common.collect.testing.SetTestSuiteBuilder; //导入依赖的package包/类
public static TestSuite suite() throws Exception {
    return SetTestSuiteBuilder.using(new TestStringSetGenerator() {

        @Override
        protected Set<String> create(String[] elements) {
            ParetoHashSet s = new ParetoHashSet();
            for (String element : elements) {
                s.add(element);
            }
            return s;
        }
    })
            .named("ParetoHashSetTestSuite")
            .withFeatures(SetFeature.GENERAL_PURPOSE, CollectionSize.ANY, CollectionFeature.ALLOWS_NULL_VALUES,
                    CollectionFeature.ALLOWS_NULL_QUERIES, CollectionFeature.REMOVE_OPERATIONS,
                    CollectionFeature.SERIALIZABLE)
            .createTestSuite();
}
 
开发者ID:parentjo,项目名称:pareto4j,代码行数:19,代码来源:ParetoHashSetTestSuite.java


示例12: suite

import com.google.common.collect.testing.SetTestSuiteBuilder; //导入依赖的package包/类
public static Test suite() {
  return SetTestSuiteBuilder.using(
          new TestStringSetGenerator() {
            @Override
            protected Set<String> create(String[] elements) {
              TestSet<String> inner = new TestSet<>(new HashSet<String>(), MUTEX);
              Set<String> outer = Synchronized.set(inner, inner.mutex);
              Collections.addAll(outer, elements);
              return outer;
            }
          })
      .named("Synchronized.set")
      .withFeatures(
          CollectionFeature.GENERAL_PURPOSE,
          CollectionFeature.ALLOWS_NULL_VALUES,
          CollectionSize.ANY,
          CollectionFeature.SERIALIZABLE)
      .createTestSuite();
}
 
开发者ID:google,项目名称:guava,代码行数:20,代码来源:SynchronizedSetTest.java


示例13: testsForFilter

import com.google.common.collect.testing.SetTestSuiteBuilder; //导入依赖的package包/类
@GwtIncompatible // suite
private static Test testsForFilter() {
  return SetTestSuiteBuilder.using(
          new TestStringSetGenerator() {
            @Override
            public Set<String> create(String[] elements) {
              Set<String> unfiltered = Sets.newLinkedHashSet();
              unfiltered.add("yyy");
              Collections.addAll(unfiltered, elements);
              unfiltered.add("zzz");
              return Sets.filter(unfiltered, Collections2Test.NOT_YYY_ZZZ);
            }
          })
      .named("Sets.filter")
      .withFeatures(
          CollectionFeature.SUPPORTS_ADD,
          CollectionFeature.SUPPORTS_REMOVE,
          CollectionFeature.ALLOWS_NULL_VALUES,
          CollectionFeature.KNOWN_ORDER,
          CollectionSize.ANY)
      .createTestSuite();
}
 
开发者ID:google,项目名称:guava,代码行数:23,代码来源:SetsTest.java


示例14: testsForFilterFiltered

import com.google.common.collect.testing.SetTestSuiteBuilder; //导入依赖的package包/类
@GwtIncompatible // suite
private static Test testsForFilterFiltered() {
  return SetTestSuiteBuilder.using(
          new TestStringSetGenerator() {
            @Override
            public Set<String> create(String[] elements) {
              Set<String> unfiltered = Sets.newLinkedHashSet();
              unfiltered.add("yyy");
              unfiltered.addAll(ImmutableList.copyOf(elements));
              unfiltered.add("zzz");
              unfiltered.add("abc");
              return Sets.filter(
                  Sets.filter(unfiltered, Collections2Test.LENGTH_1),
                  Collections2Test.NOT_YYY_ZZZ);
            }
          })
      .named("Sets.filter, filtered input")
      .withFeatures(
          CollectionFeature.SUPPORTS_ADD,
          CollectionFeature.SUPPORTS_REMOVE,
          CollectionFeature.KNOWN_ORDER,
          CollectionSize.ANY,
          CollectionFeature.ALLOWS_NULL_QUERIES)
      .createTestSuite();
}
 
开发者ID:google,项目名称:guava,代码行数:26,代码来源:SetsTest.java


示例15: suite

import com.google.common.collect.testing.SetTestSuiteBuilder; //导入依赖的package包/类
public static Test suite() {
  return SetTestSuiteBuilder.using(
          new TestStringSetGenerator() {
            @Override
            protected Set<String> create(String[] elements) {
              TestSet<String> inner = new TestSet<>(new HashSet<String>(), null);
              Set<String> outer = Synchronized.set(inner, null);
              inner.mutex = outer;
              Collections.addAll(outer, elements);
              return outer;
            }
          })
      .named("Synchronized.set")
      .withFeatures(
          CollectionFeature.GENERAL_PURPOSE,
          CollectionFeature.ALLOWS_NULL_VALUES,
          CollectionSize.ANY,
          CollectionFeature.SERIALIZABLE)
      .createTestSuite();
}
 
开发者ID:google,项目名称:guava,代码行数:21,代码来源:SynchronizedSetTest.java


示例16: createDerivedSuites

import com.google.common.collect.testing.SetTestSuiteBuilder; //导入依赖的package包/类
@Override
protected List<TestSuite> createDerivedSuites(
    FeatureSpecificTestSuiteBuilder<?, ? extends OneSizeTestContainerGenerator<Collection<E>, E>>
        parentBuilder) {
  List<TestSuite> derivedSuites =
      new ArrayList<TestSuite>(super.createDerivedSuites(parentBuilder));

  derivedSuites.add(createElementSetTestSuite(parentBuilder));

  if (!parentBuilder.getFeatures().contains(NoRecurse.NO_ENTRY_SET)) {
    derivedSuites.add(
        SetTestSuiteBuilder.using(new EntrySetGenerator<E>(parentBuilder.getSubjectGenerator()))
            .named(getName() + ".entrySet")
            .withFeatures(computeEntrySetFeatures(parentBuilder.getFeatures()))
            .suppressing(parentBuilder.getSuppressedTests())
            .createTestSuite());
  }

  if (parentBuilder.getFeatures().contains(CollectionFeature.SERIALIZABLE)) {
    derivedSuites.add(
        MultisetTestSuiteBuilder.using(
                new ReserializedMultisetGenerator<E>(parentBuilder.getSubjectGenerator()))
            .named(getName() + " reserialized")
            .withFeatures(computeReserializedMultisetFeatures(parentBuilder.getFeatures()))
            .suppressing(parentBuilder.getSuppressedTests())
            .createTestSuite());
  }
  return derivedSuites;
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:30,代码来源:MultisetTestSuiteBuilder.java


示例17: createElementSetTestSuite

import com.google.common.collect.testing.SetTestSuiteBuilder; //导入依赖的package包/类
TestSuite createElementSetTestSuite(
    FeatureSpecificTestSuiteBuilder<?, ? extends OneSizeTestContainerGenerator<Collection<E>, E>>
        parentBuilder) {
  return SetTestSuiteBuilder.using(
          new ElementSetGenerator<E>(parentBuilder.getSubjectGenerator()))
      .named(getName() + ".elementSet")
      .withFeatures(computeElementSetFeatures(parentBuilder.getFeatures()))
      .suppressing(parentBuilder.getSuppressedTests())
      .createTestSuite();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:11,代码来源:MultisetTestSuiteBuilder.java


示例18: computeMultimapGetTestSuite

import com.google.common.collect.testing.SetTestSuiteBuilder; //导入依赖的package包/类
@Override
TestSuite computeMultimapGetTestSuite(
    FeatureSpecificTestSuiteBuilder<
            ?, ? extends OneSizeTestContainerGenerator<SetMultimap<K, V>, Entry<K, V>>>
        parentBuilder) {
  return SetTestSuiteBuilder.using(
          new MultimapGetGenerator<K, V>(parentBuilder.getSubjectGenerator()))
      .withFeatures(computeMultimapGetFeatures(parentBuilder.getFeatures()))
      .named(parentBuilder.getName() + ".get[key]")
      .suppressing(parentBuilder.getSuppressedTests())
      .createTestSuite();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:13,代码来源:SetMultimapTestSuiteBuilder.java


示例19: computeEntriesTestSuite

import com.google.common.collect.testing.SetTestSuiteBuilder; //导入依赖的package包/类
@Override
TestSuite computeEntriesTestSuite(
    FeatureSpecificTestSuiteBuilder<
            ?, ? extends OneSizeTestContainerGenerator<SetMultimap<K, V>, Map.Entry<K, V>>>
        parentBuilder) {
  return SetTestSuiteBuilder.using(
          new EntriesGenerator<K, V>(parentBuilder.getSubjectGenerator()))
      .withFeatures(computeEntriesFeatures(parentBuilder.getFeatures()))
      .named(parentBuilder.getName() + ".entries")
      .suppressing(parentBuilder.getSuppressedTests())
      .createTestSuite();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:13,代码来源:SetMultimapTestSuiteBuilder.java


示例20: createElementSetTestSuite

import com.google.common.collect.testing.SetTestSuiteBuilder; //导入依赖的package包/类
@Override
TestSuite createElementSetTestSuite(
    FeatureSpecificTestSuiteBuilder<?, ? extends OneSizeTestContainerGenerator<Collection<E>, E>>
        parentBuilder) {
  // TODO(lowasser): make a SortedElementSetGenerator
  return SetTestSuiteBuilder.using(
          new ElementSetGenerator<E>(parentBuilder.getSubjectGenerator()))
      .named(getName() + ".elementSet")
      .withFeatures(computeElementSetFeatures(parentBuilder.getFeatures()))
      .suppressing(parentBuilder.getSuppressedTests())
      .createTestSuite();
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:13,代码来源:SortedMultisetTestSuiteBuilder.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java PdfObject类代码示例发布时间:2022-05-22
下一篇:
Java MediaPlayerEventAdapter类代码示例发布时间: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