diff options
author | wisberg <wisberg> | 2003-08-06 07:31:16 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2003-08-06 07:31:16 +0000 |
commit | c09964fbdb4d97c60c3fc72b3061518369db5161 (patch) | |
tree | bb54234adcc567c2b306ad29887b1eab84accc9f /tests/bugs/interfaceLibrary | |
parent | a63bc04fb1cb6e8d6d0bc2a509ab9658e3d78c43 (diff) | |
download | aspectj-c09964fbdb4d97c60c3fc72b3061518369db5161.tar.gz aspectj-c09964fbdb4d97c60c3fc72b3061518369db5161.zip |
@testcase PR#41175 aspect-declared methods with exception clauses fail in binary libraries
Corresponding non-binary passing tests added to ajcTests.xml
Diffstat (limited to 'tests/bugs/interfaceLibrary')
-rw-r--r-- | tests/bugs/interfaceLibrary/ClassClient.java | 14 | ||||
-rw-r--r-- | tests/bugs/interfaceLibrary/ClassClientCE.java | 9 | ||||
-rw-r--r-- | tests/bugs/interfaceLibrary/Client.java | 14 | ||||
-rw-r--r-- | tests/bugs/interfaceLibrary/ClientCE.java | 9 | ||||
-rw-r--r-- | tests/bugs/interfaceLibrary/LibraryAspect.java | 8 | ||||
-rw-r--r-- | tests/bugs/interfaceLibrary/LibraryClassAspect.java | 8 | ||||
-rw-r--r-- | tests/bugs/interfaceLibrary/build.xml | 70 | ||||
-rw-r--r-- | tests/bugs/interfaceLibrary/lib.jar | bin | 0 -> 1310 bytes | |||
-rw-r--r-- | tests/bugs/interfaceLibrary/lib/LibraryClass.java | 6 | ||||
-rw-r--r-- | tests/bugs/interfaceLibrary/lib/LibraryInterface.java | 6 | ||||
-rw-r--r-- | tests/bugs/interfaceLibrary/libClass.jar | bin | 0 -> 1485 bytes |
11 files changed, 144 insertions, 0 deletions
diff --git a/tests/bugs/interfaceLibrary/ClassClient.java b/tests/bugs/interfaceLibrary/ClassClient.java new file mode 100644 index 000000000..b3da33370 --- /dev/null +++ b/tests/bugs/interfaceLibrary/ClassClient.java @@ -0,0 +1,14 @@ + +import java.io.IOException; + +public class ClassClient { + public static void main(String[] a) { + try { + new C().run(); + throw new Error("test failed to throw IOException"); + } catch (IOException e) { + } + } +} + +class C extends lib.LibraryClass {}
\ No newline at end of file diff --git a/tests/bugs/interfaceLibrary/ClassClientCE.java b/tests/bugs/interfaceLibrary/ClassClientCE.java new file mode 100644 index 000000000..59006ba74 --- /dev/null +++ b/tests/bugs/interfaceLibrary/ClassClientCE.java @@ -0,0 +1,9 @@ + + +public class ClassClientCE { + public static void main(String[] a) { + new C().run(); // CE 5 expected: declare IOException + } +} + +class C extends lib.LibraryClass {}
\ No newline at end of file diff --git a/tests/bugs/interfaceLibrary/Client.java b/tests/bugs/interfaceLibrary/Client.java new file mode 100644 index 000000000..d18163963 --- /dev/null +++ b/tests/bugs/interfaceLibrary/Client.java @@ -0,0 +1,14 @@ + +import java.io.IOException; + +public class Client { + public static void main(String[] a) { + try { + new C().run(); + throw new Error("test failed to throw IOException"); + } catch (IOException e) { + } + } +} + +class C implements lib.LibraryInterface {}
\ No newline at end of file diff --git a/tests/bugs/interfaceLibrary/ClientCE.java b/tests/bugs/interfaceLibrary/ClientCE.java new file mode 100644 index 000000000..a92bd522e --- /dev/null +++ b/tests/bugs/interfaceLibrary/ClientCE.java @@ -0,0 +1,9 @@ + + +public class ClientCE { + public static void main(String[] a) { + new C().run(); // CE 5 expected: declare IOException + } +} + +class C implements lib.LibraryInterface {}
\ No newline at end of file diff --git a/tests/bugs/interfaceLibrary/LibraryAspect.java b/tests/bugs/interfaceLibrary/LibraryAspect.java new file mode 100644 index 000000000..bf1ddabf0 --- /dev/null +++ b/tests/bugs/interfaceLibrary/LibraryAspect.java @@ -0,0 +1,8 @@ + +import java.io.IOException; + +aspect LibraryAspect { + public void lib.LibraryInterface.run() throws IOException { + throw new IOException("LibraryAspect-defined run() for " + this); + } +}
\ No newline at end of file diff --git a/tests/bugs/interfaceLibrary/LibraryClassAspect.java b/tests/bugs/interfaceLibrary/LibraryClassAspect.java new file mode 100644 index 000000000..ff65af6e3 --- /dev/null +++ b/tests/bugs/interfaceLibrary/LibraryClassAspect.java @@ -0,0 +1,8 @@ + +import java.io.IOException; + +aspect LibraryClassAspect { + public void lib.LibraryClass.run() throws IOException { + throw new IOException("LibraryClassAspect-defined run() for " + this); + } +}
\ No newline at end of file diff --git a/tests/bugs/interfaceLibrary/build.xml b/tests/bugs/interfaceLibrary/build.xml new file mode 100644 index 000000000..d8d178dc1 --- /dev/null +++ b/tests/bugs/interfaceLibrary/build.xml @@ -0,0 +1,70 @@ + +<project name="interfaceLibrary" default="build" basedir="."> + + <!-- @testcase PR#41175 aspect-declared methods with exception clauses fail in binary libraries --> + <target name="build" depends="init"> + <iajc + classpath="${aspectjrt.jar}" + outjar="lib.jar" + srcdir="." + includes="LibraryAspect.java,lib/LibraryInterface.java"/> + + <iajc + classpath="${aspectjrt.jar}" + outjar="libClass.jar" + srcdir="." + includes="LibraryClassAspect.java,lib/LibraryClass.java"/> + + </target> + + <target name="init" depends="init.variables,init.taskdefs"/> + + <target name="init.variables" + description="init variables"> + + <!-- required directories - run from examples or predefine --> + <property name="interfaceLibrary.dir" + location="${basedir}"/> + <property name="aspectj.lib.dir" + location="${interfaceLibrary.dir}/../../../aj-build/dist/tools/lib"/> + + <!-- required libraries - install or predefine --> + <property name="aspectjrt.jar" + location="${aspectj.lib.dir}/aspectjrt.jar"/> + <property name="aspectjtools.jar" + location="${aspectj.lib.dir}/aspectjtools.jar"/> + + <!-- checking required libraries --> + <available file="${aspectjtools.jar}" + property="aspectjtools.jar.available"/> + <available file="${aspectjrt.jar}" + property="aspectjrt.jar.available"/> + + </target> + + <target name="init.taskdefs" depends="init.variables, + aspectjtools.jar.available, + aspectjrt.jar.available" + unless="taskdefs.init"> + <!-- sets name of new task to iajc, old task to ajc --> + <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties"> + <classpath> + <pathelement path="${aspectjtools.jar}"/> + </classpath> + </taskdef> + <property name="taskdefs.init" value="true"/> + </target> + + <!-- targets to fail unless required libraries available --> + + <target name="aspectjrt.jar.available" depends="init.variables" + unless="aspectjrt.jar.available" > + <fail message="expecting aspectjrt.jar at ${aspectjrt.jar}"/> + </target> + + <target name="aspectjtools.jar.available" depends="init.variables" + unless="aspectjtools.jar.available" > + <fail message="expecting aspectjtools.jar at ${aspectjtools.jar}"/> + </target> + +</project> diff --git a/tests/bugs/interfaceLibrary/lib.jar b/tests/bugs/interfaceLibrary/lib.jar Binary files differnew file mode 100644 index 000000000..496514a29 --- /dev/null +++ b/tests/bugs/interfaceLibrary/lib.jar diff --git a/tests/bugs/interfaceLibrary/lib/LibraryClass.java b/tests/bugs/interfaceLibrary/lib/LibraryClass.java new file mode 100644 index 000000000..4fa031640 --- /dev/null +++ b/tests/bugs/interfaceLibrary/lib/LibraryClass.java @@ -0,0 +1,6 @@ + +package lib; + +public class LibraryClass { + +}
\ No newline at end of file diff --git a/tests/bugs/interfaceLibrary/lib/LibraryInterface.java b/tests/bugs/interfaceLibrary/lib/LibraryInterface.java new file mode 100644 index 000000000..38f339b08 --- /dev/null +++ b/tests/bugs/interfaceLibrary/lib/LibraryInterface.java @@ -0,0 +1,6 @@ + +package lib; + +public interface LibraryInterface { + +}
\ No newline at end of file diff --git a/tests/bugs/interfaceLibrary/libClass.jar b/tests/bugs/interfaceLibrary/libClass.jar Binary files differnew file mode 100644 index 000000000..720435d62 --- /dev/null +++ b/tests/bugs/interfaceLibrary/libClass.jar |