aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/DeclareAccess.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/new/DeclareAccess.java')
-rw-r--r--tests/new/DeclareAccess.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/new/DeclareAccess.java b/tests/new/DeclareAccess.java
new file mode 100644
index 000000000..a57363d52
--- /dev/null
+++ b/tests/new/DeclareAccess.java
@@ -0,0 +1,37 @@
+import org.aspectj.testing.*;
+
+public class DeclareAccess {
+ public static void main (String[] args) {
+ Tester.event("main");
+ Target t = new Target();
+ Aspect a = Aspect.aspectOf();
+ a.tryPI(t);
+ Tester.checkAllEvents();
+ }
+
+ static {
+ Tester.expectEvent("run");
+ Tester.expectEvent("main");
+ Tester.expectEvent("value");
+ }
+}
+
+class Target {
+ public String value() {
+ Tester.event("run");
+ return "value";
+ }
+}
+
+/** @testcase private inner interface accessible in scope when declared on outer class */
+aspect Aspect {
+ private interface PI {
+ public String value();
+ }
+ public void tryPI(Target t) {
+ PI pi = (PI) t;
+ Tester.event(pi.value());
+ }
+ /** @testcase private interface declared on Target */
+ declare parents: Target implements PI;
+}