diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ajcTests.xml | 38 | ||||
-rw-r--r-- | tests/ajcTestsFailing.xml | 30 | ||||
-rw-r--r-- | tests/bugs/DeclaredExceptions.java | 28 | ||||
-rw-r--r-- | tests/bugs/interfaceLibrary/lib.jar | bin | 1310 -> 1410 bytes | |||
-rw-r--r-- | tests/bugs/interfaceLibrary/libClass.jar | bin | 1485 -> 1531 bytes | |||
-rw-r--r-- | tests/new/interfaceLibrary/aspectOnly.jar | bin | 1027 -> 1066 bytes | |||
-rw-r--r-- | tests/new/interfaceLibrary/aspectedInterfaceOnly.jar | bin | 312 -> 347 bytes | |||
-rw-r--r-- | tests/new/interfaceLibrary/aspectedInterfaceOnlyBinary.jar | bin | 312 -> 347 bytes | |||
-rw-r--r-- | tests/new/interfaceLibrary/interfaceOnly.jar | bin | 263 -> 263 bytes |
9 files changed, 66 insertions, 30 deletions
diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml index 2ae8559ae..1a73d9990 100644 --- a/tests/ajcTests.xml +++ b/tests/ajcTests.xml @@ -6549,6 +6549,7 @@ <compile files="Client.java" classpath="aspectedInterfaceOnly.jar"> + <message kind="error" line="0" text="LibraryAspect"/> <message kind="error" line="9" text="LibraryInterface"/> </compile> </ajc-test> @@ -6629,4 +6630,41 @@ </compile> </ajc-test> + <ajc-test dir="bugs" + pr="41175" + title="reflective check of declared exceptions from aspect-declared methods"> + <compile files="DeclaredExceptions.java"/> + <run class="DeclaredExceptions"/> + </ajc-test> + + <ajc-test dir="bugs/interfaceLibrary" + pr="41175" + title="exception clause for aspect-declared interface methods - positive binary"> + <compile files="Client.java" aspectpath="lib.jar"/> + <run class="Client"/> + </ajc-test> + + <ajc-test dir="bugs/interfaceLibrary" + pr="41175" + title="exception clause for aspect-declared interface methods - negative binary"> + <compile files="ClientCE.java" aspectpath="lib.jar"> + <message kind="error" file="ClientCE.java" line="5"/> + </compile> + </ajc-test> + + <ajc-test dir="bugs/interfaceLibrary" + pr="41175" + title="exception clause for aspect-declared class methods - positive binary"> + <compile files="ClassClient.java" aspectpath="libClass.jar"/> + <run class="ClassClient"/> + </ajc-test> + + <ajc-test dir="bugs/interfaceLibrary" + pr="41175" + title="exception clause for aspect-declared class methods - negative binary"> + <compile files="ClassClientCE.java" aspectpath="libClass.jar"> + <message kind="error" file="ClassClientCE.java" line="5"/> + </compile> + </ajc-test> + </suite> diff --git a/tests/ajcTestsFailing.xml b/tests/ajcTestsFailing.xml index 8b5d79788..5439341a1 100644 --- a/tests/ajcTestsFailing.xml +++ b/tests/ajcTestsFailing.xml @@ -12,36 +12,6 @@ <run class="Client"/> </ajc-test> - <ajc-test dir="bugs/interfaceLibrary" - pr="41175" - title="exception clause for aspect-declared interface methods - positive binary"> - <compile files="Client.java" aspectpath="lib.jar"/> - <run class="Client"/> - </ajc-test> - - <ajc-test dir="bugs/interfaceLibrary" - pr="41175" - title="exception clause for aspect-declared interface methods - negative binary"> - <compile files="ClientCE.java" aspectpath="lib.jar"> - <message kind="error" file="ClientCE.java" line="5"/> - </compile> - </ajc-test> - - <ajc-test dir="bugs/interfaceLibrary" - pr="41175" - title="exception clause for aspect-declared class methods - positive binary"> - <compile files="ClassClient.java" aspectpath="libClass.jar"/> - <run class="Client"/> - </ajc-test> - - <ajc-test dir="bugs/interfaceLibrary" - pr="41175" - title="exception clause for aspect-declared class methods - negative binary"> - <compile files="ClassClientCE.java" aspectpath="libClass.jar"> - <message kind="error" file="ClassClientCE.java" line="5"/> - </compile> - </ajc-test> - <ajc-test dir="new/pointcutLibrary" title="libraries-pointcuts compiles" comment="interim test just to show library compiles..."> <compile files="langlib/Pointcuts.java"/> diff --git a/tests/bugs/DeclaredExceptions.java b/tests/bugs/DeclaredExceptions.java new file mode 100644 index 000000000..9baec0c15 --- /dev/null +++ b/tests/bugs/DeclaredExceptions.java @@ -0,0 +1,28 @@ +import java.lang.reflect.Method; +import java.io.*; +import org.aspectj.testing.Tester; + +public class DeclaredExceptions { + public static void main(String[] args) throws Exception { + Class c = C.class; + Method m = c.getDeclaredMethod("m", new Class[0]); + Tester.checkEqual(m.getExceptionTypes().length, 1); + Tester.checkEqual(m.getExceptionTypes()[0], IOException.class); + + c = I.class; + m = c.getDeclaredMethod("m", new Class[0]); + Tester.checkEqual(m.getExceptionTypes().length, 1); + Tester.checkEqual(m.getExceptionTypes()[0], IOException.class); + } +} + +interface I {} + +class C {} + +aspect A { + public void C.m() throws IOException { + } + + public void I.m() throws IOException { } +}
\ No newline at end of file diff --git a/tests/bugs/interfaceLibrary/lib.jar b/tests/bugs/interfaceLibrary/lib.jar Binary files differindex 496514a29..57acb6aad 100644 --- a/tests/bugs/interfaceLibrary/lib.jar +++ b/tests/bugs/interfaceLibrary/lib.jar diff --git a/tests/bugs/interfaceLibrary/libClass.jar b/tests/bugs/interfaceLibrary/libClass.jar Binary files differindex 720435d62..ee68ce1c0 100644 --- a/tests/bugs/interfaceLibrary/libClass.jar +++ b/tests/bugs/interfaceLibrary/libClass.jar diff --git a/tests/new/interfaceLibrary/aspectOnly.jar b/tests/new/interfaceLibrary/aspectOnly.jar Binary files differindex 4aaffb645..eb6505b8c 100644 --- a/tests/new/interfaceLibrary/aspectOnly.jar +++ b/tests/new/interfaceLibrary/aspectOnly.jar diff --git a/tests/new/interfaceLibrary/aspectedInterfaceOnly.jar b/tests/new/interfaceLibrary/aspectedInterfaceOnly.jar Binary files differindex 9cb969b9d..1b8393320 100644 --- a/tests/new/interfaceLibrary/aspectedInterfaceOnly.jar +++ b/tests/new/interfaceLibrary/aspectedInterfaceOnly.jar diff --git a/tests/new/interfaceLibrary/aspectedInterfaceOnlyBinary.jar b/tests/new/interfaceLibrary/aspectedInterfaceOnlyBinary.jar Binary files differindex 9cb969b9d..fe334d076 100644 --- a/tests/new/interfaceLibrary/aspectedInterfaceOnlyBinary.jar +++ b/tests/new/interfaceLibrary/aspectedInterfaceOnlyBinary.jar diff --git a/tests/new/interfaceLibrary/interfaceOnly.jar b/tests/new/interfaceLibrary/interfaceOnly.jar Binary files differindex ede6fc868..15c0fa559 100644 --- a/tests/new/interfaceLibrary/interfaceOnly.jar +++ b/tests/new/interfaceLibrary/interfaceOnly.jar |