assertEquals("Expected no attributes", 0, attributeDescriptor.length);
assertEquals("Expected two elements", 2, children.length);
}
public void testClassNormalizer() throws Exception {
XMLIntrospector introspector = new XMLIntrospector();
introspector.getConfiguration().setClassNormalizer( new ClassNormalizer() {
public Class normalize(Class clazz) {
if (IFace.class.isAssignableFrom( clazz )) {
return IFace.class;
}
return super.normalize( clazz );
}
});
FaceImpl face = new FaceImpl();
XMLBeanInfo info = introspector.introspect( face );
ElementDescriptor elementDescriptor = info.getElementDescriptor();
assertEquals("Expected only itself", 1, elementDescriptor.getElementDescriptors().length);
AttributeDescriptor[] attributeDescriptor = elementDescriptor.getAttributeDescriptors();
ElementDescriptor[] children = elementDescriptor.getElementDescriptors();