diff options
author | Andrew Haley <aph@redhat.com> | 2007-04-03 10:59:45 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2007-04-03 10:59:45 +0000 |
commit | 83ff0d10edd6af76343e00f4cd8cdb78c1c0b640 (patch) | |
tree | 70b7291d35bb92a13590da770eea90ce2db498ad /libjava | |
parent | 81e864cb18e542505c44ec7837a13d39a2794dd5 (diff) | |
download | gcc-83ff0d10edd6af76343e00f4cd8cdb78c1c0b640.zip gcc-83ff0d10edd6af76343e00f4cd8cdb78c1c0b640.tar.gz gcc-83ff0d10edd6af76343e00f4cd8cdb78c1c0b640.tar.bz2 |
ProxyTest.java: New test.
2007-04-03 Andrew Haley <aph@redhat.com>
* testsuite/libjava.lang/ProxyTest.java: New test.
From-SVN: r123466
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 4 | ||||
-rw-r--r-- | libjava/testsuite/libjava.lang/ProxyTest.jar | bin | 0 -> 1919 bytes | |||
-rw-r--r-- | libjava/testsuite/libjava.lang/ProxyTest.java | 37 | ||||
-rw-r--r-- | libjava/testsuite/libjava.lang/ProxyTest.out | 4 |
4 files changed, 45 insertions, 0 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 9602e29..09b7e07 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,7 @@ +2007-04-03 Andrew Haley <aph@redhat.com> + + * testsuite/libjava.lang/ProxyTest.java: New test. + 2007-04-02 Tom Tromey <tromey@redhat.com> http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=205157 diff --git a/libjava/testsuite/libjava.lang/ProxyTest.jar b/libjava/testsuite/libjava.lang/ProxyTest.jar Binary files differnew file mode 100644 index 0000000..509054b9 --- /dev/null +++ b/libjava/testsuite/libjava.lang/ProxyTest.jar diff --git a/libjava/testsuite/libjava.lang/ProxyTest.java b/libjava/testsuite/libjava.lang/ProxyTest.java new file mode 100644 index 0000000..46689b4 --- /dev/null +++ b/libjava/testsuite/libjava.lang/ProxyTest.java @@ -0,0 +1,37 @@ +import java.lang.reflect.*; + +interface Twas +{ + Object brillig(); +} + +interface Slithy +{ + void toves(int gyre); +} + +public class ProxyTest +{ + static class MyInvocationHandler implements InvocationHandler + { + public Object invoke(Object proxy, Method method, Object[] args) + { + System.out.println (method.getDeclaringClass()); + System.out.println (args == null + ? args + : args.getClass().getName()); + return this; + } + } + + public static void main(String[] argv) + throws InstantiationException, IllegalAccessException + { + Twas wabe + = (Twas)Proxy.newProxyInstance(ProxyTest.class.getClassLoader(), + new Class[] { Slithy.class, Twas.class }, + new MyInvocationHandler()); + wabe.brillig(); + ((Slithy)wabe).toves(2); + } +} diff --git a/libjava/testsuite/libjava.lang/ProxyTest.out b/libjava/testsuite/libjava.lang/ProxyTest.out new file mode 100644 index 0000000..e81ce60 --- /dev/null +++ b/libjava/testsuite/libjava.lang/ProxyTest.out @@ -0,0 +1,4 @@ +interface Twas +null +interface Slithy +[Ljava.lang.Object; |