diff options
author | aclement <aclement> | 2009-08-13 17:29:15 +0000 |
---|---|---|
committer | aclement <aclement> | 2009-08-13 17:29:15 +0000 |
commit | 7f3501bfabd4c8b305ca7b0b750b5a6713b9735b (patch) | |
tree | 7d2f2ab8c4e62fe6d5cba13a63790615d502135d /tests | |
parent | 64f0ff99ca52e37298666b1ef7f8d5ef0bc8caa4 (diff) | |
download | aspectj-7f3501bfabd4c8b305ca7b0b750b5a6713b9735b.tar.gz aspectj-7f3501bfabd4c8b305ca7b0b750b5a6713b9735b.zip |
286539: test and fix (decanno type in model)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/multiIncremental/pr286539/base/src/p/q/Aspect.java | 26 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java | 39 |
2 files changed, 65 insertions, 0 deletions
diff --git a/tests/multiIncremental/pr286539/base/src/p/q/Aspect.java b/tests/multiIncremental/pr286539/base/src/p/q/Aspect.java new file mode 100644 index 000000000..5b33da10d --- /dev/null +++ b/tests/multiIncremental/pr286539/base/src/p/q/Aspect.java @@ -0,0 +1,26 @@ +package p.q.r; +import java.lang.annotation.*; + +aspect Asp { + +declare parents: C implements p.q.r.Int; +declare parents: C implements Int; +declare @type: C: @Foo; +declare @type: C: @p.q.r.Goo; + +declare @field: int C.i: @Foo; +declare @method: void C.m(): @Foo; +declare @constructor: new(): @Foo; + +} + +@Retention(RetentionPolicy.RUNTIME) @interface Foo {} +@Retention(RetentionPolicy.RUNTIME) @interface Goo {} + +interface Int {} + +class C { + int i; + void m() {} + C() {} +} diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index 9e01a5694..5d2430eda 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -138,6 +138,45 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa // printModel(cli); // } + // Testing that declare annotation model entries preserve the fully qualified type of the annotation + public void testDecAnnoState_pr286539() throws Exception { + String p = "pr286539"; + initialiseProject(p); + build(p); + printModel(p); + IProgramElement decpPE = getModelFor(p).getHierarchy().findElementForHandle( + "=pr286539<p.q.r{Aspect.java}Asp`declare parents"); + assertNotNull(decpPE); + String s = (String) (((List) decpPE.getParentTypes()).get(0)); + assertEquals("p.q.r.Int", s); + + decpPE = getModelFor(p).getHierarchy().findElementForHandle("=pr286539<p.q.r{Aspect.java}Asp`declare parents!2"); + assertNotNull(decpPE); + s = (String) (((List) decpPE.getParentTypes()).get(0)); + assertEquals("p.q.r.Int", s); + + IProgramElement decaPE = getModelFor(p).getHierarchy().findElementForHandle( + "=pr286539<p.q.r{Aspect.java}Asp`declare \\@type"); + assertNotNull(decaPE); + assertEquals("p.q.r.Foo", decaPE.getAnnotationType()); + + decaPE = getModelFor(p).getHierarchy().findElementForHandle("=pr286539<p.q.r{Aspect.java}Asp`declare \\@type!2"); + assertNotNull(decaPE); + assertEquals("p.q.r.Goo", decaPE.getAnnotationType()); + + decaPE = getModelFor(p).getHierarchy().findElementForHandle("=pr286539<p.q.r{Aspect.java}Asp`declare \\@field"); + assertNotNull(decaPE); + assertEquals("p.q.r.Foo", decaPE.getAnnotationType()); + + decaPE = getModelFor(p).getHierarchy().findElementForHandle("=pr286539<p.q.r{Aspect.java}Asp`declare \\@method"); + assertNotNull(decaPE); + assertEquals("p.q.r.Foo", decaPE.getAnnotationType()); + + decaPE = getModelFor(p).getHierarchy().findElementForHandle("=pr286539<p.q.r{Aspect.java}Asp`declare \\@constructor"); + assertNotNull(decaPE); + assertEquals("p.q.r.Foo", decaPE.getAnnotationType()); + } + // just simple incremental build - no code change, just the aspect touched public void testIncrementalFqItds_280380() throws Exception { String p = "pr280380"; |