diff options
author | aclement <aclement> | 2004-12-09 18:58:06 +0000 |
---|---|---|
committer | aclement <aclement> | 2004-12-09 18:58:06 +0000 |
commit | 611164c967be7d02c56a014a4ef2e79f9b52f16a (patch) | |
tree | 0c309d0568ae9db62c7da321d7d6891c4fe42e00 | |
parent | 4a151e1a818651266762a6721d0affd745b51946 (diff) | |
download | aspectj-611164c967be7d02c56a014a4ef2e79f9b52f16a.tar.gz aspectj-611164c967be7d02c56a014a4ef2e79f9b52f16a.zip |
Autoboxing testdata - all primitives covered.
20 files changed, 245 insertions, 0 deletions
diff --git a/tests/java5/autoboxing/AspectBoolean.aj b/tests/java5/autoboxing/AspectBoolean.aj new file mode 100644 index 000000000..8b980d567 --- /dev/null +++ b/tests/java5/autoboxing/AspectBoolean.aj @@ -0,0 +1,11 @@ +public aspect AspectBoolean {
+
+ // The pointcuts here expose context
+ before(Boolean i): within(AutoboxingZ) && call(* met*(..)) && args(i) {
+ System.err.println("Boolean:"+i);
+ }
+
+ before(boolean i): within(AutoboxingZ) && call(* met*(..)) && args(i) {
+ System.err.println("boolean:"+i);
+ }
+}
diff --git a/tests/java5/autoboxing/AspectByte.aj b/tests/java5/autoboxing/AspectByte.aj new file mode 100644 index 000000000..e60412385 --- /dev/null +++ b/tests/java5/autoboxing/AspectByte.aj @@ -0,0 +1,11 @@ +public aspect AspectByte {
+
+ // The pointcuts here expose context
+ before(Byte i): within(AutoboxingB) && call(* met*(..)) && args(i) {
+ System.err.println("Byte:"+i);
+ }
+
+ before(byte i): within(AutoboxingB) && call(* met*(..)) && args(i) {
+ System.err.println("byte:"+i);
+ }
+}
diff --git a/tests/java5/autoboxing/AspectChar.aj b/tests/java5/autoboxing/AspectChar.aj new file mode 100644 index 000000000..dc185a03b --- /dev/null +++ b/tests/java5/autoboxing/AspectChar.aj @@ -0,0 +1,11 @@ +public aspect AspectChar {
+
+ // The pointcuts here expose context
+ before(Character i): within(AutoboxingC) && call(* met*(..)) && args(i) {
+ System.err.println("Character:"+i);
+ }
+
+ before(char i): within(AutoboxingC) && call(* met*(..)) && args(i) {
+ System.err.println("char:"+i);
+ }
+}
diff --git a/tests/java5/autoboxing/AspectDouble.aj b/tests/java5/autoboxing/AspectDouble.aj new file mode 100644 index 000000000..cef86f03a --- /dev/null +++ b/tests/java5/autoboxing/AspectDouble.aj @@ -0,0 +1,11 @@ +public aspect AspectDouble {
+
+ // The pointcuts here expose context
+ before(Double i): within(AutoboxingD) && call(* met*(..)) && args(i) {
+ System.err.println("Double:"+i);
+ }
+
+ before(double i): within(AutoboxingD) && call(* met*(..)) && args(i) {
+ System.err.println("double:"+i);
+ }
+}
diff --git a/tests/java5/autoboxing/AspectFloat.aj b/tests/java5/autoboxing/AspectFloat.aj new file mode 100644 index 000000000..b2351b378 --- /dev/null +++ b/tests/java5/autoboxing/AspectFloat.aj @@ -0,0 +1,11 @@ +public aspect AspectFloat {
+
+ // The pointcuts here expose context
+ before(Float i): within(AutoboxingF) && call(* met*(..)) && args(i) {
+ System.err.println("Float:"+i);
+ }
+
+ before(float i): within(AutoboxingF) && call(* met*(..)) && args(i) {
+ System.err.println("float:"+i);
+ }
+}
diff --git a/tests/java5/autoboxing/AspectInteger.aj b/tests/java5/autoboxing/AspectInteger.aj new file mode 100644 index 000000000..4fb7e815f --- /dev/null +++ b/tests/java5/autoboxing/AspectInteger.aj @@ -0,0 +1,11 @@ +public aspect AspectInteger {
+
+ // The pointcuts here expose context
+ before(Integer i): within(AutoboxingI) && call(* met*(..)) && args(i) {
+ System.err.println("Matching by Integer:"+i);
+ }
+
+ before(int i): within(AutoboxingI) && call(* met*(..)) && args(i) {
+ System.err.println("Matching by int:"+i);
+ }
+}
diff --git a/tests/java5/autoboxing/AspectLong.aj b/tests/java5/autoboxing/AspectLong.aj new file mode 100644 index 000000000..4b3f896bc --- /dev/null +++ b/tests/java5/autoboxing/AspectLong.aj @@ -0,0 +1,11 @@ +public aspect AspectLong {
+
+ // The pointcuts here expose context
+ before(Long i): within(AutoboxingJ) && call(* met*(..)) && args(i) {
+ System.err.println("Long:"+i);
+ }
+
+ before(long i): within(AutoboxingJ) && call(* met*(..)) && args(i) {
+ System.err.println("long:"+i);
+ }
+}
diff --git a/tests/java5/autoboxing/AspectShort.aj b/tests/java5/autoboxing/AspectShort.aj new file mode 100644 index 000000000..f6ee9d045 --- /dev/null +++ b/tests/java5/autoboxing/AspectShort.aj @@ -0,0 +1,11 @@ +public aspect AspectShort {
+
+ // The pointcuts here expose context
+ before(Short i): within(AutoboxingS) && call(* met*(..)) && args(i) {
+ System.err.println("Short:"+i);
+ }
+
+ before(short i): within(AutoboxingS) && call(* met*(..)) && args(i) {
+ System.err.println("short:"+i);
+ }
+}
diff --git a/tests/java5/autoboxing/AutoboxingB.java b/tests/java5/autoboxing/AutoboxingB.java new file mode 100644 index 000000000..2830c1deb --- /dev/null +++ b/tests/java5/autoboxing/AutoboxingB.java @@ -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 index 000000000..fdf16a9df --- /dev/null +++ b/tests/java5/autoboxing/AutoboxingC.java @@ -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 index 000000000..242171b46 --- /dev/null +++ b/tests/java5/autoboxing/AutoboxingD.java @@ -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 index 000000000..ee7a1e664 --- /dev/null +++ b/tests/java5/autoboxing/AutoboxingF.java @@ -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 index 000000000..102d6e903 --- /dev/null +++ b/tests/java5/autoboxing/AutoboxingI.java @@ -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 index 000000000..6332b6806 --- /dev/null +++ b/tests/java5/autoboxing/AutoboxingJ.java @@ -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 index 000000000..0fe514554 --- /dev/null +++ b/tests/java5/autoboxing/AutoboxingS.java @@ -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 index 000000000..b88112d80 --- /dev/null +++ b/tests/java5/autoboxing/AutoboxingZ.java @@ -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 index 000000000..df2e9e68f --- /dev/null +++ b/tests/java5/autoboxing/SimpleAutoboxing.java @@ -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 index 000000000..b13d3c253 --- /dev/null +++ b/tests/java5/autoboxing/SimpleAutoboxingAspect.aj @@ -0,0 +1,11 @@ +public aspect SimpleAutoboxingAspect {
+
+ // The pointcuts here expose context
+ before(Integer i): within(SimpleAutoboxing) && call(* met*(..)) && args(i) {
+ System.err.println("Matching by Integer:"+i);
+ }
+
+ before(int i): within(SimpleAutoboxing) && call(* met*(..)) && args(i) {
+ System.err.println("Matching by int:"+i);
+ }
+}
diff --git a/tests/java5/autoboxing/build.xml b/tests/java5/autoboxing/build.xml new file mode 100644 index 000000000..d38a7705f --- /dev/null +++ b/tests/java5/autoboxing/build.xml @@ -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 Binary files differnew file mode 100644 index 000000000..a758f7b0f --- /dev/null +++ b/tests/java5/autoboxing/testcode.jar |