本文整理汇总了Java中com.google.common.collect.testing.TestStringSetGenerator类的典型用法代码示例。如果您正苦于以下问题:Java TestStringSetGenerator类的具体用法?Java TestStringSetGenerator怎么用?Java TestStringSetGenerator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TestStringSetGenerator类属于com.google.common.collect.testing包,在下文中一共展示了TestStringSetGenerator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: suite
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的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
示例2: testsForFilter
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的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
示例3: testsForFilterFiltered
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的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
示例4: suite
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的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
示例5: testsForFilter
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的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
示例6: testsForFilterFiltered
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的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
示例7: testsForHashSet
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的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
示例8: testsForSimpleList
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的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
示例9: suite
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的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
示例10: suite
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的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
示例11: testsForFilter
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的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
示例12: testsForFilterFiltered
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的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
示例13: suite
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的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
示例14: suite
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的package包/类
public static TestSuite suite() {
return SetTestSuiteBuilder
.using(new TestStringSetGenerator() {
@Override
protected Set<String> create(String[] elements) {
SetBox<String> inner = new SetBox<String>(SetBoxTest.class, "list");
inner.set(new HashSet<String>(Arrays.asList(elements)));
SetBox<String> outer = new SetBox<String>(BoxFamily.getInstance(SetBoxTest.class, "list"));
outer.set(inner);
return outer;
}
})
.named("ListBox")
.withFeatures(
CollectionFeature.ALLOWS_NULL_QUERIES,
CollectionFeature.ALLOWS_NULL_VALUES,
CollectionFeature.DESCENDING_VIEW,
CollectionFeature.GENERAL_PURPOSE,
CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
CollectionFeature.SUBSET_VIEW,
CollectionFeature.SUPPORTS_ADD,
CollectionFeature.SUPPORTS_ITERATOR_REMOVE,
CollectionFeature.SUPPORTS_REMOVE,
CollectionSize.ANY,
SetFeature.GENERAL_PURPOSE
).createTestSuite();
}
开发者ID:alexmojaki,项目名称:boxes,代码行数:31,代码来源:SetBoxTest.java
示例15: onHeapIndexedCollectionGenerator
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的package包/类
private static TestStringSetGenerator onHeapIndexedCollectionGenerator() {
return new TestStringSetGenerator() {
@Override protected Set<String> create(String[] elements) {
IndexedCollection<String> indexedCollection = new ConcurrentIndexedCollection<String>(OnHeapPersistence.onPrimaryKey(QueryFactory.selfAttribute(String.class)));
indexedCollection.addAll(asList(elements));
return indexedCollection;
}
};
}
开发者ID:npgall,项目名称:cqengine,代码行数:10,代码来源:ConcurrentIndexedCollectionTest.java
示例16: offHeapIndexedCollectionGenerator
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的package包/类
private static TestStringSetGenerator offHeapIndexedCollectionGenerator() {
return new TestStringSetGenerator() {
@Override protected Set<String> create(String[] elements) {
IndexedCollection<String> indexedCollection = new ConcurrentIndexedCollection<String>(OffHeapPersistence.onPrimaryKey(QueryFactory.selfAttribute(String.class)));
indexedCollection.addAll(asList(elements));
return indexedCollection;
}
};
}
开发者ID:npgall,项目名称:cqengine,代码行数:10,代码来源:ConcurrentIndexedCollectionTest.java
示例17: onHeapIndexedCollectionGenerator
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的package包/类
private static TestStringSetGenerator onHeapIndexedCollectionGenerator() {
return new TestStringSetGenerator() {
@Override protected Set<String> create(String[] elements) {
IndexedCollection<String> indexedCollection = new TransactionalIndexedCollection<String>(String.class, OnHeapPersistence.onPrimaryKey(QueryFactory.selfAttribute(String.class)));
indexedCollection.addAll(Arrays.asList(elements));
return indexedCollection;
}
};
}
开发者ID:npgall,项目名称:cqengine,代码行数:10,代码来源:TransactionalIndexedCollectionTest.java
示例18: offHeapIndexedCollectionGenerator
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的package包/类
private static TestStringSetGenerator offHeapIndexedCollectionGenerator() {
return new TestStringSetGenerator() {
@Override protected Set<String> create(String[] elements) {
IndexedCollection<String> indexedCollection = new TransactionalIndexedCollection<String>(String.class, OffHeapPersistence.onPrimaryKey(QueryFactory.selfAttribute(String.class)));
indexedCollection.addAll(Arrays.asList(elements));
return indexedCollection;
}
};
}
开发者ID:npgall,项目名称:cqengine,代码行数:10,代码来源:TransactionalIndexedCollectionTest.java
示例19: onHeapIndexedCollectionGenerator
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的package包/类
private static TestStringSetGenerator onHeapIndexedCollectionGenerator() {
return new TestStringSetGenerator() {
@Override protected Set<String> create(String[] elements) {
IndexedCollection<String> indexedCollection = new ObjectLockingIndexedCollection<String>(OnHeapPersistence.onPrimaryKey(QueryFactory.selfAttribute(String.class)));
indexedCollection.addAll(Arrays.asList(elements));
return indexedCollection;
}
};
}
开发者ID:npgall,项目名称:cqengine,代码行数:10,代码来源:ObjectLockingIndexedCollectionTest.java
示例20: offHeapIndexedCollectionGenerator
import com.google.common.collect.testing.TestStringSetGenerator; //导入依赖的package包/类
private static TestStringSetGenerator offHeapIndexedCollectionGenerator() {
return new TestStringSetGenerator() {
@Override protected Set<String> create(String[] elements) {
IndexedCollection<String> indexedCollection = new ObjectLockingIndexedCollection<String>(OffHeapPersistence.onPrimaryKey(QueryFactory.selfAttribute(String.class)));
indexedCollection.addAll(Arrays.asList(elements));
return indexedCollection;
}
};
}
开发者ID:npgall,项目名称:cqengine,代码行数:10,代码来源:ObjectLockingIndexedCollectionTest.java
注:本文中的com.google.common.collect.testing.TestStringSetGenerator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论