summaryrefslogtreecommitdiffstats
path: root/tests/new/subaspects/parent
diff options
context:
space:
mode:
authorwisberg <wisberg>2002-12-16 18:51:06 +0000
committerwisberg <wisberg>2002-12-16 18:51:06 +0000
commit144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch)
treeb12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/new/subaspects/parent
parentfafae443719b26159ab2d7dac1c9b46b5e00b671 (diff)
downloadaspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz
aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip
initial version
Diffstat (limited to 'tests/new/subaspects/parent')
-rw-r--r--tests/new/subaspects/parent/ForeignChildHelper.java16
-rw-r--r--tests/new/subaspects/parent/ParentCE.java15
-rw-r--r--tests/new/subaspects/parent/ParentMethodCE.java10
-rw-r--r--tests/new/subaspects/parent/PrivatePointcut.java26
-rw-r--r--tests/new/subaspects/parent/PrivatePointcutOuterClass.java26
-rw-r--r--tests/new/subaspects/parent/SubAspectVisibility.java95
6 files changed, 188 insertions, 0 deletions
diff --git a/tests/new/subaspects/parent/ForeignChildHelper.java b/tests/new/subaspects/parent/ForeignChildHelper.java
new file mode 100644
index 000000000..31b929eb1
--- /dev/null
+++ b/tests/new/subaspects/parent/ForeignChildHelper.java
@@ -0,0 +1,16 @@
+
+package parent;
+
+import child.ForeignChildAspect;
+import parent.SubAspectVisibility;
+
+import org.aspectj.testing.*;
+
+/** @testcase PR#647 inner, outer, and outside-package subaspects of an aspect with abstract protected-, public-, and default-access pointcuts */
+public abstract aspect ForeignChildHelper extends SubAspectVisibility {
+ /** @testCase override package-private pointcut in outer class */
+ pointcut definePackagePrivate() : execution(void ForeignChildAspect.main(..));
+ before() : definePackagePrivate() {
+ Tester.event("ForeignChildHelper.definePackagePrivate");
+ }
+}
diff --git a/tests/new/subaspects/parent/ParentCE.java b/tests/new/subaspects/parent/ParentCE.java
new file mode 100644
index 000000000..a28dd83d7
--- /dev/null
+++ b/tests/new/subaspects/parent/ParentCE.java
@@ -0,0 +1,15 @@
+
+package parent;
+
+import org.aspectj.testing.*;
+
+/** @testcase PR#647 concrete aspect unable to access abstract package-private pointcut in parent for overriding */
+public abstract aspect ParentCE {
+ abstract pointcut define();
+ before() : define() {
+ Tester.event("define");
+ }
+}
+aspect Child extends ParentCE {
+ pointcut define() : call(public void Target.run());
+}
diff --git a/tests/new/subaspects/parent/ParentMethodCE.java b/tests/new/subaspects/parent/ParentMethodCE.java
new file mode 100644
index 000000000..0f25fe2d5
--- /dev/null
+++ b/tests/new/subaspects/parent/ParentMethodCE.java
@@ -0,0 +1,10 @@
+
+package parent;
+
+import org.aspectj.testing.*;
+
+/** @testcase PR#647 concrete aspect unable to access abstract package-private method in parent for overriding */
+public abstract class ParentMethodCE {
+ /** cannot be implemented outside this class */
+ abstract void defineMethod();
+}
diff --git a/tests/new/subaspects/parent/PrivatePointcut.java b/tests/new/subaspects/parent/PrivatePointcut.java
new file mode 100644
index 000000000..1c09fb040
--- /dev/null
+++ b/tests/new/subaspects/parent/PrivatePointcut.java
@@ -0,0 +1,26 @@
+
+package parent;
+
+import org.aspectj.testing.*;
+
+/** @testcase PR#647 inner subaspects of an aspect with private pointcut */
+public abstract aspect PrivatePointcut {
+ public static void main (String[] args) {
+ Tester.event("main");
+ Tester.checkAllEvents();
+ }
+ static {
+ Tester.expectEvent("main");
+ Tester.expectEvent("definePrivate");
+ }
+
+ before() : definePrivate() {
+ Tester.event("definePrivate");
+ }
+
+ /** private must be implemented in defining class */
+ private pointcut definePrivate() : execution(void PrivatePointcut.main(..));
+}
+aspect InnerChild extends PrivatePointcut {
+}
+
diff --git a/tests/new/subaspects/parent/PrivatePointcutOuterClass.java b/tests/new/subaspects/parent/PrivatePointcutOuterClass.java
new file mode 100644
index 000000000..7ae3752c0
--- /dev/null
+++ b/tests/new/subaspects/parent/PrivatePointcutOuterClass.java
@@ -0,0 +1,26 @@
+
+package parent;
+
+import org.aspectj.testing.*;
+
+/** PR#647 outer subaspects of an aspect with private pointcut */
+public abstract aspect PrivatePointcutOuterClass {
+ public static void main (String[] args) {
+ Tester.event("main");
+ Tester.checkAllEvents();
+ }
+ static {
+ Tester.expectEvent("main");
+ Tester.expectEvent("definePrivate");
+ }
+
+ before() : definePrivate() {
+ Tester.event("definePrivate");
+ }
+
+ /** private must be implemented in defining class */
+ private pointcut definePrivate()
+ : execution(void PrivatePointcutOuterClass.main(..));
+}
+aspect InnerChild extends PrivatePointcutOuterClass { }
+
diff --git a/tests/new/subaspects/parent/SubAspectVisibility.java b/tests/new/subaspects/parent/SubAspectVisibility.java
new file mode 100644
index 000000000..e7af8c345
--- /dev/null
+++ b/tests/new/subaspects/parent/SubAspectVisibility.java
@@ -0,0 +1,95 @@
+
+package parent;
+
+import child.ForeignChildAspect;
+
+import org.aspectj.testing.*;
+
+/** @testcase PR#647 inner, outer, and outside-package subaspects of an aspect with abstract protected-, public-, and default-access pointcuts */
+public abstract aspect SubAspectVisibility {
+ public static void main (String[] args) {
+ Tester.event("main");
+ OuterChild.main(args);
+ ForeignChildAspect.main(args);
+ Tester.checkAllEventsIgnoreDups();
+ }
+ static {
+ Tester.expectEvent("main");
+ Tester.expectEvent("definePrivate");
+ Tester.expectEvent("definePackagePrivate");
+ Tester.expectEvent("defineProtected");
+ Tester.expectEvent("definePublic");
+
+ Tester.expectEvent("Outer.main");
+ Tester.expectEvent("Outer.definePackagePrivate");
+ Tester.expectEvent("Outer.defineProtected");
+ Tester.expectEvent("Outer.definePublic");
+
+ Tester.expectEvent("ForeignChildAspect.main");
+ Tester.expectEvent("ForeignChildHelper.definePackagePrivate");
+ Tester.expectEvent("ForeignChildAspect.defineProtected");
+ Tester.expectEvent("ForeignChildAspect.definePublic");
+ }
+
+ before() : definePrivate() {
+ Tester.event("definePrivate");
+ }
+
+ before() : definePackagePrivate() {
+ Tester.event("definePackagePrivate");
+ }
+
+ before() : defineProtected() {
+ Tester.event("defineProtected");
+ }
+
+ before() : definePublic() {
+ Tester.event("definePublic");
+ }
+
+ /** public can be implemented in outer or inner child class */
+ abstract public pointcut definePublic();
+
+ /** protected can be can be implemented in outer or inner child class */
+ abstract protected pointcut defineProtected();
+
+ /** package-private can be can be implemented in outer or inner child class */
+ abstract pointcut definePackagePrivate();
+
+ /** private must be implemented in defining class */
+ private pointcut definePrivate() : execution(void SubAspectVisibility.main(..));
+
+ // bug? says definePrivate() is not defined in InnerChild
+ static aspect InnerChild extends SubAspectVisibility {
+ /** @testCase override protected pointcut in inner class */
+ protected pointcut defineProtected() : execution(void SubAspectVisibility.main(..));
+ /** @testCase override package-private pointcut in inner class */
+ pointcut definePackagePrivate() : execution(void SubAspectVisibility.main(..));
+ /** @testCase override public pointcut in inner class */
+ public pointcut definePublic() : execution(void SubAspectVisibility.main(..));
+ }
+}
+
+aspect OuterChild extends SubAspectVisibility {
+ public static void main (String[] args) {
+ Tester.event("Outer.main");
+ }
+
+ /** @testCase override package-private pointcut in outer class */
+ pointcut definePackagePrivate() : execution(void OuterChild.main(..));
+ /** @testCase override protected pointcut in outer class */
+ protected pointcut defineProtected() : execution(void OuterChild.main(..));
+ /** @testCase override public pointcut in outer class */
+ public pointcut definePublic() : execution(void OuterChild.main(..));
+
+ before() : definePackagePrivate() {
+ Tester.event("Outer.definePackagePrivate");
+ }
+ before() : defineProtected() {
+ Tester.event("Outer.defineProtected");
+ }
+ before() : definePublic() {
+ Tester.event("Outer.definePublic");
+ }
+}
+