diff options
author | Jose <jose@zeroc.com> | 2014-04-18 21:44:03 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2014-04-18 21:44:03 +0200 |
commit | 8324b6221eaf415dd482453a4bbca872e5a8e1af (patch) | |
tree | b9a7a8783c81d0fcac2c2545bfdb42d8dc53b569 /java/test/Ice/invoke/Client.java | |
parent | Fixed (ICE-4858) - Eliminate IceDB (diff) | |
download | ice-8324b6221eaf415dd482453a4bbca872e5a8e1af.tar.bz2 ice-8324b6221eaf415dd482453a4bbca872e5a8e1af.tar.xz ice-8324b6221eaf415dd482453a4bbca872e5a8e1af.zip |
Fixed (ICE-5507) - Support Java 8 lambda expression
Diffstat (limited to 'java/test/Ice/invoke/Client.java')
-rw-r--r-- | java/test/Ice/invoke/Client.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/java/test/Ice/invoke/Client.java b/java/test/Ice/invoke/Client.java index 887b12c2a59..4cfe8155cae 100644 --- a/java/test/Ice/invoke/Client.java +++ b/java/test/Ice/invoke/Client.java @@ -16,6 +16,33 @@ public class Client extends test.Util.Application public int run(String[] args) { MyClassPrx myClass = AllTests.allTests(communicator(), getWriter()); + + // + // Use reflection to load lambda.AllTests as that is only supported with Java >= 1.8 + // + try + { + Class<?> cls = IceInternal.Util.findClass("test.Ice.invoke.lambda.AllTests", null); + if(cls != null) + { + java.lang.reflect.Method allTests = cls.getDeclaredMethod("allTests", + new Class<?>[]{Ice.Communicator.class, java.io.PrintWriter.class}); + allTests.invoke(null, communicator(), getWriter()); + } + } + catch(java.lang.NoSuchMethodException ex) + { + throw new RuntimeException(ex); + } + catch(java.lang.IllegalAccessException ex) + { + throw new RuntimeException(ex); + } + catch(java.lang.reflect.InvocationTargetException ex) + { + throw new RuntimeException(ex); + } + myClass.shutdown(); return 0; |