summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2007-12-04 09:39:38 +0000
committeraclement <aclement>2007-12-04 09:39:38 +0000
commit4e7583aac32c77523a357f9606be6fd29ec62a6f (patch)
tree62f965e2437950f782cc066b03cef135b7431496
parentd48385b2d02a73e4e68cb3e1a808e383a784d057 (diff)
downloadaspectj-4e7583aac32c77523a357f9606be6fd29ec62a6f.tar.gz
aspectj-4e7583aac32c77523a357f9606be6fd29ec62a6f.zip
166647 testcode: commented out in ajc154 - poor solution
-rw-r--r--tests/bugs154/pr166647/Aspect.java10
-rw-r--r--tests/bugs154/pr166647/ClassToAdvise.java11
-rw-r--r--tests/bugs154/pr166647/ClassWithMain.java8
-rw-r--r--tests/bugs154/pr166647/aop1.xml11
-rw-r--r--tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java5
-rw-r--r--tests/src/org/aspectj/systemtest/ajc154/ajc154.xml13
6 files changed, 57 insertions, 1 deletions
diff --git a/tests/bugs154/pr166647/Aspect.java b/tests/bugs154/pr166647/Aspect.java
new file mode 100644
index 000000000..1226637eb
--- /dev/null
+++ b/tests/bugs154/pr166647/Aspect.java
@@ -0,0 +1,10 @@
+package x;
+
+abstract aspect Aspect {
+
+ abstract pointcut scope();
+
+ before(): call(* foo(..)) && cflow(execution(* toplevel(..))) && scope() {
+ System.out.println("advice fired");
+ }
+} \ No newline at end of file
diff --git a/tests/bugs154/pr166647/ClassToAdvise.java b/tests/bugs154/pr166647/ClassToAdvise.java
new file mode 100644
index 000000000..863025c7d
--- /dev/null
+++ b/tests/bugs154/pr166647/ClassToAdvise.java
@@ -0,0 +1,11 @@
+package a;
+
+public class ClassToAdvise {
+
+ public void toplevel() {
+ foo();
+ }
+
+ public void foo() {}
+
+} \ No newline at end of file
diff --git a/tests/bugs154/pr166647/ClassWithMain.java b/tests/bugs154/pr166647/ClassWithMain.java
new file mode 100644
index 000000000..e2d30d25c
--- /dev/null
+++ b/tests/bugs154/pr166647/ClassWithMain.java
@@ -0,0 +1,8 @@
+package a;
+
+public class ClassWithMain {
+ public static void main(String []argv) {
+ new ClassToAdvise().toplevel();
+ new ClassToAdvise().foo();
+ }
+} \ No newline at end of file
diff --git a/tests/bugs154/pr166647/aop1.xml b/tests/bugs154/pr166647/aop1.xml
new file mode 100644
index 000000000..d4b88e7ef
--- /dev/null
+++ b/tests/bugs154/pr166647/aop1.xml
@@ -0,0 +1,11 @@
+<aspectj>
+ <aspects>
+ <concrete-aspect name="x.Aspect2" extends="x.Aspect">
+ <pointcut name="scope" expression="within(*)"/>
+ </concrete-aspect>
+ </aspects>
+ <!-- weaver options="-verbose -showWeaveInfo -debug"-->
+ <weaver>
+ <include within="a..*"/>
+ </weaver>
+</aspectj> \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java b/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java
index 667b6e7da..f381cda80 100644
--- a/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java
@@ -44,7 +44,10 @@ public class Ajc154Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
//public void testAfterThrowingAnnotationStyle_pr211674_1() { runTest("after throwing annotation style problem - 1");}
//public void testAfterThrowingAnnotationStyle_pr211674_2() { runTest("after throwing annotation style problem - 2");}
- // Testing some issues with declare at type
+ // crappy solution - see the bug
+// public void testCflowLtwProblem_pr166647_1() { runTest("ltw and cflow problem"); }
+
+ // Testing some issues with declare at type
public void testDeclareAtTypeProblems_pr211052_1() { runTest("declare atType problems - 1"); }
public void testDeclareAtTypeProblems_pr211052_2() { runTest("declare atType problems - 2"); }
public void testDeclareAtTypeProblems_pr211052_3() { runTest("declare atType problems - 3"); }
diff --git a/tests/src/org/aspectj/systemtest/ajc154/ajc154.xml b/tests/src/org/aspectj/systemtest/ajc154/ajc154.xml
index 691f5ce8d..c15c78567 100644
--- a/tests/src/org/aspectj/systemtest/ajc154/ajc154.xml
+++ b/tests/src/org/aspectj/systemtest/ajc154/ajc154.xml
@@ -2,6 +2,19 @@
<!-- AspectJ v1.6.0 Tests -->
<suite>
+
+ <ajc-test dir="bugs154/pr166647" title="ltw and cflow problem">
+ <compile options="-1.5" files="ClassToAdvise.java,ClassWithMain.java" outjar="code.jar"/>
+ <compile options="-1.5 -Xlint:ignore" files="Aspect.java" outjar="aspects.jar"/>
+ <run class="a.ClassWithMain" classpath="aspects.jar;code.jar" ltw="aop1.xml">
+ <stdout>
+ <line text="advice fired"/>
+ </stdout>
+ <stderr>
+ </stderr>
+ </run>
+ </ajc-test>
+
<ajc-test dir="bugs154/pr211052" title="declare atType problems - 1">
<compile options="-1.5" files="MyPojo.java"/>
<run class="MyPojo"/>