Search in sources :

Example 51 with GwtIncompatible

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

the class LinkedHashMultimapTest method suite.

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

        @Override
        protected SetMultimap<String, String> create(Entry<String, String>[] entries) {
            SetMultimap<String, String> multimap = LinkedHashMultimap.create();
            for (Entry<String, String> entry : entries) {
                multimap.put(entry.getKey(), entry.getValue());
            }
            return multimap;
        }
    }).named("LinkedHashMultimap").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.KNOWN_ORDER, CollectionFeature.SERIALIZABLE, CollectionSize.ANY).createTestSuite());
    suite.addTestSuite(LinkedHashMultimapTest.class);
    return suite;
}
Also used : Helpers.mapEntry(com.google.common.collect.testing.Helpers.mapEntry) Entry(java.util.Map.Entry) TestSuite(junit.framework.TestSuite) TestStringSetMultimapGenerator(com.google.common.collect.testing.google.TestStringSetMultimapGenerator) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 52 with GwtIncompatible

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

the class LinkedListMultimapTest 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 = LinkedListMultimap.create();
            for (Entry<String, String> entry : entries) {
                multimap.put(entry.getKey(), entry.getValue());
            }
            return multimap;
        }
    }).named("LinkedListMultimap").withFeatures(MapFeature.ALLOWS_NULL_KEYS, MapFeature.ALLOWS_NULL_VALUES, MapFeature.ALLOWS_ANY_NULL_QUERIES, MapFeature.GENERAL_PURPOSE, CollectionFeature.SUPPORTS_ITERATOR_REMOVE, CollectionFeature.SERIALIZABLE, CollectionFeature.KNOWN_ORDER, CollectionSize.ANY).createTestSuite());
    suite.addTestSuite(LinkedListMultimapTest.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 53 with GwtIncompatible

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

the class ListsTest method testNullPointerExceptions.

// NullPointerTester
@GwtIncompatible
public void testNullPointerExceptions() {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(Lists.class);
}
Also used : NullPointerTester(com.google.common.testing.NullPointerTester) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 54 with GwtIncompatible

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

the class MultimapBuilderTest method reserialize.

// serialization
@GwtIncompatible
private static Object reserialize(Object object) throws Exception {
    ByteArrayOutputStream bytes = new ByteArrayOutputStream();
    new ObjectOutputStream(bytes).writeObject(object);
    return new ObjectInputStream(new ByteArrayInputStream(bytes.toByteArray())).readObject();
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ObjectOutputStream(java.io.ObjectOutputStream) ObjectInputStream(java.io.ObjectInputStream) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 55 with GwtIncompatible

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

the class TreeMultimapNaturalTest method testTreeMultimapDerived.

// SerializableTester
@GwtIncompatible
public void testTreeMultimapDerived() {
    TreeMultimap<DerivedComparable, DerivedComparable> multimap = TreeMultimap.create();
    assertEquals(ImmutableMultimap.of(), multimap);
    multimap.put(new DerivedComparable("foo"), new DerivedComparable("f"));
    multimap.put(new DerivedComparable("foo"), new DerivedComparable("o"));
    multimap.put(new DerivedComparable("foo"), new DerivedComparable("o"));
    multimap.put(new DerivedComparable("bar"), new DerivedComparable("b"));
    multimap.put(new DerivedComparable("bar"), new DerivedComparable("a"));
    multimap.put(new DerivedComparable("bar"), new DerivedComparable("r"));
    assertThat(multimap.keySet()).containsExactly(new DerivedComparable("bar"), new DerivedComparable("foo")).inOrder();
    assertThat(multimap.values()).containsExactly(new DerivedComparable("a"), new DerivedComparable("b"), new DerivedComparable("r"), new DerivedComparable("f"), new DerivedComparable("o")).inOrder();
    assertEquals(Ordering.natural(), multimap.keyComparator());
    assertEquals(Ordering.natural(), multimap.valueComparator());
    SerializableTester.reserializeAndAssert(multimap);
}
Also used : DerivedComparable(com.google.common.collect.testing.DerivedComparable) 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