mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-22 14:09:25 +00:00
[SPR-3635] [SPR-5039] [SPR-5813] JMX annotation inheritance fixed
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1852 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
+35
@@ -188,6 +188,22 @@ public class AnnotationUtilsTests {
|
||||
assertEquals(Ordered.LOWEST_PRECEDENCE, AnnotationUtils.getDefaultValue(Order.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFindAnnotationFromInterface() throws Exception {
|
||||
|
||||
Method method = ImplementsInterfaceWithAnnotatedMethod.class.getMethod("foo");
|
||||
Order order = findAnnotation(method, Order.class);
|
||||
assertNotNull(order);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFindAnnotationFromInterfaceOnSuper() throws Exception {
|
||||
|
||||
Method method = SubOfImplementsInterfaceWithAnnotatedMethod.class.getMethod("foo");
|
||||
Order order = findAnnotation(method, Order.class);
|
||||
assertNotNull(order);
|
||||
}
|
||||
|
||||
public static interface AnnotatedInterface {
|
||||
|
||||
@Order(0)
|
||||
@@ -286,6 +302,25 @@ public class AnnotationUtilsTests {
|
||||
public static class SubNonInheritedAnnotationClass extends NonInheritedAnnotationClass {
|
||||
}
|
||||
|
||||
|
||||
public static interface InterfaceWithAnnotatedMethod {
|
||||
|
||||
@Order
|
||||
void foo();
|
||||
}
|
||||
|
||||
public static class ImplementsInterfaceWithAnnotatedMethod implements InterfaceWithAnnotatedMethod {
|
||||
|
||||
public void foo() {
|
||||
}
|
||||
}
|
||||
|
||||
public static class SubOfImplementsInterfaceWithAnnotatedMethod extends ImplementsInterfaceWithAnnotatedMethod {
|
||||
|
||||
public void foo() {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
||||
Reference in New Issue
Block a user