public void testCompile() throws Exception {
Class groovyClass = loader.parseClass(new File("src/test/org/codehaus/groovy/classgen/Main.groovy"));
System.out.println("Invoking main...");
GroovyObject object = (GroovyObject) groovyClass.newInstance();
assertTrue(object != null);
MetaClass metaClass = object.getMetaClass();
System.out.println("Metaclass: " + metaClass);
Class type = object.getClass();
System.out.println("Type: " + type);
// invoke via metaclass
metaClass.invokeMethod(object, "main", null);
// invoke directly
object.invokeMethod("main", null);
}