use of com.google.common.collect.testing.google.MapGenerators.ImmutableMapValueListGenerator in project guava by google.
the class ImmutableMapTest method suite.
// suite
@GwtIncompatible
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(ImmutableMapTest.class);
suite.addTestSuite(FloodingTest.class);
suite.addTest(MapTestSuiteBuilder.using(new ImmutableMapGenerator()).withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE_INCLUDING_VIEWS, CollectionFeature.KNOWN_ORDER, MapFeature.REJECTS_DUPLICATES_AT_CREATION, CollectionFeature.ALLOWS_NULL_QUERIES).named("ImmutableMap").createTestSuite());
suite.addTest(MapTestSuiteBuilder.using(new TestStringMapGenerator() {
@Override
protected Map<String, String> create(Entry<String, String>[] entries) {
ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
builder.putAll(Arrays.asList(entries));
return builder.buildJdkBacked();
}
}).withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE_INCLUDING_VIEWS, CollectionFeature.KNOWN_ORDER, MapFeature.REJECTS_DUPLICATES_AT_CREATION, CollectionFeature.ALLOWS_NULL_QUERIES).named("ImmutableMap [JDK backed]").createTestSuite());
suite.addTest(MapTestSuiteBuilder.using(new ImmutableMapCopyOfGenerator()).withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE_INCLUDING_VIEWS, CollectionFeature.KNOWN_ORDER, CollectionFeature.ALLOWS_NULL_QUERIES).named("ImmutableMap.copyOf[Map]").createTestSuite());
suite.addTest(MapTestSuiteBuilder.using(new ImmutableMapCopyOfEntriesGenerator()).withFeatures(CollectionSize.ANY, MapFeature.REJECTS_DUPLICATES_AT_CREATION, CollectionFeature.SERIALIZABLE_INCLUDING_VIEWS, CollectionFeature.KNOWN_ORDER, CollectionFeature.ALLOWS_NULL_QUERIES).named("ImmutableMap.copyOf[Iterable<Entry>]").createTestSuite());
suite.addTest(MapTestSuiteBuilder.using(new ImmutableMapCopyOfEnumMapGenerator()).withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE_INCLUDING_VIEWS, CollectionFeature.KNOWN_ORDER, CollectionFeature.ALLOWS_NULL_QUERIES).named("ImmutableMap.copyOf[EnumMap]").createTestSuite());
suite.addTest(MapTestSuiteBuilder.using(new ImmutableMapValuesAsSingletonSetGenerator()).withFeatures(CollectionSize.ANY, MapFeature.REJECTS_DUPLICATES_AT_CREATION, CollectionFeature.KNOWN_ORDER, CollectionFeature.ALLOWS_NULL_QUERIES).named("ImmutableMap.asMultimap.asMap").createTestSuite());
suite.addTest(CollectionTestSuiteBuilder.using(new ImmutableMapUnhashableValuesGenerator()).withFeatures(CollectionSize.ANY, CollectionFeature.KNOWN_ORDER, CollectionFeature.ALLOWS_NULL_QUERIES).named("ImmutableMap.values, unhashable").createTestSuite());
suite.addTest(ListTestSuiteBuilder.using(new ImmutableMapKeyListGenerator()).named("ImmutableMap.keySet.asList").withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE, CollectionFeature.REJECTS_DUPLICATES_AT_CREATION, CollectionFeature.ALLOWS_NULL_QUERIES).createTestSuite());
suite.addTest(ListTestSuiteBuilder.using(new ImmutableMapEntryListGenerator()).named("ImmutableMap.entrySet.asList").withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE, CollectionFeature.REJECTS_DUPLICATES_AT_CREATION, CollectionFeature.ALLOWS_NULL_QUERIES).createTestSuite());
suite.addTest(ListTestSuiteBuilder.using(new ImmutableMapValueListGenerator()).named("ImmutableMap.values.asList").withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE, CollectionFeature.ALLOWS_NULL_QUERIES).createTestSuite());
return suite;
}
use of com.google.common.collect.testing.google.MapGenerators.ImmutableMapValueListGenerator in project guava by hceylan.
the class ImmutableMapTest method suite.
@GwtIncompatible("suite")
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(ImmutableMapTest.class);
suite.addTest(MapTestSuiteBuilder.using(new ImmutableMapGenerator()).withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE_INCLUDING_VIEWS, CollectionFeature.KNOWN_ORDER, MapFeature.REJECTS_DUPLICATES_AT_CREATION, CollectionFeature.ALLOWS_NULL_QUERIES).named("ImmutableMap.keySet").createTestSuite());
suite.addTest(CollectionTestSuiteBuilder.using(new ImmutableMapUnhashableValuesGenerator()).withFeatures(CollectionSize.ANY, CollectionFeature.KNOWN_ORDER, CollectionFeature.ALLOWS_NULL_QUERIES).named("ImmutableMap.values, unhashable").createTestSuite());
suite.addTest(ListTestSuiteBuilder.using(new ImmutableMapValueListGenerator()).named("ImmutableMap.values.asList").withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE, CollectionFeature.ALLOWS_NULL_QUERIES).createTestSuite());
return suite;
}
Aggregations