summaryrefslogtreecommitdiffstats
path: root/ajde/testdata
diff options
context:
space:
mode:
authormkersten <mkersten>2003-08-05 16:24:05 +0000
committermkersten <mkersten>2003-08-05 16:24:05 +0000
commit5594a6579a215af6f9db9c806f4e331ec6259136 (patch)
tree83de3d2a7967780c03221f3a1d53dd68c3dc2e39 /ajde/testdata
parent6c1ca40c54c11315aa5caadf23c8f439b26c41e4 (diff)
downloadaspectj-5594a6579a215af6f9db9c806f4e331ec6259136.tar.gz
aspectj-5594a6579a215af6f9db9c806f4e331ec6259136.zip
Revised and added tests for ASM containment hierarchy.
Diffstat (limited to 'ajde/testdata')
-rw-r--r--ajde/testdata/examples/coverage/ModelCoverage.java55
-rw-r--r--ajde/testdata/examples/coverage/coverage.ajsymbin12825 -> 19080 bytes
2 files changed, 42 insertions, 13 deletions
diff --git a/ajde/testdata/examples/coverage/ModelCoverage.java b/ajde/testdata/examples/coverage/ModelCoverage.java
index 81891abed..6fa3255d6 100644
--- a/ajde/testdata/examples/coverage/ModelCoverage.java
+++ b/ajde/testdata/examples/coverage/ModelCoverage.java
@@ -15,6 +15,11 @@ class Point {
public void setX(int x) { this.x = x; }
+ public int changeX(int x) {
+ this.x = x;
+ return x;
+ }
+
void doIt() {
try {
File f = new File(".");
@@ -27,6 +32,10 @@ class Point {
}
}
+class SubPoint extends Point { }
+
+class Line { }
+
aspect AdvisesRelationCoverage {
before(): execution(*..*.new(..)) { }
before(): get(int *.*) { }
@@ -40,27 +49,47 @@ aspect AdvisesRelationCoverage {
before(): within(*) && execution(Point.new()) { }
}
+aspect AdviceNamingCoverage {
+ pointcut named(): call(* *.mumble());
+ pointcut namedWithOneArg(int i): call(int Point.changeX(int)) && args(i);
+ pointcut namedWithArgs(int i, int j): set(int Point.x) && args(i, j);
+
+ after(): named() { }
+ after(int i, int j) returning: namedWithArgs(i, j) { }
+ after() throwing: named() { }
+ after(): named() { }
+
+ before(): named() { }
+
+ int around(int i): namedWithOneArg(i) { return i;}
+ int around(int i) throws SizeException: namedWithOneArg(i) { return proceed(i); }
+
+ before(): named() { }
+
+ before(): call(* *.mumble()) { }
+
+}
+
aspect InterTypeDecCoverage {
pointcut illegalNewFigElt(): call(Point.new(..)) && !withincode(* *.doIt(..));
- declare error: illegalNewFigElt():
- "Illegal figure element constructor call.";
-
- declare warning: illegalNewFigElt():
- "Illegal figure element constructor call.";
+ declare error: illegalNewFigElt(): "Illegal constructor call.";
+ declare warning: illegalNewFigElt(): "Illegal constructor call.";
declare parents: Point extends java.io.Serializable;
-
- declare parents: Point implements java.util.Observable;
-
- //declare soft: Point: call(* *(..));
-
- public String Point.getName() { return "xxx"; }
-
- public int Point.xxx = 0;
+ declare parents: Point+ implements java.util.Observable;
+ declare parents: Point && Line implements java.util.Observable;
+ declare soft: SizeException : call(* Point.getX());
+ declare precedence: AdviceCoverage, InterTypeDecCoverage, *;
+
+ public int Point.xxx = 0;
+ public int Point.check(int i, Line l) { return 1 + i; }
+// public Line.new(String s) { }
}
+class SizeException extends Exception { }
+
aspect AdviceCoverage {
}
diff --git a/ajde/testdata/examples/coverage/coverage.ajsym b/ajde/testdata/examples/coverage/coverage.ajsym
index 775161e48..324199378 100644
--- a/ajde/testdata/examples/coverage/coverage.ajsym
+++ b/ajde/testdata/examples/coverage/coverage.ajsym
Binary files differ