com.google.common.collect.testing.TestStringSetGenerator Java Examples

The following examples show how to use com.google.common.collect.testing.TestStringSetGenerator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ConcurrentIndexedCollectionTest.java    From cqengine with Apache License 2.0 5 votes vote down vote up
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;
        }
    };
}
 
Example #2
Source File: ConcurrentIndexedCollectionTest.java    From cqengine with Apache License 2.0 5 votes vote down vote up
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;
        }
    };
}
 
Example #3
Source File: TransactionalIndexedCollectionTest.java    From cqengine with Apache License 2.0 5 votes vote down vote up
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;
        }
    };
}
 
Example #4
Source File: TransactionalIndexedCollectionTest.java    From cqengine with Apache License 2.0 5 votes vote down vote up
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;
        }
    };
}
 
Example #5
Source File: ObjectLockingIndexedCollectionTest.java    From cqengine with Apache License 2.0 5 votes vote down vote up
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;
        }
    };
}
 
Example #6
Source File: ObjectLockingIndexedCollectionTest.java    From cqengine with Apache License 2.0 5 votes vote down vote up
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;
        }
    };
}
 
Example #7
Source File: SingleWriterHashSetTest.java    From JCTools with Apache License 2.0 5 votes vote down vote up
public static Test suite() throws Exception {
    return SetTestSuiteBuilder.using(new TestStringSetGenerator() {
        @Override
        protected Set<String> create(String[] elements) {
            Set<String> set = new SingleWriterHashSet<>(elements.length);
            Collections.addAll(set, elements);
            return set;
        }
    }).withFeatures(
            SetFeature.GENERAL_PURPOSE,
            CollectionSize.ANY,
            CollectionFeature.NON_STANDARD_TOSTRING)
      .named(SingleWriterHashSet.class.getSimpleName())
      .createTestSuite();
}