]> source.dussan.org Git - aspectj.git/commitdiff
test for pr93356 and generic binary weaving itds
authoraclement <aclement>
Thu, 18 Aug 2005 07:52:18 +0000 (07:52 +0000)
committeraclement <aclement>
Thu, 18 Aug 2005 07:52:18 +0000 (07:52 +0000)
tests/java5/varargs/pr93356.aj [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml

diff --git a/tests/java5/varargs/pr93356.aj b/tests/java5/varargs/pr93356.aj
new file mode 100644 (file)
index 0000000..00a2fdb
--- /dev/null
@@ -0,0 +1,36 @@
+// "Varargs with .. in pointcut"
+
+class A{
+       public A(int i, int... nums) {}
+       public void b(int i, int... nums) {}
+}
+aspect B{
+       ///////// methods       
+       declare warning: execution(* *.*(..)) : "a";
+       declare warning: execution(* *.*(int,..)) : "b";
+       declare warning: execution(* *.*(..,int...)) : "c";
+       declare warning: execution(* *.*(int,..,int...)) : "d";
+       declare warning: execution(* *.*(int,int ...,..)) : "e";
+       
+       declare warning: execution(* *.*(..,int,..,int ...,..)) : "k";
+       declare warning: execution(* *.*(..,..,*...,..,..)) : "l";
+       
+       
+       declare warning: execution(* *.*(int,int [],..)) : "shouldn't match A";
+       declare warning: execution(* *.*(int,int [])) : "shouldn't match B";
+       
+       //////////////////// constructors
+       declare warning: execution(*.new(..)) : "f"; // matches  constructors for A and B
+       declare warning: execution(*.new(int,..)) : "g";
+       declare warning: execution(*.new(..,int...)) : "h";
+       declare warning: execution(*.new(int,..,int...)) : "i";
+       declare warning: execution(*.new(int,int ...,..)) : "j";
+       
+       declare warning: execution(*.new(int,int [],..)) : "shouldn't match C";
+       declare warning: execution(*.new(int,int [])) : "shouldn't match D";
+}
+
+
+
+
+
index 9d112b4a2892fa87d4aa2c5a85fac2f97b226795..7876299cfa1a7f3982eeb56b7ffb3eb79408e02d 100644 (file)
             <message kind="warning" line="9" text="should match"/>        
         </compile>
     </ajc-test>
+    
+    <ajc-test dir="java5/varargs" title="Varargs with .. in pointcut" vm="1.5">
+        <compile files="pr93356.aj" options="-1.5">  
+               <message kind="warning" line="5" text="a"/>
+               <message kind="warning" line="5" text="b"/>    
+               <message kind="warning" line="5" text="c"/>    
+               <message kind="warning" line="5" text="d"/>    
+               <message kind="warning" line="5" text="e"/>  
+               <message kind="warning" line="5" text="k"/> 
+               <message kind="warning" line="5" text="l"/>
+               
+               <message kind="warning" line="4" text="f"/>
+               <message kind="warning" line="4" text="g"/>    
+               <message kind="warning" line="4" text="h"/>    
+               <message kind="warning" line="4" text="i"/>    
+               <message kind="warning" line="4" text="j"/>  
+               
+               <message kind="warning" line="7" text="f"/>      
+        </compile>
+    </ajc-test>
 
     <ajc-test dir="java5/varargs" title="star varargs pattern" vm="1.5">
         <compile files="StarVarargsPattern.aj" options="-1.5">
 
    <!-- end of generic decps -->
    
+   <!-- generics/itds and binary weaving -->
+   
+   <ajc-test dir="java5/generics/itds/binaryweaving" vm="1.5" title="binary weaving ITDs - 1">
+          <compile files="BaseClass.java" outjar="code.jar" options="-1.5,-Xreweavable"/>
+       <compile files="A1.aj" inpath="code.jar" options="-1.5,-Xreweavable"/>
+        <run class="BaseClass">
+        <stderr>
+             <line text="Advice from A1 ran successfully"/>
+        </stderr>
+        </run>
+    </ajc-test>
+   
+   <ajc-test dir="java5/generics/itds/binaryweaving" vm="1.5" title="binary weaving ITDs - 2">
+          <compile files="BaseClass.java,A1.aj" outjar="code.jar" options="-1.5,-Xreweavable"/>
+       <compile files="A2.aj" inpath="code.jar" options="-1.5,-Xreweavable"/>
+        <run class="BaseClass">
+        <stderr>
+             <line text="Advice from A1 ran successfully"/>
+             <line text="Advice from A2 ran successfully"/>
+        </stderr>
+        </run>
+    </ajc-test>
+
+   <ajc-test dir="java5/generics/itds/binaryweaving" vm="1.5" title="binary weaving ITDs - 3">
+          <compile files="BaseClass.java,A1.aj,A2.aj" outjar="code.jar" options="-1.5,-Xreweavable"/>
+       <compile files="A3.aj" inpath="code.jar" options="-1.5,-Xreweavable"/>
+        <run class="BaseClass">
+        <stderr>
+             <line text="Advice from A1 ran successfully"/>
+             <line text="Advice from A2 ran successfully"/>
+             <line text="Advice from A3 ran successfully"/>
+        </stderr>
+        </run>
+    </ajc-test>
+
+   <!-- end of generics/itds and binary weaving -->
+   
    <!-- generics and  pointcuts -->
 
    <ajc-test dir="java5/generics/pointcuts" title="handler pcd and generics / type vars">