54 // Turns I from a class into an interface when loading
55
56 ClassLoader cl = compiler.compile(C, I);
57 try {
58 java.lang.Class<?> C_class =
59 java.lang.Class.forName("C", true, cl);
60 assertNotNull(C_class);
61 java.lang.reflect.Method m = C_class.getMethod("foo");
62 assertNotNull(m);
63 Integer res = (Integer)m.invoke(null);
64 assertEquals(res.intValue(), 99);
65 } catch (java.lang.reflect.InvocationTargetException e) {
66 fail("Unexpected exception: " + e.getCause());
67 } catch (Throwable e) {
68 fail("Unexpected exception: " + e);
69 } finally {
70 compiler.cleanup();
71 }
72 }
73
74 /* excluded: 8187655
75 @Test(groups = "vm_prototype")
76 public void testPrivateMethodCall() {
77 testMethodCallWithFlag(AccessFlag.PRIVATE);
78 }
79 */
80
81 @Test(groups = "vm_prototype")
82 public void testStaticMethodCall() {
83 testMethodCallWithFlag(AccessFlag.PUBLIC, AccessFlag.STATIC);
84 }
85
86 @Test(groups = "vm_prototype")
87 public void testPrivateStaticMethodCall() {
88 testMethodCallWithFlag(AccessFlag.PRIVATE, AccessFlag.STATIC);
89 }
90
91 // Test other combos? Protected?
92 }
|
54 // Turns I from a class into an interface when loading
55
56 ClassLoader cl = compiler.compile(C, I);
57 try {
58 java.lang.Class<?> C_class =
59 java.lang.Class.forName("C", true, cl);
60 assertNotNull(C_class);
61 java.lang.reflect.Method m = C_class.getMethod("foo");
62 assertNotNull(m);
63 Integer res = (Integer)m.invoke(null);
64 assertEquals(res.intValue(), 99);
65 } catch (java.lang.reflect.InvocationTargetException e) {
66 fail("Unexpected exception: " + e.getCause());
67 } catch (Throwable e) {
68 fail("Unexpected exception: " + e);
69 } finally {
70 compiler.cleanup();
71 }
72 }
73
74 /* excluded: 8187655 */
75 @Test(enabled=false, groups = "vm_prototype")
76 public void testPrivateMethodCall() {
77 testMethodCallWithFlag(AccessFlag.PRIVATE);
78 }
79
80 @Test(groups = "vm_prototype")
81 public void testStaticMethodCall() {
82 testMethodCallWithFlag(AccessFlag.PUBLIC, AccessFlag.STATIC);
83 }
84
85 @Test(groups = "vm_prototype")
86 public void testPrivateStaticMethodCall() {
87 testMethodCallWithFlag(AccessFlag.PRIVATE, AccessFlag.STATIC);
88 }
89
90 // Test other combos? Protected?
91 }
|