]> source.dussan.org Git - aspectj.git/commitdiff
239441 - testcode and fix
authoraclement <aclement>
Thu, 17 Jul 2008 17:09:54 +0000 (17:09 +0000)
committeraclement <aclement>
Thu, 17 Jul 2008 17:09:54 +0000 (17:09 +0000)
tests/bugs162/pr233718/ArgsBinding.java [new file with mode: 0644]
tests/bugs162/pr233718/ArgsMatching.java [new file with mode: 0644]
tests/bugs162/pr233718/Matching.java [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/pr233718/ArgsBinding.java b/tests/bugs162/pr233718/ArgsBinding.java
new file mode 100644 (file)
index 0000000..97550ec
--- /dev/null
@@ -0,0 +1,9 @@
+public aspect ArgsBinding {
+//  public void m() {}
+//  public void m(String a) {}
+  public void m(String a,String b) {}
+//  public void m(int a,String b) {}
+
+
+  before(String[] p): execution(* m(..)) && args(..,p,..) {}
+}
diff --git a/tests/bugs162/pr233718/ArgsMatching.java b/tests/bugs162/pr233718/ArgsMatching.java
new file mode 100644 (file)
index 0000000..b7f2950
--- /dev/null
@@ -0,0 +1,9 @@
+public aspect ArgsMatching {
+//  public void m() {}
+//  public void m(String a) {}
+  public void m(String a,String b) {}
+//  public void m(int a,String b) {}
+
+
+  before(): execution(* m(..)) && args(..,String,..) {}
+}
diff --git a/tests/bugs162/pr233718/Matching.java b/tests/bugs162/pr233718/Matching.java
new file mode 100644 (file)
index 0000000..9fa60ab
--- /dev/null
@@ -0,0 +1,9 @@
+public aspect Matching {
+  public void m() {}
+  public void m(String a) {}
+  public void m(String a,String b) {}
+  public void m(int a,String b) {}
+
+
+  before(): execution(* m(..,String,..)) {}
+}
index 2cb1d38264a319df79f055fa77c9e4dd3910b7ab..39563df219491da025d8ecaba5a04d3ad8fcb52f 100644 (file)
@@ -19,12 +19,23 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        
        // AspectJ1.6.2 
-//     public void testAnnotationDecp_pr239441() { runTest("annotation decp"); }
-       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"); }
-       public void testAnnotationValueDecp_pr238992_4() { runTest("annotation value decp - 4"); }
+       public void testAnnotationDecp_pr239441() { runTest("annotation decp"); }
+//     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"); }
+//     public void testAnnotationValueDecp_pr238992_4() { runTest("annotation value decp - 4"); }
        
+       /*
+        * test plan
+        * execution(* *(..,String,..))
+        * args(..,String,..)
+        * @args(..,Foo,..)
+        * 
+        */
+//     public void testParameterSubsettingMatching_pr233718_Matching() { runTest("parameter subsetting - matching");}
+//     public void testParameterSubsettingMatching_pr233718_ArgsMatching() { runTest("parameter subsetting - args matching");}
+//     public void testParameterSubsettingMatching_pr233718_ArgsBinding() { runTest("parameter subsetting - args binding");}
+
        public static Test suite() {
       return XMLBasedAjcTestCase.loadSuite(Ajc162Tests.class);
     }
index 5b2b599bab5b353500fcbab60572b51c88a5bdba..e302c79e1724d0b34f411cdd95676a01d1b37b25 100644 (file)
        </compile>
        <run class="Foo4"/>
     </ajc-test>    
+    
+    <ajc-test dir="bugs162/pr233718" title="parameter subsetting - matching">
+        <compile files="Matching.java" options="-1.5 -showWeaveInfo">
+          <message kind="weave" text="Join point 'method-execution(void Matching.m(java.lang.String))' in Type 'Matching' (Matching.java:3) advised by before advice from 'Matching' (Matching.java:8)"/>
+          <message kind="weave" text="'method-execution(void Matching.m(java.lang.String, java.lang.String))' in Type 'Matching' (Matching.java:4) advised by before advice from 'Matching' (Matching.java:8)"/>
+          <message kind="weave" text="'method-execution(void Matching.m(int, java.lang.String))' in Type 'Matching' (Matching.java:5) advised by before advice from 'Matching' (Matching.java:8)"/>        
+        </compile>
+    </ajc-test>    
+
+    <ajc-test dir="bugs162/pr233718" title="parameter subsetting - args matching">
+        <compile files="ArgsMatching.java" options="-1.5 -showWeaveInfo">
+ <!--
+          <message kind="weave" text="Join point 'method-execution(void Matching.m(java.lang.String))' in Type 'Matching' (Matching.java:3) advised by before advice from 'Matching' (Matching.java:8)"/>
+          <message kind="weave" text="'method-execution(void Matching.m(java.lang.String, java.lang.String))' in Type 'Matching' (Matching.java:4) advised by before advice from 'Matching' (Matching.java:8)"/>
+          <message kind="weave" text="'method-execution(void Matching.m(int, java.lang.String))' in Type 'Matching' (Matching.java:5) advised by before advice from 'Matching' (Matching.java:8)"/>        
+ -->
+        </compile>
+    </ajc-test>    
+    
+    <ajc-test dir="bugs162/pr233718" title="parameter subsetting - args binding">
+        <compile files="ArgsBinding.java" options="-1.5"/>
+        <run class="ArgsBinding"/>
+    </ajc-test>    
+    
 
 </suite>
\ No newline at end of file