diff options
Diffstat (limited to 'guava-tests/test/com/google/common/base/FunctionsTest.java')
-rw-r--r-- | guava-tests/test/com/google/common/base/FunctionsTest.java | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/guava-tests/test/com/google/common/base/FunctionsTest.java b/guava-tests/test/com/google/common/base/FunctionsTest.java index cc7b4f2..e74f622 100644 --- a/guava-tests/test/com/google/common/base/FunctionsTest.java +++ b/guava-tests/test/com/google/common/base/FunctionsTest.java @@ -20,7 +20,6 @@ import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; -import com.google.common.testing.ClassSanityTester; import com.google.common.testing.EqualsTester; import com.google.common.testing.NullPointerTester; import com.google.common.testing.SerializableTester; @@ -79,7 +78,7 @@ public class FunctionsTest extends TestCase { } @GwtIncompatible("NullPointerTester") - public void testNullPointerExceptions() { + public void testNullPointerExceptions() throws Exception { NullPointerTester tester = new NullPointerTester(); tester.testAllPublicStaticMethods(Functions.class); } @@ -386,14 +385,14 @@ public class FunctionsTest extends TestCase { implements Supplier<Integer>, Serializable { private static final long serialVersionUID = 0; - + private int value; @Override public Integer get() { return ++value; } - + @Override public boolean equals(Object obj) { if (obj instanceof CountingSupplier) { @@ -401,7 +400,7 @@ public class FunctionsTest extends TestCase { } return false; } - + @Override public int hashCode() { return value; @@ -414,7 +413,7 @@ public class FunctionsTest extends TestCase { assertEquals(1, (int) function.apply(null)); assertEquals(2, (int) function.apply("foo")); - + new EqualsTester() .addEqualityGroup(function, Functions.forSupplier(supplier)) .addEqualityGroup(Functions.forSupplier(new CountingSupplier())) @@ -428,18 +427,8 @@ public class FunctionsTest extends TestCase { checkCanReserialize(Functions.forSupplier(new CountingSupplier())); } - @GwtIncompatible("reflection") - public void testNulls() throws Exception { - new ClassSanityTester().forAllPublicStaticMethods(Functions.class).testNulls(); - } - - @GwtIncompatible("reflection") - public void testEqualsAndSerializable() throws Exception { - new ClassSanityTester().forAllPublicStaticMethods(Functions.class).testEqualsAndSerializable(); - } - @GwtIncompatible("SerializableTester") - private static <Y> void checkCanReserialize(Function<? super Integer, Y> f) { + private <Y> void checkCanReserialize(Function<? super Integer, Y> f) { Function<? super Integer, Y> g = SerializableTester.reserializeAndAssert(f); for (int i = 1; i < 5; i++) { // convoluted way to check that the same result happens from each @@ -459,7 +448,7 @@ public class FunctionsTest extends TestCase { } @GwtIncompatible("SerializableTester") - private static <Y> void checkCanReserializeSingleton(Function<? super String, Y> f) { + private <Y> void checkCanReserializeSingleton(Function<? super String, Y> f) { Function<? super String, Y> g = SerializableTester.reserializeAndAssert(f); assertSame(f, g); for (Integer i = 1; i < 5; i++) { |