[jboss-cvs] JBossAS SVN: r63941 - in projects/microcontainer/trunk/container/src/tests/org/jboss/test/classinfo: test and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jul 10 10:37:26 EDT 2007
Author: kabir.khan at jboss.com
Date: 2007-07-10 10:37:26 -0400 (Tue, 10 Jul 2007)
New Revision: 63941
Modified:
projects/microcontainer/trunk/container/src/tests/org/jboss/test/classinfo/support/AnnotatedSubClass.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/classinfo/test/AnnotatedClassInfoTest.java
Log:
[JBMICROCONT-124] Test that @Inherited annotated annotations are not inherited for constructors
Modified: projects/microcontainer/trunk/container/src/tests/org/jboss/test/classinfo/support/AnnotatedSubClass.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/classinfo/support/AnnotatedSubClass.java 2007-07-10 13:54:04 UTC (rev 63940)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/classinfo/support/AnnotatedSubClass.java 2007-07-10 14:37:26 UTC (rev 63941)
@@ -30,9 +30,9 @@
public class AnnotatedSubClass extends AnnotatedClass
{
+ @AnotherAnnotation
public AnnotatedSubClass(int i, String x)
{
- // TODO JBMICROCONT-124 AnnotatedSubClass constructor
super(i, x);
}
Modified: projects/microcontainer/trunk/container/src/tests/org/jboss/test/classinfo/test/AnnotatedClassInfoTest.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/classinfo/test/AnnotatedClassInfoTest.java 2007-07-10 13:54:04 UTC (rev 63940)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/classinfo/test/AnnotatedClassInfoTest.java 2007-07-10 14:37:26 UTC (rev 63941)
@@ -187,6 +187,21 @@
}
assertTrue("Not found annotations " + set, set.isEmpty());
+
+ java.lang.reflect.Constructor ctorx = AnnotatedSubClass.class.getConstructors()[0];
+ java.lang.annotation.Annotation[] anns = ctorx.getAnnotations();
+ for (int i = 0 ; i < anns.length ; i++)
+ {
+ System.out.println("==============> " + anns[i].annotationType() + " XXXX");
+ }
+
+ ConstructorInfo[] ctors = info.getDeclaredConstructors();
+ assertEquals(1, ctors.length);
+ ConstructorInfo ctor = ctors[0];
+ annotations = ctor.getAnnotations();
+ assertEquals(1, annotations.length);
+ anotherAnnotation = getAnnotationCheckTypeAndName(ctor, AnotherAnnotation.class.getName());
+
}
public void testClassArrayAnnotations() throws Exception
@@ -238,6 +253,8 @@
assertTrue("Not found annotations " + set, set.isEmpty());
}
+
+
public void testConstructorAnnotations() throws Exception
{
ClassInfo info = getClassInfo(AnnotatedClass.class);
More information about the jboss-cvs-commits
mailing list