1 /* 2 * 3 * 4 * $Id: AbstractTransformTest.java,v 1.5 2003/12/06 19:46:50 herbyderby Exp $ 5 */ 6 7 package net.sf.cglib.transform; 8 9 import junit.framework.*; 10 import net.sf.cglib.core.CodeGenerationException; 11 /*** 12 * 13 * @author baliuka 14 */ 15 abstract public class AbstractTransformTest extends TestCase{ 16 17 18 /*** Creates a new instance of AbstractTransformTest */ 19 public AbstractTransformTest() { 20 super(null); 21 } 22 23 /*** Creates a new instance of AbstractTransformTest */ 24 public AbstractTransformTest(String s) { 25 super(s); 26 } 27 28 protected abstract ClassTransformerFactory getTransformer()throws Exception; 29 30 public Class transform()throws Exception{ 31 32 33 ClassLoader loader = new TransformingClassLoader( 34 AbstractTransformTest.class.getClassLoader(), 35 new ClassFilter(){ 36 public boolean accept(String name){ 37 38 return ! name.startsWith("java") && 39 ! name.startsWith("junit") && 40 ! name.endsWith("Exclude"); 41 } 42 }, 43 getTransformer() 44 ); 45 46 47 return loader.loadClass(getClass().getName()); 48 49 50 51 } 52 53 54 }

This page was automatically generated by Maven