aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core/testdata
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-03-11 19:06:21 +0000
committerjhugunin <jhugunin>2003-03-11 19:06:21 +0000
commitbb66774ab4a5afb36d36bc8274ff265f10d666db (patch)
tree74791661e026330bd526f31b5e1a33b8565309dc /org.aspectj.ajdt.core/testdata
parentae0ef30e2a9c8a4ef7ff59219b15b5109c956d22 (diff)
downloadaspectj-bb66774ab4a5afb36d36bc8274ff265f10d666db.tar.gz
aspectj-bb66774ab4a5afb36d36bc8274ff265f10d666db.zip
further work on binary aspects (aspect path) tested and implemented correct behavior
for obvious forms of abstract aspects now
Diffstat (limited to 'org.aspectj.ajdt.core/testdata')
-rw-r--r--org.aspectj.ajdt.core/testdata/src1/binary/client/Client.java1
-rw-r--r--org.aspectj.ajdt.core/testdata/src1/binary/client/Client1.java32
-rw-r--r--org.aspectj.ajdt.core/testdata/src1/binary/client/MyAspect.aj6
-rw-r--r--org.aspectj.ajdt.core/testdata/src1/binary/client/MyAspect1.aj6
-rw-r--r--org.aspectj.ajdt.core/testdata/src1/binary/lib/AbstractA.aj21
-rw-r--r--org.aspectj.ajdt.core/testdata/src1/binary/lib/ConcreteA.aj4
6 files changed, 69 insertions, 1 deletions
diff --git a/org.aspectj.ajdt.core/testdata/src1/binary/client/Client.java b/org.aspectj.ajdt.core/testdata/src1/binary/client/Client.java
index 181b78628..5a495ed8e 100644
--- a/org.aspectj.ajdt.core/testdata/src1/binary/client/Client.java
+++ b/org.aspectj.ajdt.core/testdata/src1/binary/client/Client.java
@@ -9,6 +9,7 @@ public class Client {
System.out.println(c.value);
ConcreteA.Marker m = c;
System.out.println(m.value);
+ System.out.println(ConcreteA.getPrivateValue(c));
try {
new Client();
} catch (SoftException se) {
diff --git a/org.aspectj.ajdt.core/testdata/src1/binary/client/Client1.java b/org.aspectj.ajdt.core/testdata/src1/binary/client/Client1.java
new file mode 100644
index 000000000..426c3cd2b
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/src1/binary/client/Client1.java
@@ -0,0 +1,32 @@
+package client;
+
+import lib.AbstractA;
+import org.aspectj.lang.*;
+
+public class Client1 {
+ public static void main(String[] args) {
+ C1 c = new C1();
+ System.out.println(c.value);
+ AbstractA.Marker m = c;
+ System.out.println(m.value);
+ System.out.println(AbstractA.getPrivateValue(c));
+
+ FooMarkMe f = new FooMarkMe();
+ System.out.println(f.value);
+
+ m = f;
+ }
+
+}
+
+class C1 implements AbstractA.Marker {
+ public void m() {
+ System.out.println("hello");
+ }
+}
+
+class FooMarkMe {
+ public void m() {
+ System.out.println("hello");
+ }
+}
diff --git a/org.aspectj.ajdt.core/testdata/src1/binary/client/MyAspect.aj b/org.aspectj.ajdt.core/testdata/src1/binary/client/MyAspect.aj
new file mode 100644
index 000000000..317ecc973
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/src1/binary/client/MyAspect.aj
@@ -0,0 +1,6 @@
+package client;
+import lib.AbstractA;
+
+aspect MyAspect extends AbstractA {
+ protected pointcut scope();
+} \ No newline at end of file
diff --git a/org.aspectj.ajdt.core/testdata/src1/binary/client/MyAspect1.aj b/org.aspectj.ajdt.core/testdata/src1/binary/client/MyAspect1.aj
new file mode 100644
index 000000000..bec3ad781
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/src1/binary/client/MyAspect1.aj
@@ -0,0 +1,6 @@
+package client;
+import lib.AbstractA;
+
+aspect MyAspect1 extends AbstractA {
+ protected pointcut scope(): within(client.*);
+} \ No newline at end of file
diff --git a/org.aspectj.ajdt.core/testdata/src1/binary/lib/AbstractA.aj b/org.aspectj.ajdt.core/testdata/src1/binary/lib/AbstractA.aj
new file mode 100644
index 000000000..a8a69ab55
--- /dev/null
+++ b/org.aspectj.ajdt.core/testdata/src1/binary/lib/AbstractA.aj
@@ -0,0 +1,21 @@
+package lib;
+
+public abstract aspect AbstractA {
+ public interface Marker {}
+
+ public String Marker.value = "public";
+ private String Marker.pValue = "private";
+
+ public static String getPrivateValue(Marker m) { return m.pValue; }
+
+ protected abstract pointcut scope();
+
+ declare error: scope() && within(Marker+) && call(* java.io.PrintStream.println(*)):
+ "use a proper logger";
+
+ before(Marker m): this(m) && execution(new(..)) {
+ System.err.println("making a Marker: " + m + " with " + m.pValue);
+ }
+
+ declare parents: *..*MarkMe implements Marker;
+} \ No newline at end of file
diff --git a/org.aspectj.ajdt.core/testdata/src1/binary/lib/ConcreteA.aj b/org.aspectj.ajdt.core/testdata/src1/binary/lib/ConcreteA.aj
index 02a09c87d..15a3d5cc6 100644
--- a/org.aspectj.ajdt.core/testdata/src1/binary/lib/ConcreteA.aj
+++ b/org.aspectj.ajdt.core/testdata/src1/binary/lib/ConcreteA.aj
@@ -4,7 +4,9 @@ public aspect ConcreteA {
public interface Marker {}
public String Marker.value = "public";
- //private String Marker.pValue = "private";
+ private String Marker.pValue = "private";
+
+ public static String getPrivateValue(Marker m) { return m.pValue; }
public static class MyException extends Exception {}