]> source.dussan.org Git - aspectj.git/commitdiff
166647 testcode: commented out in ajc154 - poor solution
authoraclement <aclement>
Tue, 4 Dec 2007 09:39:38 +0000 (09:39 +0000)
committeraclement <aclement>
Tue, 4 Dec 2007 09:39:38 +0000 (09:39 +0000)
tests/bugs154/pr166647/Aspect.java [new file with mode: 0644]
tests/bugs154/pr166647/ClassToAdvise.java [new file with mode: 0644]
tests/bugs154/pr166647/ClassWithMain.java [new file with mode: 0644]
tests/bugs154/pr166647/aop1.xml [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java
tests/src/org/aspectj/systemtest/ajc154/ajc154.xml

diff --git a/tests/bugs154/pr166647/Aspect.java b/tests/bugs154/pr166647/Aspect.java
new file mode 100644 (file)
index 0000000..1226637
--- /dev/null
@@ -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 (file)
index 0000000..863025c
--- /dev/null
@@ -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 (file)
index 0000000..e2d30d2
--- /dev/null
@@ -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 (file)
index 0000000..d4b88e7
--- /dev/null
@@ -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
index 667b6e7dae5c3f59d4bbe60944982ae331a64d7f..f381cda80f1f634766f5c8cccaa1c4a7c1a7aace 100644 (file)
@@ -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"); }
index 691f5ce8dfcb0ee7e448125596beb36a570643b2..c15c7856715a14afb2b9eed884e11f3641e35942 100644 (file)
@@ -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"/>