]> source.dussan.org Git - aspectj.git/commitdiff
307120
authoraclement <aclement>
Thu, 8 Apr 2010 21:16:12 +0000 (21:16 +0000)
committeraclement <aclement>
Thu, 8 Apr 2010 21:16:12 +0000 (21:16 +0000)
tests/multiIncremental/pr307120_2/base/src/Advisor.java [new file with mode: 0644]
tests/multiIncremental/pr307120_2/base/src/Anno.java [new file with mode: 0644]
tests/multiIncremental/pr307120_2/base/src/Target.java [new file with mode: 0644]
tests/multiIncremental/pr307120_2/base/src/TargetAugmenter.java [new file with mode: 0644]
tests/multiIncremental/pr307120_2/inc1/src/TargetAugmenter.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

diff --git a/tests/multiIncremental/pr307120_2/base/src/Advisor.java b/tests/multiIncremental/pr307120_2/base/src/Advisor.java
new file mode 100644 (file)
index 0000000..61b7f5d
--- /dev/null
@@ -0,0 +1,9 @@
+aspect Advisor {
+  Object around(Object o): get(@Anno * *) && this(o) {
+    return proceed(o);
+  }
+
+  Object around(Object o,Object newval): set(@Anno * *) && this(o) && args(newval) {
+    return proceed(o,newval);
+  }
+}
diff --git a/tests/multiIncremental/pr307120_2/base/src/Anno.java b/tests/multiIncremental/pr307120_2/base/src/Anno.java
new file mode 100644 (file)
index 0000000..148fd7c
--- /dev/null
@@ -0,0 +1,4 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Anno {}
diff --git a/tests/multiIncremental/pr307120_2/base/src/Target.java b/tests/multiIncremental/pr307120_2/base/src/Target.java
new file mode 100644 (file)
index 0000000..dfd2ba3
--- /dev/null
@@ -0,0 +1,4 @@
+class Target {
+  @Anno
+  private String it;
+}
diff --git a/tests/multiIncremental/pr307120_2/base/src/TargetAugmenter.java b/tests/multiIncremental/pr307120_2/base/src/TargetAugmenter.java
new file mode 100644 (file)
index 0000000..0537967
--- /dev/null
@@ -0,0 +1,9 @@
+privileged aspect TargetAugmenter {
+  public String Target.getIt() {
+    return it;
+  }
+
+  public void Target.setIt(String newit) {
+    this.it = newit;
+  }
+}
diff --git a/tests/multiIncremental/pr307120_2/inc1/src/TargetAugmenter.java b/tests/multiIncremental/pr307120_2/inc1/src/TargetAugmenter.java
new file mode 100644 (file)
index 0000000..0537967
--- /dev/null
@@ -0,0 +1,9 @@
+privileged aspect TargetAugmenter {
+  public String Target.getIt() {
+    return it;
+  }
+
+  public void Target.setIt(String newit) {
+    this.it = newit;
+  }
+}
index c77188fe6ae258750e393686c64baf6d00723a75..b114bf7dc216ecd593248af88bb602e66df998fb 100644 (file)
@@ -256,6 +256,27 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                assertEquals(4, getRelationshipCount(p));
        }
 
+       // More sophisticated variant of above.
+       public void testIncrementalAdvisingItdJoinpointsAccessingPrivFields_307120_2() throws Exception {
+               String p = "pr307120_2";
+               initialiseProject(p);
+               build(p);
+               assertNoErrors(p);
+               //              Hid:2:(targets=1) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.setIt)QString; (declared on) =pr307120_2<{Target.java[Target
+               //              Hid:8:(targets=1) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.getIt (declared on) =pr307120_2<{Target.java[Target
+               //              Hid:5:(targets=2) =pr307120_2<{Target.java[Target (aspect declarations) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.getIt
+               //              Hid:6:(targets=2) =pr307120_2<{Target.java[Target (aspect declarations) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.setIt)QString;         
+               //              Hid:1:(targets=1) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.setIt)QString;?field-set(java.lang.String Target.it) (advised by) =pr307120_2<{Advisor.java}Advisor&around&QObject;&QObject;
+               //              Hid:3:(targets=1) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.getIt?field-get(java.lang.String Target.it) (advised by) =pr307120_2<{Advisor.java}Advisor&around&QObject;
+               //              Hid:4:(targets=1) =pr307120_2<{Advisor.java}Advisor&around&QObject; (advises) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.getIt?field-get(java.lang.String Target.it)
+               //              Hid:7:(targets=1) =pr307120_2<{Advisor.java}Advisor&around&QObject;&QObject; (advises) =pr307120_2<{TargetAugmenter.java}TargetAugmenter)Target.setIt)QString;?field-set(java.lang.String Target.it)
+               assertEquals(8, getRelationshipCount(p));
+               alter(p, "inc1");
+               build(p);
+               assertEquals(8, getRelationshipCount(p));               
+               assertNoErrors(p);
+       }
+
        // modified aspect so target is fully qualified on the incremental change
        public void testIncrementalFqItds_280380_2() throws Exception {
                String p = "pr280380";