use of com.oracle.truffle.api.library.ReflectionLibrary in project graal by oracle.
the class ReflectionTest method testReflectionDefault.
@Test
public void testReflectionDefault() throws Exception {
Object receiver = new Object();
ReflectionLibrary reflection = createLibrary(ReflectionLibrary.class, receiver);
Message primitive = Message.resolve(ReflectionTestLibrary.class, "primitive");
Message voidReturn = Message.resolve(ReflectionTestLibrary.class, "voidReturn");
Assert.assertEquals(42, reflection.send(receiver, primitive, 12));
try {
reflection.send(receiver, voidReturn);
Assert.fail();
} catch (AbstractMethodError e) {
}
}
Aggregations