aboutsummaryrefslogtreecommitdiffstats
path: root/tests/base/test108
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/base/test108
parentfafae443719b26159ab2d7dac1c9b46b5e00b671 (diff)
downloadaspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz
aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip
initial version
Diffstat (limited to 'tests/base/test108')
-rw-r--r--tests/base/test108/Driver.java40
-rw-r--r--tests/base/test108/Readme.txt6
2 files changed, 46 insertions, 0 deletions
diff --git a/tests/base/test108/Driver.java b/tests/base/test108/Driver.java
new file mode 100644
index 000000000..30af86fd7
--- /dev/null
+++ b/tests/base/test108/Driver.java
@@ -0,0 +1,40 @@
+
+import org.aspectj.testing.Tester;
+/**
+ * This does accessibility of class and class variables, both inherited
+ * and non-inherited, in the body of a weave.
+ */
+
+public class Driver {
+ public static void main(String[] args) { test(); }
+ public static void test() {
+ Tester.checkEqual((new Bar()).m(), 10, "Bar.m");
+ }
+}
+
+class Foo {
+ int fooVar = 1;
+ public int getFooVar( ) { return fooVar; }
+}
+
+class Bar extends Foo {
+ int barVar = 2;
+ int ans = 0;
+ public int getBarVar() { return barVar; }
+ public void setAns( int newAns ) { ans = newAns; }
+ int m() {
+ return ans;
+ }
+}
+
+abstract aspect A {
+ static int aVar = 3;
+}
+
+aspect B extends A {
+ static int bVar = 4;
+
+ before(Bar b): target(b) && call(* m(..)) {
+ b.setAns(b.getFooVar() + b.getBarVar() + aVar + bVar);
+ }
+}
diff --git a/tests/base/test108/Readme.txt b/tests/base/test108/Readme.txt
new file mode 100644
index 000000000..e0665b4bf
--- /dev/null
+++ b/tests/base/test108/Readme.txt
@@ -0,0 +1,6 @@
+Mode: vm run
+Title: Inheritance of class and aspect vars in weaves.
+
+This checks accessibility of class and aspect variables, both inherited
+and non-inherited, in the body of a weave.
+