@@ -0,0 +1,1275 @@
+from jawa.cf import ClassFile%0Afrom jawa.util.classloader import ClassLoader%0Afrom jawa.transforms.simple_swap import simple_swap%0Afrom jawa.assemble import assemble%0A%0A%0Adef test_load_from_class():%0A    %22%22%22Ensure we can add ClassFile's directly to the ClassLoader.%22%22%22%0A    cl = ClassLoader()%0A%0A    cf = ClassFile.create('TestClass')%0A    cl.update(cf)%0A%0A    assert cl.load('TestClass') is cf%0A%0A%0Adef test_default_bytecode_transforms():%0A    cl = ClassLoader(bytecode_transforms=%5Bsimple_swap%5D)%0A%0A    cf = ClassFile.create('TestClass')%0A    cl.update(cf)%0A%0A    test_method = cf.methods.create('test', '(V)V;', code=True)%0A    test_method.code.max_stack = 2%0A    test_method.code.max_locals = 0%0A%0A    test_method.code.assemble(assemble(%5B%0A        ('iconst_0',),%0A        ('pop',),%0A        ('return',)%0A    %5D))%0A%0A    # Load from the ClassLoader to bind to it.%0A    cf = cl.load('TestClass')%0A%0A    # Ensure the defaults apply.%0A    ins_iter = test_method.code.disassemble()%0A    ins = next(ins_iter)%0A    assert ins.mnemonic == 'bipush'%0A    assert len(ins.operands) == 1%0A    assert ins.operands%5B0%5D.value == 0%0A%0A    # Ensure we can override the default.%0A    ins_iter = test_method.code.disassemble(transforms=%5B%5D)%0A    ins = next(ins_iter)%0A    assert ins.mnemonic == 'iconst_0'%0A    assert len(ins.operands) == 0%0A

Add a test for ClassLoader default transforms and default transform overriding.