" </element>" +
" </class>" +
" </betwixt-config>";
public void testRegisterMultiMapping() throws Exception {
XMLIntrospector xmlIntrospector = new XMLIntrospector();
Class[] mapped = xmlIntrospector.register(new InputSource(new StringReader(MAPPING)));
assertEquals("Mapped classes", 3, mapped.length);
XMLBeanInfo beanInfo = xmlIntrospector.introspect(AddressBean.class);
assertNotNull("Bean info mapping", beanInfo);
ElementDescriptor descriptor = beanInfo.getElementDescriptor();
assertEquals("Root element name", "not-address", descriptor.getLocalName());
ElementDescriptor[] childDescriptors = descriptor.getElementDescriptors();
assertEquals("4 child elements", 4, childDescriptors.length);
assertEquals("First element", "not-street", childDescriptors[0].getLocalName());
assertEquals("Second element", "not-city", childDescriptors[1].getLocalName());
assertEquals("Third element", "not-code", childDescriptors[2].getLocalName());
assertEquals("Forth element", "not-country", childDescriptors[3].getLocalName());
beanInfo = xmlIntrospector.introspect(SimpleTestBean.class);
assertNotNull("Bean info mapping", beanInfo);
descriptor = beanInfo.getElementDescriptor();
assertEquals("Root element name", "jelly", descriptor.getLocalName());
childDescriptors = descriptor.getElementDescriptors();
assertEquals("Child elements", 2, childDescriptors.length);