Package org.objectweb.asm.util

Examples of org.objectweb.asm.util.CheckClassAdapter


*/
public class AddTimerAdapterTest extends AbstractTestCase {

  public void test() throws Exception {
    ClassWriter cw = new ClassWriter(0);
    CheckClassAdapter ca = new CheckClassAdapter(cw);
    ClassVisitor cv = getClassAdapter(ca);
    generateBasicClass(cv);
    checkClass(defineClass("C", cw.toByteArray()));
  }
View Full Code Here


  private Object[] args;

  public void test() throws Throwable {
    ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
    CheckClassAdapter ca = new CheckClassAdapter(cw);
    ProxyGenerator pg = new ProxyGenerator(Comparable.class);
    pg.generate(Type.getType("LC;"), ca);

    InvocationHandler handler = new InvocationHandler() {
      public Object invoke(Object proxy, Method method, Object[] args)
View Full Code Here

    fields.put("f5", Type.getType("Ljava/lang/String;"));
    fields.put("f6", Type.getType("[I"));
    BeanGenerator3 bg = new BeanGenerator3("MyBean", fields);

    ClassWriter cw = new ClassWriter(0);
    CheckClassAdapter ca = new CheckClassAdapter(cw);
    bg.generate(ca);

    Class c = defineClass("MyBean", cw.toByteArray());
    checkClass(c);
  }
View Full Code Here

*/
public class AddMethodTransformerTest extends AddMethodAdapterTest {

  public void test() throws Exception {
    ClassWriter cw = new ClassWriter(0);
    CheckClassAdapter ca = new CheckClassAdapter(cw);
    ClassNode cn = generateBasicClass();
    new AddMethodTransformer(null).transform(cn);
    cn.accept(ca);
    checkClass(defineClass("C", cw.toByteArray()));
  }
View Full Code Here

*/
public class RemoveFieldTransformerTest extends RemoveFieldAdapterTest {

  public void test() throws Exception {
    ClassWriter cw = new ClassWriter(0);
    CheckClassAdapter ca = new CheckClassAdapter(cw);
    ClassNode cn = generateBasicClass();
    new RemoveFieldTransformer(null, "f").transform(cn);
    cn.accept(ca);
    checkClass(defineClass("C", cw.toByteArray()));
  }
View Full Code Here

*/
public class AddFieldTransformerTest extends AddFieldAdapterTest {

  public void test() throws Exception {
    ClassWriter cw = new ClassWriter(0);
    CheckClassAdapter ca = new CheckClassAdapter(cw);
    ClassNode cn = generateBasicClass();
    new AddFieldTransformer(null, ACC_PUBLIC, "field", "I")
        .transform(cn);
    cn.accept(ca);
    checkClass(defineClass("C", cw.toByteArray()));
View Full Code Here

public class RemoveMethodTransformerTest extends
    RemoveMethodAdapterTest {

  public void test() throws Exception {
    ClassWriter cw = new ClassWriter(0);
    CheckClassAdapter ca = new CheckClassAdapter(cw);
    ClassNode cn = generateBasicClass();
    new RemoveMethodTransformer(null, "m", "()V").transform(cn);
    cn.accept(ca);
    checkClass(defineClass("C", cw.toByteArray()));
  }
View Full Code Here

*/
public class AddFieldAdapterTest extends AbstractTestCase {

  public void test() throws Exception {
    ClassWriter cw = new ClassWriter(0);
    CheckClassAdapter ca = new CheckClassAdapter(cw);
    AddFieldAdapter af = new AddFieldAdapter(ca, ACC_PUBLIC, "field",
        "I");
    generateBasicClass(af);
    checkClass(defineClass("C", cw.toByteArray()));
  }
View Full Code Here

*/
public class RemoveFieldAdapterTest extends AbstractTestCase {

  public void test() throws Exception {
    ClassWriter cw = new ClassWriter(0);
    CheckClassAdapter ca = new CheckClassAdapter(cw);
    RemoveFieldAdapter af = new RemoveFieldAdapter(ca, "f");
    generateBasicClass(af);
    checkClass(defineClass("C", cw.toByteArray()));
  }
View Full Code Here

*/
public class RemoveDebugAdapterTest extends AbstractTestCase {

  public void test() throws Exception {
    ClassWriter cw = new ClassWriter(0);
    CheckClassAdapter ca = new CheckClassAdapter(cw);
    RemoveDebugAdapter rd = new RemoveDebugAdapter(ca);
    generateBasicClass(rd);
    defineClass("C", cw.toByteArray());
  }
View Full Code Here

TOP

Related Classes of org.objectweb.asm.util.CheckClassAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.