1 import java
.lang
.reflect
.Method
;
3 // Test return values of Method.invoke.
4 public class InvokeReturn
{
5 public boolean bTrue() {
9 public boolean bFalse() {
37 public static void main(String
[] args
) {
39 Object o
= new InvokeReturn();
42 // test boolean result
43 m
= o
.getClass().getDeclaredMethod("bTrue", new Class
[0]);
44 System
.out
.println(m
.invoke(o
, new Object
[0]));
46 m
= o
.getClass().getDeclaredMethod("bFalse", new Class
[0]);
47 System
.out
.println(m
.invoke(o
, new Object
[0]));
50 m
= o
.getClass().getDeclaredMethod("cc", new Class
[0]);
51 System
.out
.println(m
.invoke(o
, new Object
[0]));
54 m
= o
.getClass().getDeclaredMethod("s5", new Class
[0]);
55 System
.out
.println(m
.invoke(o
, new Object
[0]));
58 m
= o
.getClass().getDeclaredMethod("i6", new Class
[0]);
59 System
.out
.println(m
.invoke(o
, new Object
[0]));
62 m
= o
.getClass().getDeclaredMethod("l7", new Class
[0]);
63 System
.out
.println(m
.invoke(o
, new Object
[0]));
66 m
= o
.getClass().getDeclaredMethod("f8", new Class
[0]);
67 System
.out
.println(m
.invoke(o
, new Object
[0]));
70 m
= o
.getClass().getDeclaredMethod("d9", new Class
[0]);
71 System
.out
.println(m
.invoke(o
, new Object
[0]));
72 } catch (UnsupportedOperationException e
) {
73 // We get this on targets which don't support reflection (no
74 // libffi port yet). We might as well fake PASSes.
75 System
.out
.println("true\nfalse\nc\n5\n6\n7\n8.0\n9.0");
76 } catch (Throwable t
) {