diff options
Diffstat (limited to 'tests/bugs/cflowAndJar')
-rw-r--r-- | tests/bugs/cflowAndJar/AbstractAspect.aj | 9 | ||||
-rw-r--r-- | tests/bugs/cflowAndJar/Test.java | 11 | ||||
-rw-r--r-- | tests/bugs/cflowAndJar/TestAspect.aj | 11 | ||||
-rw-r--r-- | tests/bugs/cflowAndJar/lib.jar | bin | 662 -> 662 bytes |
4 files changed, 27 insertions, 4 deletions
diff --git a/tests/bugs/cflowAndJar/AbstractAspect.aj b/tests/bugs/cflowAndJar/AbstractAspect.aj index 529cc08b6..24e786213 100644 --- a/tests/bugs/cflowAndJar/AbstractAspect.aj +++ b/tests/bugs/cflowAndJar/AbstractAspect.aj @@ -1,6 +1,13 @@ public abstract aspect AbstractAspect{
public abstract pointcut directCall();
+
before(): directCall(){
- System.out.println("direct");
+ noteDirectCall();
}
+
+ abstract void noteDirectCall();
+
+ public abstract pointcut badCall();
+
+ declare warning: badCall(): "bad";
}
diff --git a/tests/bugs/cflowAndJar/Test.java b/tests/bugs/cflowAndJar/Test.java index 079ac6b22..9349ca4b0 100644 --- a/tests/bugs/cflowAndJar/Test.java +++ b/tests/bugs/cflowAndJar/Test.java @@ -1,8 +1,15 @@ -public class Test{ +import org.aspectj.testing.Tester; + +public class Test { public static void main(String[] arguments){ Test test = new Test(); - test.sayHello(); + Tester.checkEqual(TestAspect.sawDirectCall, false, "no calls"); + test.doSayHello(); + Tester.checkEqual(TestAspect.sawDirectCall, false, "non-cflow"); + + test.sayHello(); + Tester.checkEqual(TestAspect.sawDirectCall, true, "in-cflow"); } public void sayHello(){ diff --git a/tests/bugs/cflowAndJar/TestAspect.aj b/tests/bugs/cflowAndJar/TestAspect.aj index a6ed50ae6..78c93e86a 100644 --- a/tests/bugs/cflowAndJar/TestAspect.aj +++ b/tests/bugs/cflowAndJar/TestAspect.aj @@ -1,6 +1,15 @@ public aspect TestAspect extends AbstractAspect{
public pointcut directCall():
execution(void Test.doSayHello(..))
- && cflow(execution(void Test.direct(..)))
+ && cflow(execution(void Test.sayHello(..)))
;
+
+ public pointcut badCall():
+ call(void Test.doSayHello(..)) && withincode(void Test.sayHello(..));
+
+ void noteDirectCall() {
+ sawDirectCall = true;
+ }
+
+ public static boolean sawDirectCall = false;
}
diff --git a/tests/bugs/cflowAndJar/lib.jar b/tests/bugs/cflowAndJar/lib.jar Binary files differindex e80bb93b8..46368f2d2 100644 --- a/tests/bugs/cflowAndJar/lib.jar +++ b/tests/bugs/cflowAndJar/lib.jar |