diff options
author | aclement <aclement> | 2004-12-09 15:19:39 +0000 |
---|---|---|
committer | aclement <aclement> | 2004-12-09 15:19:39 +0000 |
commit | 60b62539f1f1887f9c66caa995254e9e4ea89f2b (patch) | |
tree | b2aade0e9a6dc89fb212b0e355cba7fff238b4f1 /bcel-builder/testsrc/org/aspectj | |
parent | d474aa398cd671644f48fe8ffe55095109700a1e (diff) | |
download | aspectj-60b62539f1f1887f9c66caa995254e9e4ea89f2b.tar.gz aspectj-60b62539f1f1887f9c66caa995254e9e4ea89f2b.zip |
Allows for MarkerAnnotations - doh! (i.e. ones with no values) and unpacks invis annotations on classgens correctly.
Diffstat (limited to 'bcel-builder/testsrc/org/aspectj')
3 files changed, 36 insertions, 1 deletions
diff --git a/bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/AllTests.java b/bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/AllTests.java index 69d41d6b8..c2a087166 100644 --- a/bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/AllTests.java +++ b/bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/AllTests.java @@ -48,6 +48,7 @@ public class AllTests { suite.addTestSuite(AnnotationGenTest.class); suite.addTestSuite(ParameterAnnotationsTest.class); suite.addTestSuite(GeneratingAnnotatedClassesTest.class); + suite.addTestSuite(TypeAnnotationsTest.class); //$JUnit-END$ return suite; } diff --git a/bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/MethodAnnotationsTest.java b/bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/MethodAnnotationsTest.java index 5740add02..dab8e7cf3 100644 --- a/bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/MethodAnnotationsTest.java +++ b/bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/MethodAnnotationsTest.java @@ -30,7 +30,6 @@ public class MethodAnnotationsTest extends BcelTestCase { super.setUp(); } - public void testMethodAnnotations() throws ClassNotFoundException { JavaClass clazz = getClassFromJar("AnnotatedMethods"); diff --git a/bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/TypeAnnotationsTest.java b/bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/TypeAnnotationsTest.java new file mode 100644 index 000000000..88313faf3 --- /dev/null +++ b/bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/TypeAnnotationsTest.java @@ -0,0 +1,35 @@ +/* ******************************************************************* + * Copyright (c) 2004 IBM + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Common Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * Andy Clement - initial implementation + * ******************************************************************/ + +package org.aspectj.apache.bcel.classfile.tests; + +import org.aspectj.apache.bcel.classfile.JavaClass; +import org.aspectj.apache.bcel.generic.ClassGen; +import org.aspectj.apache.bcel.generic.annotation.AnnotationGen; + + +public class TypeAnnotationsTest extends BcelTestCase { + + + protected void setUp() throws Exception { + super.setUp(); + } + + public void testMarkerAnnotationsOnTypes() throws ClassNotFoundException { + JavaClass clazz = getClassFromJar("MarkedType"); + ClassGen cg = new ClassGen(clazz); + AnnotationGen[] annotations = cg.getAnnotations(); + assertTrue("Should be a MarkerAnnotation and a MarkerAnnotationInvisible - but found: "+annotations.length,annotations.length==2); + } + + +} |