BindingElement binding = hold.getBinding();
ArrayList childs = binding.topChildren();
assertEquals("child count", 5, childs.size());
Object child = childs.get(1);
assertTrue("child type", child instanceof MappingElement);
MappingElementBase mapping = (MappingElementBase)child;
assertTrue("expected abstract mapping first", mapping.isAbstract());
assertEquals("mapped class", mapping.getClassName(), "org.jibx.binding.generator.DataClass1");
QName qname = mapping.getTypeQName();
assertNotNull("type name", qname);
assertEquals("specified type name", "class1", qname.getName());
assertEquals("specified type namespace", "http://www.jibx.org/test", qname.getUri());
ArrayList mapchilds = mapping.children();
assertEquals("mapped items", 3, mapchilds.size());
child = mapchilds.get(0);
assertTrue("child type", child instanceof ValueElement);
ValueElement value = (ValueElement)child;
assertEquals("get method", "getString", value.getGetName());
assertEquals("set method", "setString", value.getSetName());
assertEquals("value style", "element", value.getStyleName());
assertEquals("element name", "string", value.getName());
child = mapchilds.get(1);
assertTrue("child type", child instanceof StructureElement);
StructureElement struct = (StructureElement)child;
assertEquals("get method", "getLinked", struct.getGetName());
assertEquals("set method", "setLinked", struct.getSetName());
assertEquals("element name", "linked", struct.getName());
child = mapchilds.get(2);
assertTrue("child type", child instanceof ValueElement);
value = (ValueElement)child;
assertEquals("get method", "getInt", value.getGetName());
assertEquals("set method", "setInt", value.getSetName());
assertEquals("value style", "attribute", value.getStyleName());
assertEquals("element name", "int", value.getName());
child = childs.get(2);
assertTrue("child type", child instanceof MappingElement);
mapping = (MappingElementBase)child;
assertFalse("expected concrete mapping second", mapping.isAbstract());
assertEquals("mapped class", mapping.getClassName(), "org.jibx.binding.generator.DataClass1");
assertEquals("specified element name", "class1", mapping.getName());
assertEquals("mapped items", 1, mapping.children().size());
child = mapping.children().get(0);
assertTrue("child type", child instanceof StructureElement);
struct = (StructureElement)child;
assertEquals("mapping reference structure content", 0, struct.children().size());
qname = struct.getMapAsQName();
assertNotNull("type name", qname);