aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2008-08-28 02:29:29 +0000
committeraclement <aclement>2008-08-28 02:29:29 +0000
commit5077a5824f695906fc635c36e42af1c9d960ffca (patch)
tree05b3080bb8713d37362ea6c1082cddcb4780626d /tests
parent5498d0a84762c437b6bff443d6cc1e1e5c914dce (diff)
downloadaspectj-5077a5824f695906fc635c36e42af1c9d960ffca.tar.gz
aspectj-5077a5824f695906fc635c36e42af1c9d960ffca.zip
245307: test and fix: Aspected annotations cause ajdoc to generate ClassCastExceptions
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs153/Annotation/A.java7
-rw-r--r--tests/bugs153/Annotation/Anno.aj5
-rw-r--r--tests/bugs153/Annotation/C.java3
-rw-r--r--tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java12
-rw-r--r--tests/src/org/aspectj/systemtest/ajc153/ajc153.xml4
5 files changed, 31 insertions, 0 deletions
diff --git a/tests/bugs153/Annotation/A.java b/tests/bugs153/Annotation/A.java
new file mode 100644
index 000000000..b74335b9d
--- /dev/null
+++ b/tests/bugs153/Annotation/A.java
@@ -0,0 +1,7 @@
+package annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+@Target(ElementType.TYPE)
+public @interface A { }
diff --git a/tests/bugs153/Annotation/Anno.aj b/tests/bugs153/Annotation/Anno.aj
new file mode 100644
index 000000000..acfdae4b9
--- /dev/null
+++ b/tests/bugs153/Annotation/Anno.aj
@@ -0,0 +1,5 @@
+import annotation.A;
+
+public aspect Anno {
+ declare @type: C : @A;
+}
diff --git a/tests/bugs153/Annotation/C.java b/tests/bugs153/Annotation/C.java
new file mode 100644
index 000000000..7fe8ac4ab
--- /dev/null
+++ b/tests/bugs153/Annotation/C.java
@@ -0,0 +1,3 @@
+// import
+public class C {
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
index 21119d00a..63dd83ef5 100644
--- a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
@@ -235,6 +235,18 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
" but found " + ipe.getSourceSignature(),
expected, ipe.getSourceSignature());
}
+ public void testAspected_Annotation(){
+ runTest("ensure Annotations are added to import list");
+ IHierarchy top = AsmManager.getDefault().getHierarchy();
+
+ IProgramElement ipe = top.findElementForLabel(top.getRoot(),
+ IProgramElement.Kind.IMPORT_REFERENCE,"annotation.A");
+ String expected = "import annotation.A;";
+ assertEquals("expected source signature to be " + expected +
+ " but found " + ipe.getSourceSignature(),
+ expected, ipe.getSourceSignature());
+
+ }
public void testGetSourceSignature_GenericMethods(){
runTest("ensure getSourceSignature correct with generic method");
diff --git a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
index 6f50adc14..1b235854e 100644
--- a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
+++ b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
@@ -849,4 +849,8 @@
<ajc-test dir="bugs153/GenericMethod" title="ensure getSourceSignature correct with generic method">
<compile files="C.java" options="-1.5 -emacssym"/>
</ajc-test>
+
+ <ajc-test dir="bugs153/Annotation" title="ensure Annotations are added to import list">
+ <compile files="C.java, Anno.aj, A.java" options="-1.5 -emacssym"/>
+ </ajc-test>
</suite> \ No newline at end of file