aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2009-03-27 17:34:38 +0000
committeraclement <aclement>2009-03-27 17:34:38 +0000
commita2703cf03d909a2dbc78f5b169225270f8308606 (patch)
tree9e260296b871b3933dbd1ed0e044d9b559ddbc8a /tests
parent900ae342e62d9f193c773da8d93e3d52c2e680c2 (diff)
downloadaspectj-a2703cf03d909a2dbc78f5b169225270f8308606.tar.gz
aspectj-a2703cf03d909a2dbc78f5b169225270f8308606.zip
269286: handles for anno style elements
Diffstat (limited to 'tests')
-rw-r--r--tests/multiIncremental/pr269286/base/src/Logger.java30
-rw-r--r--tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java25
2 files changed, 55 insertions, 0 deletions
diff --git a/tests/multiIncremental/pr269286/base/src/Logger.java b/tests/multiIncremental/pr269286/base/src/Logger.java
new file mode 100644
index 000000000..faddbec7c
--- /dev/null
+++ b/tests/multiIncremental/pr269286/base/src/Logger.java
@@ -0,0 +1,30 @@
+import org.aspectj.lang.annotation.*;
+
+@Aspect
+public class Logger {
+
+ @Before("execution(* O*.*())")
+ public void boo() {
+
+ }
+ @After("execution(* O*.*())")
+ public void aoo() {
+
+ }
+ @Around("execution(* O*.*())")
+ public void aroo() {
+
+ }
+
+@Pointcut("execution(* *(..))")
+public void ooo() {}
+
+
+@DeclareWarning("execution(* xxx(..))")
+public static final String message ="hello";
+
+@DeclareError("execution(* xxx(..))")
+public static final String message2 ="gello";
+
+}
+
diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
index ab4f462a8..bc9f40009 100644
--- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
+++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
@@ -1067,6 +1067,31 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
assertEquals("=pr265993<{A.java[A~m13~QClass\\<QT;>;~QObject;~QString;", findElementAtLine(root, 17).getHandleIdentifier());
}
+ public void testHandlesForAnnotationStyle_pr269286() throws IOException {
+ String p = "pr269286";
+ initialiseProject(p);
+ build(p);
+ IProgramElement root = getModelFor(p).getHierarchy().getRoot();
+ dumptree(getModelFor(p).getHierarchy().getRoot(), 0);
+ PrintWriter pw = new PrintWriter(System.out);
+ getModelFor(p).dumprels(pw);
+ pw.flush();
+ assertEquals("=pr269286<{Logger.java[Logger", findElementAtLine(root, 4).getHandleIdentifier()); // type
+ assertEquals("=pr269286<{Logger.java[Logger~boo", findElementAtLine(root, 7).getHandleIdentifier()); // before
+ assertEquals("=pr269286<{Logger.java[Logger~aoo", findElementAtLine(root, 11).getHandleIdentifier()); // after
+ assertEquals("=pr269286<{Logger.java[Logger~aroo", findElementAtLine(root, 15).getHandleIdentifier()); // around
+
+ // pointcuts are not fixed - seems to buggy handling of them internally
+ assertEquals("=pr269286<{Logger.java[Logger+ooo", findElementAtLine(root, 20).getHandleIdentifier());
+
+ // DeclareWarning
+ assertEquals("=pr269286<{Logger.java[Logger^message", findElementAtLine(root, 24).getHandleIdentifier());
+
+ // DeclareError
+ assertEquals("=pr269286<{Logger.java[Logger^message2", findElementAtLine(root, 27).getHandleIdentifier());
+ }
+
+
public void testX() throws IOException {
String p = "prx";
initialiseProject(p);