< prev index next >

test/jdk/lambda/vm/InterfaceAccessFlagsTest.java

Print this page




  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     @Test(groups = "vm_prototype")
  75     public void testPrivateMethodCall() {
  76         testMethodCallWithFlag(AccessFlag.PRIVATE);
  77     }

  78 
  79     @Test(groups = "vm_prototype")
  80     public void testStaticMethodCall() {
  81         testMethodCallWithFlag(AccessFlag.PUBLIC, AccessFlag.STATIC);
  82     }
  83 
  84     @Test(groups = "vm_prototype")
  85     public void testPrivateStaticMethodCall() {
  86         testMethodCallWithFlag(AccessFlag.PRIVATE, AccessFlag.STATIC);
  87     }
  88 
  89     // Test other combos?  Protected?
  90 }


  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 }
< prev index next >