use of java.lang.invoke.VolatileCallSite in project openj9 by eclipse.
the class VolatileCallSiteTest method testType_VolatileCallSite.
/**
* Test for VolatileCallSite.type()
* @throws Throwable
*/
@Test(groups = { "level.extended" })
public void testType_VolatileCallSite() throws Throwable {
MethodType mt = MethodType.methodType(String.class);
MethodHandle mh = MethodHandles.lookup().findStatic(SamePackageExample.class, "returnOne", mt);
VolatileCallSite vcs = new VolatileCallSite(mh);
AssertJUnit.assertEquals(mt, vcs.type());
}
use of java.lang.invoke.VolatileCallSite in project openj9 by eclipse.
the class VolatileCallSiteTest method testIllegalState_dynamicInvoker_VolatileCallSite.
/**
* Test for validating default MethodHandle behavior of VolatileCallSite
* using VolatileCallSite.dynamicInvoker.invoke()
* @throws Throwable
*/
@Test(groups = { "level.extended" })
public void testIllegalState_dynamicInvoker_VolatileCallSite() throws Throwable {
MethodType mt = MethodType.methodType(void.class);
VolatileCallSite vcs = new VolatileCallSite(mt);
boolean iseHit = false;
try {
vcs.dynamicInvoker().invoke();
} catch (IllegalStateException e) {
iseHit = true;
}
AssertJUnit.assertTrue(iseHit);
}
Aggregations