Search in sources :

Example 26 with GwtIncompatible

use of com.google.common.annotations.GwtIncompatible in project guava by google.

the class ArrayListMultimapTest method suite.

// suite
@GwtIncompatible
public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.addTest(ListMultimapTestSuiteBuilder.using(new TestStringListMultimapGenerator() {

        @Override
        protected ListMultimap<String, String> create(Entry<String, String>[] entries) {
            ListMultimap<String, String> multimap = ArrayListMultimap.create();
            for (Entry<String, String> entry : entries) {
                multimap.put(entry.getKey(), entry.getValue());
            }
            return multimap;
        }
    }).named("ArrayListMultimap").withFeatures(MapFeature.ALLOWS_NULL_KEYS, MapFeature.ALLOWS_NULL_VALUES, MapFeature.ALLOWS_ANY_NULL_QUERIES, MapFeature.GENERAL_PURPOSE, MapFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION, CollectionFeature.SUPPORTS_ITERATOR_REMOVE, CollectionFeature.SERIALIZABLE, CollectionSize.ANY).createTestSuite());
    suite.addTestSuite(ArrayListMultimapTest.class);
    return suite;
}
Also used : Entry(java.util.Map.Entry) TestSuite(junit.framework.TestSuite) TestStringListMultimapGenerator(com.google.common.collect.testing.google.TestStringListMultimapGenerator) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 27 with GwtIncompatible

use of com.google.common.annotations.GwtIncompatible in project guava by google.

the class HashBiMapTest method suite.

// suite
@GwtIncompatible
public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.addTest(BiMapTestSuiteBuilder.using(new HashBiMapGenerator()).named("HashBiMap").withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE, CollectionFeature.SUPPORTS_ITERATOR_REMOVE, CollectionFeature.KNOWN_ORDER, MapFeature.ALLOWS_NULL_KEYS, MapFeature.ALLOWS_NULL_VALUES, MapFeature.ALLOWS_ANY_NULL_QUERIES, MapFeature.GENERAL_PURPOSE).createTestSuite());
    suite.addTestSuite(HashBiMapTest.class);
    return suite;
}
Also used : TestSuite(junit.framework.TestSuite) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 28 with GwtIncompatible

use of com.google.common.annotations.GwtIncompatible in project guava by google.

the class ImmutableBiMapTest method suite.

// TODO: Reduce duplication of ImmutableMapTest code
// suite
@GwtIncompatible
public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.addTestSuite(MapTests.class);
    suite.addTestSuite(InverseMapTests.class);
    suite.addTestSuite(CreationTests.class);
    suite.addTestSuite(BiMapSpecificTests.class);
    suite.addTestSuite(FloodingTest.class);
    suite.addTest(BiMapTestSuiteBuilder.using(new ImmutableBiMapGenerator()).named("ImmutableBiMap").withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE, CollectionFeature.KNOWN_ORDER, MapFeature.REJECTS_DUPLICATES_AT_CREATION, MapFeature.ALLOWS_ANY_NULL_QUERIES).suppressing(BiMapInverseTester.getInverseSameAfterSerializingMethods()).createTestSuite());
    suite.addTest(BiMapTestSuiteBuilder.using(new TestStringBiMapGenerator() {

        @Override
        protected BiMap<String, String> create(Entry<String, String>[] entries) {
            return ImmutableBiMap.<String, String>builder().putAll(Arrays.asList(entries)).buildJdkBacked();
        }
    }).named("ImmutableBiMap [JDK backed]").withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE, CollectionFeature.KNOWN_ORDER, MapFeature.REJECTS_DUPLICATES_AT_CREATION, MapFeature.ALLOWS_ANY_NULL_QUERIES).suppressing(BiMapInverseTester.getInverseSameAfterSerializingMethods()).createTestSuite());
    suite.addTest(BiMapTestSuiteBuilder.using(new ImmutableBiMapCopyOfGenerator()).named("ImmutableBiMap.copyOf[Map]").withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE, CollectionFeature.KNOWN_ORDER, MapFeature.ALLOWS_ANY_NULL_QUERIES).suppressing(BiMapInverseTester.getInverseSameAfterSerializingMethods()).createTestSuite());
    suite.addTest(BiMapTestSuiteBuilder.using(new ImmutableBiMapCopyOfEntriesGenerator()).named("ImmutableBiMap.copyOf[Iterable<Entry>]").withFeatures(CollectionSize.ANY, CollectionFeature.SERIALIZABLE, CollectionFeature.KNOWN_ORDER, MapFeature.REJECTS_DUPLICATES_AT_CREATION, MapFeature.ALLOWS_ANY_NULL_QUERIES).suppressing(BiMapInverseTester.getInverseSameAfterSerializingMethods()).createTestSuite());
    suite.addTestSuite(ImmutableBiMapTest.class);
    return suite;
}
Also used : TestSuite(junit.framework.TestSuite) ImmutableBiMapGenerator(com.google.common.collect.testing.google.BiMapGenerators.ImmutableBiMapGenerator) TestStringBiMapGenerator(com.google.common.collect.testing.google.TestStringBiMapGenerator) ImmutableBiMapCopyOfGenerator(com.google.common.collect.testing.google.BiMapGenerators.ImmutableBiMapCopyOfGenerator) ImmutableBiMapCopyOfEntriesGenerator(com.google.common.collect.testing.google.BiMapGenerators.ImmutableBiMapCopyOfEntriesGenerator) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 29 with GwtIncompatible

use of com.google.common.annotations.GwtIncompatible in project guava by google.

the class ImmutableListMultimapTest method suite.

// suite
@GwtIncompatible
public static Test suite() {
    TestSuite suite = new TestSuite();
    suite.addTest(ListMultimapTestSuiteBuilder.using(new ImmutableListMultimapGenerator()).named("ImmutableListMultimap").withFeatures(ALLOWS_ANY_NULL_QUERIES, SERIALIZABLE, KNOWN_ORDER, CollectionSize.ANY).createTestSuite());
    suite.addTest(ListMultimapTestSuiteBuilder.using(new ImmutableListMultimapCopyOfEntriesGenerator()).named("ImmutableListMultimap.copyOf[Iterable<Entry>]").withFeatures(ALLOWS_ANY_NULL_QUERIES, SERIALIZABLE, KNOWN_ORDER, CollectionSize.ANY).createTestSuite());
    suite.addTestSuite(ImmutableListMultimapTest.class);
    return suite;
}
Also used : TestSuite(junit.framework.TestSuite) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 30 with GwtIncompatible

use of com.google.common.annotations.GwtIncompatible 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;
}
Also used : ImmutableMapValueListGenerator(com.google.common.collect.testing.google.MapGenerators.ImmutableMapValueListGenerator) CollectionTestSuiteBuilder(com.google.common.collect.testing.CollectionTestSuiteBuilder) Builder(com.google.common.collect.ImmutableMap.Builder) ListTestSuiteBuilder(com.google.common.collect.testing.ListTestSuiteBuilder) MapTestSuiteBuilder(com.google.common.collect.testing.MapTestSuiteBuilder) ImmutableMapKeyListGenerator(com.google.common.collect.testing.google.MapGenerators.ImmutableMapKeyListGenerator) ImmutableMapUnhashableValuesGenerator(com.google.common.collect.testing.google.MapGenerators.ImmutableMapUnhashableValuesGenerator) Entry(java.util.Map.Entry) Helpers.mapEntry(com.google.common.collect.testing.Helpers.mapEntry) TestSuite(junit.framework.TestSuite) ImmutableMapGenerator(com.google.common.collect.testing.google.MapGenerators.ImmutableMapGenerator) TestStringMapGenerator(com.google.common.collect.testing.TestStringMapGenerator) ImmutableMapCopyOfEntriesGenerator(com.google.common.collect.testing.google.MapGenerators.ImmutableMapCopyOfEntriesGenerator) ImmutableMapValuesAsSingletonSetGenerator(com.google.common.collect.testing.google.MapGenerators.ImmutableMapValuesAsSingletonSetGenerator) ImmutableMapCopyOfEnumMapGenerator(com.google.common.collect.testing.google.MapGenerators.ImmutableMapCopyOfEnumMapGenerator) Map(java.util.Map) EnumMap(java.util.EnumMap) LinkedHashMap(java.util.LinkedHashMap) AbstractMap(java.util.AbstractMap) ImmutableMapEntryListGenerator(com.google.common.collect.testing.google.MapGenerators.ImmutableMapEntryListGenerator) ImmutableMapCopyOfGenerator(com.google.common.collect.testing.google.MapGenerators.ImmutableMapCopyOfGenerator) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Aggregations

GwtIncompatible (com.google.common.annotations.GwtIncompatible)361 NullPointerTester (com.google.common.testing.NullPointerTester)105 TestSuite (junit.framework.TestSuite)54 BigInteger (java.math.BigInteger)40 RoundingMode (java.math.RoundingMode)39 CountDownLatch (java.util.concurrent.CountDownLatch)25 ExecutorService (java.util.concurrent.ExecutorService)18 CancellationException (java.util.concurrent.CancellationException)17 Random (java.util.Random)16 ListTestSuiteBuilder (com.google.common.collect.testing.ListTestSuiteBuilder)15 ExecutionException (java.util.concurrent.ExecutionException)15 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)15 IOException (java.io.IOException)14 BigDecimal (java.math.BigDecimal)14 TestStringSetGenerator (com.google.common.collect.testing.TestStringSetGenerator)11 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)11 TimeoutException (java.util.concurrent.TimeoutException)11 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)11 EqualsTester (com.google.common.testing.EqualsTester)10 List (java.util.List)10