}
public void testIt() throws Exception {
ClassFieldExtractorFactory factory = new ClassFieldExtractorFactory();
FieldExtractor ex = factory.getClassFieldExtractor( TestBean.class,
"name",
Thread.currentThread().getContextClassLoader() );
assertEquals( 0,
ex.getIndex() );
assertEquals( "michael",
ex.getValue( null,
new TestBean() ) );
ex = factory.getClassFieldExtractor( TestBean.class,
"age",
Thread.currentThread().getContextClassLoader() );
assertEquals( 1,
ex.getIndex() );
assertEquals( 42,
((Number) ex.getValue( null,
new TestBean() )).intValue() );
}