Exemplo n.º 1
0
 public Method getReflectMethod(String method, Class... types) {
   assertNotNull("dynamicCompiler not ready", dynamicCompiler);
   try {
     return dynamicCompiler.getMethod(method, types);
   } catch (Exception e) {
     e.printStackTrace();
     fail(e.getMessage());
   }
   return null;
 }
Exemplo n.º 2
0
 void compile(ClassNode cls) {
   if (!compile) {
     return;
   }
   try {
     dynamicCompiler = new DynamicCompiler(cls);
     boolean result = dynamicCompiler.compile();
     assertTrue("Compilation failed", result);
     System.out.println("Compilation: PASSED");
   } catch (Exception e) {
     e.printStackTrace();
     fail(e.getMessage());
   }
 }
Exemplo n.º 3
0
 public Object invoke(Method mth, Object... args) throws Exception {
   assertNotNull("dynamicCompiler not ready", dynamicCompiler);
   assertNotNull("unknown method", mth);
   return dynamicCompiler.invoke(mth, args);
 }