public abstract class MyTestCase extends TestCase {
public ClassDef makeClassDef() {
return makeClass() ;
}
public ClassDef makeClass() {
ClassDef cd = new ClassDef(ClassDefType.DEFAULT,null,new TypeName("TestClass"),TypeName.OBJECT) ;
{
MethodDef md = new MethodDef(TypeName.VOID,"<init>") ;
MethodRef mref = new MethodRef(
cd.superClass,TypeName.VOID,"<init>") ;
md = md.addInstructions(
new Load(new Var(0,new TypeName("TestClass"))),
new InvokeSpecial(mref),
new Return(TypeCode.VOID)
) ;
cd = cd.addMethod(md) ;
}