@@ -0,0 +1,1001 @@
+package magic.compiler;%0A%0Aimport org.junit.Test;%0Aimport org.objectweb.asm.ClassWriter;%0Aimport org.objectweb.asm.Opcodes;%0A%0Aimport static org.junit.Assert.*;%0Aimport static org.objectweb.asm.ClassWriter.*;%0A%0Apublic class TestASM %7B%0A%0A%09MyClassLoader cl=new MyClassLoader() ;%0A%09%0A%09private static final class MyClassLoader extends ClassLoader %7B%0A%09%09%0A%09%09public Class%3C?%3E define(byte%5B%5D bcode) %7B%0A%09%09%09return defineClass(null,bcode, 0, bcode.length);%0A%09%09%7D%0A%09%7D;%0A%09%0A%09@Test public void testClassCreation() %7B%0A%09%09ClassWriter cw = new ClassWriter(COMPUTE_FRAMES);%0A%09%09cw.visit(52,%0A%09%09%09%09Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER,  // access%0A%09%09%09%09%22magic/Test%22,                            // classname%0A%09%09%09%09null,                                    // signature, not needed unless generic?%0A%09%09%09    %22java/lang/Object%22,                      // superclass%0A%09%09%09    new String%5B%5D %7B%7D                          // interfaces%0A%09%09);%0A%09%09%0A%09%09cw.visitEnd();%0A%09%09%0A%09%09byte%5B%5D bcode=cw.toByteArray();%0A%09%09%0A%09%09Class%3C?%3E klass=cl.define(bcode);%0A%09%09%0A%09%09assertNotNull(klass);%0A%09%7D%0A%7D%0A

Add ASM compiler test