diff options
Diffstat (limited to 'guava-tests/test/com/google/common/base/PredicatesTest.java')
-rw-r--r-- | guava-tests/test/com/google/common/base/PredicatesTest.java | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/guava-tests/test/com/google/common/base/PredicatesTest.java b/guava-tests/test/com/google/common/base/PredicatesTest.java index 8aeebdc..c256c71 100644 --- a/guava-tests/test/com/google/common/base/PredicatesTest.java +++ b/guava-tests/test/com/google/common/base/PredicatesTest.java @@ -21,7 +21,6 @@ import static com.google.common.base.CharMatcher.WHITESPACE; import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible; import com.google.common.collect.ImmutableSet; -import com.google.common.testing.ClassSanityTester; import com.google.common.testing.EqualsTester; import com.google.common.testing.NullPointerTester; import com.google.common.testing.SerializableTester; @@ -597,15 +596,15 @@ public class PredicatesTest extends TestCase { public void testIsInstanceOf_serialization() { checkSerialization(Predicates.instanceOf(Integer.class)); } - + @GwtIncompatible("Predicates.assignableFrom") public void testIsAssignableFrom_apply() { Predicate<Class<?>> isInteger = Predicates.assignableFrom(Integer.class); assertTrue(isInteger.apply(Integer.class)); assertFalse(isInteger.apply(Float.class)); - - try { + + try { isInteger.apply(null); fail(); } catch(NullPointerException expected) {} @@ -641,7 +640,7 @@ public class PredicatesTest extends TestCase { @GwtIncompatible("Predicates.assignableFrom, SerializableTester") public void testIsAssignableFrom_serialization() { - Predicate<Class<?>> predicate = + Predicate<Class<?>> predicate = Predicates.assignableFrom(Integer.class); Predicate<Class<?>> reserialized = SerializableTester.reserializeAndAssert(predicate); @@ -764,7 +763,7 @@ public class PredicatesTest extends TestCase { } @GwtIncompatible("NullPointerTester") - public void testNullPointerExceptions() { + public void testNullPointerExceptions() throws Exception { NullPointerTester tester = new NullPointerTester(); tester.testAllPublicStaticMethods(Predicates.class); } @@ -909,22 +908,12 @@ public class PredicatesTest extends TestCase { assertEqualHashCode( Predicates.or(p1, p2), Predicates.or(p1, p2)); - + // While not a contractual requirement, we'd like the hash codes for ands - // & ors of the same predicates to not collide. + // & ors of the same predicates to not collide. assertTrue(Predicates.and(p1, p2).hashCode() != Predicates.or(p1, p2).hashCode()); } - @GwtIncompatible("reflection") - public void testNulls() throws Exception { - new ClassSanityTester().forAllPublicStaticMethods(Predicates.class).testNulls(); - } - - @GwtIncompatible("reflection") - public void testEqualsAndSerializable() throws Exception { - new ClassSanityTester().forAllPublicStaticMethods(Predicates.class).testEqualsAndSerializable(); - } - private static void assertEvalsToTrue(Predicate<? super Integer> predicate) { assertTrue(predicate.apply(0)); assertTrue(predicate.apply(1)); |