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

The following examples show how to use com.google.common.collect.testing.SetTestSuiteBuilder. 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: ModelCollectionTest.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public Test testModelImpl(String name, ModelFactory factory) {
	try {
		return SetTestSuiteBuilder.using(new TestModelGenerator(factory))
				.named(name)
				.withFeatures(CollectionSize.ANY, CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
						CollectionFeature.SERIALIZABLE, CollectionFeature.SUPPORTS_ADD,
						CollectionFeature.SUPPORTS_ITERATOR_REMOVE, CollectionFeature.SUPPORTS_REMOVE,
						CollectionFeature.NON_STANDARD_TOSTRING)
				// FIXME suppressing test on iterator element remove behavior
				.suppressing(CollectionIteratorTester.class
						.getDeclaredMethod("testIterator_unknownOrderRemoveSupported"))
				.createTestSuite();
	} catch (NoSuchMethodException | SecurityException e) {
		throw new RuntimeException(e);
	}
}
 
Example #2
Source File: SetXTestSuite.java    From cyclops with Apache License 2.0 5 votes vote down vote up
public Test testForOneToWayUseMySet() {
    return SetTestSuiteBuilder
            .using(new SetXGenerator())
            .named("setX test")
            .withFeatures(
                    CollectionSize.ANY,
                    CollectionFeature.ALLOWS_NULL_VALUES,
                    CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
                    CollectionFeature.SUPPORTS_ADD,
                    CollectionFeature.SUPPORTS_ITERATOR_REMOVE,
                    CollectionFeature.SUPPORTS_REMOVE
            )
            .createTestSuite();
}
 
Example #3
Source File: SortedSetTestSuite.java    From cyclops with Apache License 2.0 5 votes vote down vote up
public Test testForOneToWayUseMySet() {
    return SetTestSuiteBuilder
            .using(new SetXGenerator())
            .named("setX test")
            .withFeatures(
                    CollectionSize.ANY,
                    CollectionFeature.ALLOWS_NULL_VALUES,
                    CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
                    CollectionFeature.SUPPORTS_ADD,
                    CollectionFeature.SUPPORTS_ITERATOR_REMOVE,
                    CollectionFeature.SUPPORTS_REMOVE
            )
            .createTestSuite();
}
 
Example #4
Source File: ObjectHashSetConformanceTest.java    From agrona with Apache License 2.0 5 votes vote down vote up
public static TestSuite suite()
{
    return SetTestSuiteBuilder.using(new Generator())
        .named("ObjectHashSet Tests")
        .withFeatures(CollectionSize.ANY,
            CollectionFeature.NON_STANDARD_TOSTRING,
            CollectionFeature.SUPPORTS_ADD,
            CollectionFeature.SUPPORTS_REMOVE,
            CollectionFeature.SUPPORTS_ITERATOR_REMOVE,
            CollectionFeature.REMOVE_OPERATIONS)
        .createTestSuite();
}
 
Example #5
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();
}