]> source.dussan.org Git - aspectj.git/commitdiff
Autoboxing testdata - all primitives covered.
authoraclement <aclement>
Thu, 9 Dec 2004 18:58:06 +0000 (18:58 +0000)
committeraclement <aclement>
Thu, 9 Dec 2004 18:58:06 +0000 (18:58 +0000)
20 files changed:
tests/java5/autoboxing/AspectBoolean.aj [new file with mode: 0644]
tests/java5/autoboxing/AspectByte.aj [new file with mode: 0644]
tests/java5/autoboxing/AspectChar.aj [new file with mode: 0644]
tests/java5/autoboxing/AspectDouble.aj [new file with mode: 0644]
tests/java5/autoboxing/AspectFloat.aj [new file with mode: 0644]
tests/java5/autoboxing/AspectInteger.aj [new file with mode: 0644]
tests/java5/autoboxing/AspectLong.aj [new file with mode: 0644]
tests/java5/autoboxing/AspectShort.aj [new file with mode: 0644]
tests/java5/autoboxing/AutoboxingB.java [new file with mode: 0644]
tests/java5/autoboxing/AutoboxingC.java [new file with mode: 0644]
tests/java5/autoboxing/AutoboxingD.java [new file with mode: 0644]
tests/java5/autoboxing/AutoboxingF.java [new file with mode: 0644]
tests/java5/autoboxing/AutoboxingI.java [new file with mode: 0644]
tests/java5/autoboxing/AutoboxingJ.java [new file with mode: 0644]
tests/java5/autoboxing/AutoboxingS.java [new file with mode: 0644]
tests/java5/autoboxing/AutoboxingZ.java [new file with mode: 0644]
tests/java5/autoboxing/SimpleAutoboxing.java [new file with mode: 0644]
tests/java5/autoboxing/SimpleAutoboxingAspect.aj [new file with mode: 0644]
tests/java5/autoboxing/build.xml [new file with mode: 0644]
tests/java5/autoboxing/testcode.jar [new file with mode: 0644]

diff --git a/tests/java5/autoboxing/AspectBoolean.aj b/tests/java5/autoboxing/AspectBoolean.aj
new file mode 100644 (file)
index 0000000..8b980d5
--- /dev/null
@@ -0,0 +1,11 @@
+public aspect AspectBoolean {\r
+\r
+  // The pointcuts here expose context\r
+  before(Boolean i): within(AutoboxingZ) && call(* met*(..)) && args(i) {\r
+    System.err.println("Boolean:"+i);\r
+  }\r
+\r
+  before(boolean i): within(AutoboxingZ) && call(* met*(..)) && args(i) {\r
+    System.err.println("boolean:"+i);\r
+  }\r
+}\r
diff --git a/tests/java5/autoboxing/AspectByte.aj b/tests/java5/autoboxing/AspectByte.aj
new file mode 100644 (file)
index 0000000..e604123
--- /dev/null
@@ -0,0 +1,11 @@
+public aspect AspectByte {\r
+\r
+  // The pointcuts here expose context\r
+  before(Byte i): within(AutoboxingB) && call(* met*(..)) && args(i) {\r
+    System.err.println("Byte:"+i);\r
+  }\r
+\r
+  before(byte i): within(AutoboxingB) && call(* met*(..)) && args(i) {\r
+    System.err.println("byte:"+i);\r
+  }\r
+}\r
diff --git a/tests/java5/autoboxing/AspectChar.aj b/tests/java5/autoboxing/AspectChar.aj
new file mode 100644 (file)
index 0000000..dc185a0
--- /dev/null
@@ -0,0 +1,11 @@
+public aspect AspectChar {\r
+\r
+  // The pointcuts here expose context\r
+  before(Character i): within(AutoboxingC) && call(* met*(..)) && args(i) {\r
+    System.err.println("Character:"+i);\r
+  }\r
+\r
+  before(char i): within(AutoboxingC) && call(* met*(..)) && args(i) {\r
+    System.err.println("char:"+i);\r
+  }\r
+}\r
diff --git a/tests/java5/autoboxing/AspectDouble.aj b/tests/java5/autoboxing/AspectDouble.aj
new file mode 100644 (file)
index 0000000..cef86f0
--- /dev/null
@@ -0,0 +1,11 @@
+public aspect AspectDouble {\r
+\r
+  // The pointcuts here expose context\r
+  before(Double i): within(AutoboxingD) && call(* met*(..)) && args(i) {\r
+    System.err.println("Double:"+i);\r
+  }\r
+\r
+  before(double i): within(AutoboxingD) && call(* met*(..)) && args(i) {\r
+    System.err.println("double:"+i);\r
+  }\r
+}\r
diff --git a/tests/java5/autoboxing/AspectFloat.aj b/tests/java5/autoboxing/AspectFloat.aj
new file mode 100644 (file)
index 0000000..b2351b3
--- /dev/null
@@ -0,0 +1,11 @@
+public aspect AspectFloat {\r
+\r
+  // The pointcuts here expose context\r
+  before(Float i): within(AutoboxingF) && call(* met*(..)) && args(i) {\r
+    System.err.println("Float:"+i);\r
+  }\r
+\r
+  before(float i): within(AutoboxingF) && call(* met*(..)) && args(i) {\r
+    System.err.println("float:"+i);\r
+  }\r
+}\r
diff --git a/tests/java5/autoboxing/AspectInteger.aj b/tests/java5/autoboxing/AspectInteger.aj
new file mode 100644 (file)
index 0000000..4fb7e81
--- /dev/null
@@ -0,0 +1,11 @@
+public aspect AspectInteger {\r
+\r
+  // The pointcuts here expose context\r
+  before(Integer i): within(AutoboxingI) && call(* met*(..)) && args(i) {\r
+    System.err.println("Matching by Integer:"+i);\r
+  }\r
+\r
+  before(int i): within(AutoboxingI) && call(* met*(..)) && args(i) {\r
+    System.err.println("Matching by int:"+i);\r
+  }\r
+}\r
diff --git a/tests/java5/autoboxing/AspectLong.aj b/tests/java5/autoboxing/AspectLong.aj
new file mode 100644 (file)
index 0000000..4b3f896
--- /dev/null
@@ -0,0 +1,11 @@
+public aspect AspectLong {\r
+\r
+  // The pointcuts here expose context\r
+  before(Long i): within(AutoboxingJ) && call(* met*(..)) && args(i) {\r
+    System.err.println("Long:"+i);\r
+  }\r
+\r
+  before(long i): within(AutoboxingJ) && call(* met*(..)) && args(i) {\r
+    System.err.println("long:"+i);\r
+  }\r
+}\r
diff --git a/tests/java5/autoboxing/AspectShort.aj b/tests/java5/autoboxing/AspectShort.aj
new file mode 100644 (file)
index 0000000..f6ee9d0
--- /dev/null
@@ -0,0 +1,11 @@
+public aspect AspectShort {\r
+\r
+  // The pointcuts here expose context\r
+  before(Short i): within(AutoboxingS) && call(* met*(..)) && args(i) {\r
+    System.err.println("Short:"+i);\r
+  }\r
+\r
+  before(short i): within(AutoboxingS) && call(* met*(..)) && args(i) {\r
+    System.err.println("short:"+i);\r
+  }\r
+}\r
diff --git a/tests/java5/autoboxing/AutoboxingB.java b/tests/java5/autoboxing/AutoboxingB.java
new file mode 100644 (file)
index 0000000..2830c1d
--- /dev/null
@@ -0,0 +1,16 @@
+public class AutoboxingB {
+       
+  public static void method_takes_Byte(Byte i) { System.err.println("method_takes_Byte="+i);}
+  public static void method_takes_byte(byte i) {         System.err.println("method_takes_byte="+i);}
+  
+  public static void main(String[] argv) {
+    Byte one   = new Byte("1");
+    byte two       = '2';
+    Byte three = new Byte("3");
+    byte four      = '4' ;
+    method_takes_Byte(one);
+    method_takes_Byte(two);
+    method_takes_byte(three);
+    method_takes_byte(four);
+  }
+}
diff --git a/tests/java5/autoboxing/AutoboxingC.java b/tests/java5/autoboxing/AutoboxingC.java
new file mode 100644 (file)
index 0000000..fdf16a9
--- /dev/null
@@ -0,0 +1,16 @@
+public class AutoboxingC {
+       
+  public static void method_takes_Character(Character i) { System.err.println("method_takes_Character="+i);}
+  public static void method_takes_char(char i) {         System.err.println("method_takes_char="+i);}
+  
+  public static void main(String[] argv) {
+    Character one   = new Character('1');
+    char two       = '2';
+    Character three = new Character('3');
+    char four      = '4';
+    method_takes_Character(one);
+    method_takes_Character(two);
+    method_takes_char(three);
+    method_takes_char(four);
+  }
+}
diff --git a/tests/java5/autoboxing/AutoboxingD.java b/tests/java5/autoboxing/AutoboxingD.java
new file mode 100644 (file)
index 0000000..242171b
--- /dev/null
@@ -0,0 +1,16 @@
+public class AutoboxingD {
+       
+  public static void method_takes_Double(Double i) { System.err.println("method_takes_Double="+i);}
+  public static void method_takes_double(double i) {         System.err.println("method_takes_double="+i);}
+  
+  public static void main(String[] argv) {
+    Double one   = new Double(100.0f);
+    double two       = 200.0f;
+    Double three = new Double(300.0f);
+    double four      = 400.0f;
+    method_takes_Double(one);
+    method_takes_Double(two);
+    method_takes_double(three);
+    method_takes_double(four);
+  }
+}
diff --git a/tests/java5/autoboxing/AutoboxingF.java b/tests/java5/autoboxing/AutoboxingF.java
new file mode 100644 (file)
index 0000000..ee7a1e6
--- /dev/null
@@ -0,0 +1,16 @@
+public class AutoboxingF {
+       
+  public static void method_takes_Float(Float i) { System.err.println("method_takes_Float="+i);}
+  public static void method_takes_float(float i) {         System.err.println("method_takes_float="+i);}
+  
+  public static void main(String[] argv) {
+    Float one   = new Float(100.0f);
+    float two       = 200.0f;
+    Float three = new Float(300.0f);
+    float four      = 400.0f;
+    method_takes_Float(one);
+    method_takes_Float(two);
+    method_takes_float(three);
+    method_takes_float(four);
+  }
+}
diff --git a/tests/java5/autoboxing/AutoboxingI.java b/tests/java5/autoboxing/AutoboxingI.java
new file mode 100644 (file)
index 0000000..102d6e9
--- /dev/null
@@ -0,0 +1,16 @@
+public class AutoboxingI {
+       
+  public static void method_takes_Integer(Integer i) { System.err.println("method_takes_Integer="+i);}
+  public static void method_takes_int(int i) {         System.err.println("method_takes_int="+i);}
+  
+  public static void main(String[] argv) {
+    Integer one   = new Integer(10000);
+    int two       = 20000;
+    Integer three = new Integer(30000);
+    int four      = 40000;
+    method_takes_Integer(one);
+    method_takes_Integer(two);
+    method_takes_int(three);
+    method_takes_int(four);
+  }
+}
diff --git a/tests/java5/autoboxing/AutoboxingJ.java b/tests/java5/autoboxing/AutoboxingJ.java
new file mode 100644 (file)
index 0000000..6332b68
--- /dev/null
@@ -0,0 +1,16 @@
+public class AutoboxingJ {
+       
+  public static void method_takes_Long(Long i) { System.err.println("method_takes_Long="+i);}
+  public static void method_takes_long(long i) {         System.err.println("method_takes_long="+i);}
+  
+  public static void main(String[] argv) {
+    Long one   = new Long(1000000);
+    long two       = 2000000;
+    Long three = new Long(3000000);
+    long four      = 4000000;
+    method_takes_Long(one);
+    method_takes_Long(two);
+    method_takes_long(three);
+    method_takes_long(four);
+  }
+}
diff --git a/tests/java5/autoboxing/AutoboxingS.java b/tests/java5/autoboxing/AutoboxingS.java
new file mode 100644 (file)
index 0000000..0fe5145
--- /dev/null
@@ -0,0 +1,16 @@
+public class AutoboxingS {
+       
+  public static void method_takes_Short(Short i) { System.err.println("method_takes_Short="+i);}
+  public static void method_takes_short(short i) { System.err.println("method_takes_short="+i);}
+  
+  public static void main(String[] argv) {
+    Short one   = new Short("100");
+    short two   = 200;
+    Short three = new Short("300");
+    short four  = 400;
+    method_takes_Short(one);
+    method_takes_Short(two);
+    method_takes_short(three);
+    method_takes_short(four);
+  }
+}
diff --git a/tests/java5/autoboxing/AutoboxingZ.java b/tests/java5/autoboxing/AutoboxingZ.java
new file mode 100644 (file)
index 0000000..b88112d
--- /dev/null
@@ -0,0 +1,14 @@
+public class AutoboxingZ {
+       
+  public static void method_takes_Boolean(Boolean b) { System.err.println("method_takes_Boolean="+b);}
+  public static void method_takes_boolean(boolean b) { System.err.println("method_takes_boolean="+b);}
+  
+  public static void main(String[] argv) {
+    Boolean t   = new Boolean(false);
+    boolean f   = false;
+    method_takes_Boolean(t);
+    method_takes_Boolean(f);
+    method_takes_boolean(t);
+    method_takes_boolean(f);
+  }
+}
diff --git a/tests/java5/autoboxing/SimpleAutoboxing.java b/tests/java5/autoboxing/SimpleAutoboxing.java
new file mode 100644 (file)
index 0000000..df2e9e6
--- /dev/null
@@ -0,0 +1,9 @@
+public class SimpleAutoboxing {
+       
+  public static void method_takes_Integer(Integer i) { System.err.println("method_takes_Integer="+i);}
+  
+  public static void main(String[] argv) {
+    int one     = 20000;
+    method_takes_Integer(one);
+  }
+}
diff --git a/tests/java5/autoboxing/SimpleAutoboxingAspect.aj b/tests/java5/autoboxing/SimpleAutoboxingAspect.aj
new file mode 100644 (file)
index 0000000..b13d3c2
--- /dev/null
@@ -0,0 +1,11 @@
+public aspect SimpleAutoboxingAspect {\r
+\r
+  // The pointcuts here expose context\r
+  before(Integer i): within(SimpleAutoboxing) && call(* met*(..)) && args(i) {\r
+    System.err.println("Matching by Integer:"+i);\r
+  }\r
+\r
+  before(int i): within(SimpleAutoboxing) && call(* met*(..)) && args(i) {\r
+    System.err.println("Matching by int:"+i);\r
+  }\r
+}\r
diff --git a/tests/java5/autoboxing/build.xml b/tests/java5/autoboxing/build.xml
new file mode 100644 (file)
index 0000000..d38a770
--- /dev/null
@@ -0,0 +1,11 @@
+<project name="Java 5 compilation of test source" default="default" basedir=".">
+
+    <target name="default" >
+       <delete dir="output" failonerror="false"/>
+       <mkdir dir="output"/>
+       <javac destdir="output" debug="on" srcdir="." includes="*.java"/>
+       <zip file="testcode.jar" basedir="output" includes="**/*"/>
+       <delete dir="output"/>
+    </target>
+
+</project>
diff --git a/tests/java5/autoboxing/testcode.jar b/tests/java5/autoboxing/testcode.jar
new file mode 100644 (file)
index 0000000..a758f7b
Binary files /dev/null and b/tests/java5/autoboxing/testcode.jar differ