add reverse equality test assertions

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@996711 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Matthew Jason Benson 2010-09-13 22:20:03 +00:00
parent 857cf0714d
commit fc3a096305
1 changed files with 4 additions and 0 deletions

View File

@ -391,6 +391,7 @@ public class AnnotationUtilsTest {
@Test
public void testEquivalence() {
assertTrue(AnnotationUtils.equals(field1.getAnnotation(TestAnnotation.class), field2.getAnnotation(TestAnnotation.class)));
assertTrue(AnnotationUtils.equals(field2.getAnnotation(TestAnnotation.class), field1.getAnnotation(TestAnnotation.class)));
}
@Test
@ -401,16 +402,19 @@ public class AnnotationUtilsTest {
@Test
public void testNonEquivalentAnnotationsOfSameType() {
assertFalse(AnnotationUtils.equals(field1.getAnnotation(TestAnnotation.class), field3.getAnnotation(TestAnnotation.class)));
assertFalse(AnnotationUtils.equals(field3.getAnnotation(TestAnnotation.class), field1.getAnnotation(TestAnnotation.class)));
}
@Test
public void testAnnotationsOfDifferingTypes() {
assertFalse(AnnotationUtils.equals(field1.getAnnotation(TestAnnotation.class), field4.getAnnotation(NestAnnotation.class)));
assertFalse(AnnotationUtils.equals(field4.getAnnotation(NestAnnotation.class), field1.getAnnotation(TestAnnotation.class)));
}
@Test
public void testOneArgNull() {
assertFalse(AnnotationUtils.equals(field1.getAnnotation(TestAnnotation.class), null));
assertFalse(AnnotationUtils.equals(null, field1.getAnnotation(TestAnnotation.class)));
}
@Test