]> source.dussan.org Git - aspectj.git/commitdiff
198181 - testcode
authoraclement <aclement>
Thu, 17 Jul 2008 17:37:33 +0000 (17:37 +0000)
committeraclement <aclement>
Thu, 17 Jul 2008 17:37:33 +0000 (17:37 +0000)
tests/bugs162/pr198181/A.java [new file with mode: 0644]
tests/bugs162/pr198181/M.java [new file with mode: 0644]
tests/bugs162/pr198181/aop.xml [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java
tests/src/org/aspectj/systemtest/ajc162/ajc162.xml

diff --git a/tests/bugs162/pr198181/A.java b/tests/bugs162/pr198181/A.java
new file mode 100644 (file)
index 0000000..7168ccf
--- /dev/null
@@ -0,0 +1,14 @@
+package m;
+
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+
+@Aspect("pertarget(execution( public void m.M.run() ))")
+public class A {
+        int i;
+        @Around("execution( public void m.M.run() )")
+        public void count() {
+//                     System.out.println(this);
+                System.out.println("tick " + (i++));
+        }
+}
diff --git a/tests/bugs162/pr198181/M.java b/tests/bugs162/pr198181/M.java
new file mode 100644 (file)
index 0000000..ce7aff9
--- /dev/null
@@ -0,0 +1,10 @@
+package m;
+public class M {
+        public void run() {
+        }
+        public static void main(String[] args) {
+                for (int i = 0; i < 3; i++) {
+                        new M().run();
+                }
+        }
+}
diff --git a/tests/bugs162/pr198181/aop.xml b/tests/bugs162/pr198181/aop.xml
new file mode 100644 (file)
index 0000000..90fcc9a
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<aspectj>
+    <aspects>
+        <aspect name="m.A"/>
+    </aspects>
+    <weaver options="-verbose -showWeaveInfo"/>
+</aspectj>
\ No newline at end of file
index 39563df219491da025d8ecaba5a04d3ad8fcb52f..92a8f0cb02ba6a282c06ffe074fbb3922a1b2e3e 100644 (file)
@@ -20,6 +20,7 @@ public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        
        // AspectJ1.6.2 
        public void testAnnotationDecp_pr239441() { runTest("annotation decp"); }
+       public void testAtAspectJPerTarget_pr198181() { runTest("ataspectj ltw pertarget"); }
 //     public void testAnnotationValueDecp_pr238992() { runTest("annotation value decp"); }
 //     public void testAnnotationValueDecp_pr238992_2() { runTest("annotation value decp - 2"); }
 //     public void testAnnotationValueDecp_pr238992_3() { runTest("annotation value decp - 3"); }
index e302c79e1724d0b34f411cdd95676a01d1b37b25..bdc633a97aaec7290c1f6a505273c829fa8664fd 100644 (file)
         <run class="ArgsBinding"/>
     </ajc-test>    
     
+    <ajc-test dir="bugs162/pr198181" title="ataspectj ltw pertarget">
+      <compile files="M.java" outjar="code.jar"/>
+      <compile files="A.java" classpath="code.jar" options="-1.5 -Xlint:ignore"/>
+      <run class="m.M" classpath="$sandbox/code.jar" ltw="aop.xml">
+        <stdout>
+          <line text="tick 0"/>
+          <line text="tick 0"/>
+          <line text="tick 0"/>
+        </stdout>
+      </run>
+    </ajc-test>
 
 </suite>
\ No newline at end of file