import org.drools.util.asm.TestInterfaceImpl;
public class BaseClassFieldExtractorFactoryTest extends TestCase {
public void testIt() throws Exception {
FieldExtractor ex = ClassFieldExtractorFactory.getClassFieldExtractor( TestBean.class,
"name",
Thread.currentThread().getContextClassLoader() );
assertEquals( 0,
ex.getIndex() );
assertEquals( "michael",
ex.getValue( null, new TestBean() ) );
ex = ClassFieldExtractorFactory.getClassFieldExtractor( TestBean.class,
"age",
Thread.currentThread().getContextClassLoader() );
assertEquals( 1,
ex.getIndex() );
assertEquals( 42,
((Number) ex.getValue( null, new TestBean() )).intValue() );
}