Search in sources :

Example 21 with GwtIncompatible

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

the class FunctionsTest method testForMapWithDefault_null_compareWithSerializable.

// SerializableTester
@GwtIncompatible
public void testForMapWithDefault_null_compareWithSerializable() {
    ImmutableMap<String, Integer> map = ImmutableMap.of("One", 1);
    Function<String, Integer> function = Functions.forMap(map, null);
    assertEquals((Integer) 1, function.apply("One"));
    assertNull(function.apply("Two"));
    // check basic sanity of equals and hashCode
    new EqualsTester().addEqualityGroup(function, SerializableTester.reserialize(function)).addEqualityGroup(Functions.forMap(map, 1)).testEquals();
}
Also used : EqualsTester(com.google.common.testing.EqualsTester) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 22 with GwtIncompatible

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

the class PredicatesTest method testContains_nulls.

// NullPointerTester
@GwtIncompatible
public void testContains_nulls() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    Predicate<CharSequence> isWooPattern = Predicates.contains(Pattern.compile("Woo"));
    tester.testAllPublicInstanceMethods(isWooPattern);
}
Also used : NullPointerTester(com.google.common.testing.NullPointerTester) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 23 with GwtIncompatible

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

the class PredicatesTest method testNullPointerExceptions.

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

Example 24 with GwtIncompatible

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

the class EnumBiMapTest method testNulls.

// reflection
@GwtIncompatible
public void testNulls() {
    new NullPointerTester().testAllPublicStaticMethods(EnumBiMap.class);
    new NullPointerTester().testAllPublicInstanceMethods(EnumBiMap.create(ImmutableMap.of(Currency.DOLLAR, Country.CHILE)));
}
Also used : NullPointerTester(com.google.common.testing.NullPointerTester) GwtIncompatible(com.google.common.annotations.GwtIncompatible)

Example 25 with GwtIncompatible

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

the class Collections2Test method testNullPointerExceptions.

// NullPointerTester
@GwtIncompatible
public void testNullPointerExceptions() {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(Collections2.class);
}
Also used : NullPointerTester(com.google.common.testing.NullPointerTester) 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