diff options
Diffstat (limited to 'tests/java5')
-rw-r--r-- | tests/java5/covariance/CovAspect01.aj | 10 | ||||
-rw-r--r-- | tests/java5/covariance/CovAspect02.aj | 10 | ||||
-rw-r--r-- | tests/java5/covariance/CovAspect03.aj | 10 | ||||
-rw-r--r-- | tests/java5/covariance/CovAspect04.aj | 10 | ||||
-rw-r--r-- | tests/java5/covariance/CovAspect05.aj | 10 | ||||
-rw-r--r-- | tests/java5/covariance/CovAspect06.aj | 10 | ||||
-rw-r--r-- | tests/java5/covariance/CovAspect07.aj | 10 | ||||
-rw-r--r-- | tests/java5/covariance/CovAspect08.aj | 16 | ||||
-rw-r--r-- | tests/java5/covariance/CovAspect09.aj | 10 | ||||
-rw-r--r-- | tests/java5/covariance/CovAspect10.aj | 10 | ||||
-rw-r--r-- | tests/java5/covariance/CovAspect11.aj | 10 | ||||
-rw-r--r-- | tests/java5/covariance/CovBaseProgram01.jar | bin | 0 -> 1896 bytes | |||
-rw-r--r-- | tests/java5/covariance/CovBaseProgram01.java | 32 | ||||
-rw-r--r-- | tests/java5/covariance/CovBaseProgram02.jar | bin | 0 -> 1888 bytes | |||
-rw-r--r-- | tests/java5/covariance/CovBaseProgram02.java | 36 | ||||
-rw-r--r-- | tests/java5/covariance/build.xml | 19 |
16 files changed, 203 insertions, 0 deletions
diff --git a/tests/java5/covariance/CovAspect01.aj b/tests/java5/covariance/CovAspect01.aj new file mode 100644 index 000000000..fa66dd0c1 --- /dev/null +++ b/tests/java5/covariance/CovAspect01.aj @@ -0,0 +1,10 @@ +aspect CovAspect01 {
+
+ pointcut p(): call(* getCar());
+
+ before(): p() {
+ System.out.println("[call(* getCar()) matched on '"+thisJoinPoint+":"+thisJoinPoint.getSourceLocation()+"']");
+ }
+
+}
+
diff --git a/tests/java5/covariance/CovAspect02.aj b/tests/java5/covariance/CovAspect02.aj new file mode 100644 index 000000000..6a2472a02 --- /dev/null +++ b/tests/java5/covariance/CovAspect02.aj @@ -0,0 +1,10 @@ +aspect CovAspect02 {
+
+ pointcut p(): call(* Super.getCar());
+
+ before(): p() {
+ System.out.println("[call(* Super.getCar()) matched on '"+thisJoinPoint+":"+thisJoinPoint.getSourceLocation()+"']");
+ }
+
+}
+
diff --git a/tests/java5/covariance/CovAspect03.aj b/tests/java5/covariance/CovAspect03.aj new file mode 100644 index 000000000..551c4b613 --- /dev/null +++ b/tests/java5/covariance/CovAspect03.aj @@ -0,0 +1,10 @@ +aspect CovAspect03 {
+
+ pointcut p(): call(Car getCar());
+
+ before(): p() {
+ System.out.println("[call(Car getCar()) matched on '"+thisJoinPoint+":"+thisJoinPoint.getSourceLocation()+"']");
+ }
+
+}
+
diff --git a/tests/java5/covariance/CovAspect04.aj b/tests/java5/covariance/CovAspect04.aj new file mode 100644 index 000000000..e8dd00de4 --- /dev/null +++ b/tests/java5/covariance/CovAspect04.aj @@ -0,0 +1,10 @@ +aspect CovAspect04 {
+
+ pointcut p(): call(Car Super.getCar());
+
+ before(): p() {
+ System.out.println("[call(Car Super.getCar()) matched on '"+thisJoinPoint+":"+thisJoinPoint.getSourceLocation()+"']");
+ }
+
+}
+
diff --git a/tests/java5/covariance/CovAspect05.aj b/tests/java5/covariance/CovAspect05.aj new file mode 100644 index 000000000..268b179b0 --- /dev/null +++ b/tests/java5/covariance/CovAspect05.aj @@ -0,0 +1,10 @@ +aspect CovAspect05 {
+
+ pointcut p(): call(Car Super.getCar());
+
+ before(): p() {
+ System.out.println("[call(Car Super.getCar()) matched on '"+thisJoinPoint+":"+thisJoinPoint.getSourceLocation()+"']");
+ }
+
+}
+
diff --git a/tests/java5/covariance/CovAspect06.aj b/tests/java5/covariance/CovAspect06.aj new file mode 100644 index 000000000..bb4961360 --- /dev/null +++ b/tests/java5/covariance/CovAspect06.aj @@ -0,0 +1,10 @@ +aspect CovAspect06 {
+
+ pointcut p(): call(Car Sub.getCar());
+
+ before(): p() {
+ System.out.println("[call(Car Sub.getCar()) matched on '"+thisJoinPoint+":"+thisJoinPoint.getSourceLocation()+"']");
+ }
+
+}
+
diff --git a/tests/java5/covariance/CovAspect07.aj b/tests/java5/covariance/CovAspect07.aj new file mode 100644 index 000000000..67a76825b --- /dev/null +++ b/tests/java5/covariance/CovAspect07.aj @@ -0,0 +1,10 @@ +aspect CovAspect07 {
+
+ pointcut p(): call(Car+ Sub.getCar());
+
+ before(): p() {
+ System.out.println("[call(Car+ Sub.getCar()) matched on '"+thisJoinPoint+":"+thisJoinPoint.getSourceLocation()+"']");
+ }
+
+}
+
diff --git a/tests/java5/covariance/CovAspect08.aj b/tests/java5/covariance/CovAspect08.aj new file mode 100644 index 000000000..5920981dc --- /dev/null +++ b/tests/java5/covariance/CovAspect08.aj @@ -0,0 +1,16 @@ +aspect CovAspect08 {
+
+ pointcut p1(): call(FastCar getCar());
+
+ before(): p1() {
+ System.out.println("[call(FastCar getCar()) matched on '"+thisJoinPoint+":"+thisJoinPoint.getSourceLocation()+"']");
+ }
+
+ pointcut p2(): call(FastCar Sub.getCar());
+
+ before(): p2() {
+ System.out.println("[call(FastCar Sub.getCar()) matched on '"+thisJoinPoint+":"+thisJoinPoint.getSourceLocation()+"']");
+ }
+
+}
+
diff --git a/tests/java5/covariance/CovAspect09.aj b/tests/java5/covariance/CovAspect09.aj new file mode 100644 index 000000000..6a3497048 --- /dev/null +++ b/tests/java5/covariance/CovAspect09.aj @@ -0,0 +1,10 @@ +aspect CovAspect09 {
+
+ pointcut p1(): call(FastCar Super.getCar());
+
+ before(): p1() {
+ System.out.println("[call(FastCar Super.getCar()) matched on '"+thisJoinPoint+":"+thisJoinPoint.getSourceLocation()+"']");
+ }
+
+}
+
diff --git a/tests/java5/covariance/CovAspect10.aj b/tests/java5/covariance/CovAspect10.aj new file mode 100644 index 000000000..158a3e1e2 --- /dev/null +++ b/tests/java5/covariance/CovAspect10.aj @@ -0,0 +1,10 @@ +aspect CovAspect10 {
+
+ pointcut p1(): call(Car+ getCar());
+
+ before(): p1() {
+ System.out.println("[call(Car+ getCar()) matched on '"+thisJoinPoint+":"+thisJoinPoint.getSourceLocation()+"']");
+ }
+
+}
+
diff --git a/tests/java5/covariance/CovAspect11.aj b/tests/java5/covariance/CovAspect11.aj new file mode 100644 index 000000000..19f742e85 --- /dev/null +++ b/tests/java5/covariance/CovAspect11.aj @@ -0,0 +1,10 @@ +aspect CovAspect11 {
+
+ pointcut p1(): call(Car+ Sub.getCar());
+
+ before(): p1() {
+ System.out.println("[call(Car+ Sub.getCar()) matched on '"+thisJoinPoint+":"+thisJoinPoint.getSourceLocation()+"']");
+ }
+
+}
+
diff --git a/tests/java5/covariance/CovBaseProgram01.jar b/tests/java5/covariance/CovBaseProgram01.jar Binary files differnew file mode 100644 index 000000000..5a89abea2 --- /dev/null +++ b/tests/java5/covariance/CovBaseProgram01.jar diff --git a/tests/java5/covariance/CovBaseProgram01.java b/tests/java5/covariance/CovBaseProgram01.java new file mode 100644 index 000000000..169a6be10 --- /dev/null +++ b/tests/java5/covariance/CovBaseProgram01.java @@ -0,0 +1,32 @@ +class Car {} + +class FastCar extends Car {} + +class Super { + Car getCar() { + return new Car(); + } +} + +class Sub extends Super { + FastCar getCar() { + return new FastCar(); + } +} + +public class CovBaseProgram01 { + public static void main(String[] argv) { + new CovBaseProgram01().run(); + } + + public void run() { + Super instance_super = new Super(); + Sub instance_sub = new Sub(); + + Car c1 = instance_super.getCar(); + Car c2 = instance_sub.getCar(); + } +} + +// FastCar is a subclass of Car. +// Sub is a subclass of Super.
\ No newline at end of file diff --git a/tests/java5/covariance/CovBaseProgram02.jar b/tests/java5/covariance/CovBaseProgram02.jar Binary files differnew file mode 100644 index 000000000..93898a284 --- /dev/null +++ b/tests/java5/covariance/CovBaseProgram02.jar diff --git a/tests/java5/covariance/CovBaseProgram02.java b/tests/java5/covariance/CovBaseProgram02.java new file mode 100644 index 000000000..43f5a873a --- /dev/null +++ b/tests/java5/covariance/CovBaseProgram02.java @@ -0,0 +1,36 @@ +class Car { + Car() {} +} + +class FastCar extends Car { + FastCar() {} +} + +class Super { + Car getCar() { + return new Car(); + } +} + +class Sub { + FastCar getCar() { + return new FastCar(); + } +} + +public class CovBaseProgram02 { + public static void main(String[] argv) { + new CovBaseProgram02().run(); + } + + public void run() { + Super instance_super = new Super(); + Sub instance_sub = new Sub(); + + Car c1 = instance_super.getCar(); + FastCar c2 = instance_sub.getCar(); + } +} + +// Lemon is a subclass of Car +// Sub is *not* a subclass of Super diff --git a/tests/java5/covariance/build.xml b/tests/java5/covariance/build.xml new file mode 100644 index 000000000..121ec3b46 --- /dev/null +++ b/tests/java5/covariance/build.xml @@ -0,0 +1,19 @@ +<project name="Java 5 compilation of covariance test source" default="default" basedir="."> + + <target name="default"> + <delete dir="output" failonerror="false"/> + + <mkdir dir="output"/> + <javac destdir="output" debug="on" srcdir="." includes="CovBaseProgram01.java"/> + <zip file="CovBaseProgram01.jar" basedir="output" includes="*"/> + <delete dir="output"/> + + <mkdir dir="output"/> + <javac destdir="output" debug="on" srcdir="." includes="CovBaseProgram02.java"/> + <zip file="CovBaseProgram02.jar" basedir="output" includes="*"/> + <delete dir="output"/> + + + </target> + +</project> |