* and an array of a custom type
* @throws Exception
*/
public void testCustomTypesArraySchema() throws Exception
{
SchemaUtils utils = SchemaUtils.getInstance();
String typeNS = "http://org.jboss/types";
String arrTypeNS = "http://org.jboss/types/arrays/org/jboss/test/ws/tools/jbws_161/custom";
Map map = new HashMap();
map.put(typeNS,getResourceURL("/tools/wsdlfixture/customtype/CustomTypeObj.xsd"));
map.put(arrTypeNS,getResourceURL("/tools/wsdlfixture/customtype/CustomTypeArrays.xsd"));
XSModel xsmodel = new JavaToXSD().parseSchema(map);
assertNotNull("XSModel is null?", xsmodel);
XSNamedMap xsnamedmap = getXSNamedMap(xsmodel, typeNS);
assertNotNull("XSNamedMap is null?", xsnamedmap);
assertEquals(1, xsnamedmap.getLength());
XSObject xobj = xsnamedmap.item(0);
assertEquals("HelloObj", xobj.getName());
assertTrue("HelloObj is a complex type?",xobj instanceof XSComplexTypeDefinition);
xsnamedmap = getXSNamedMap(xsmodel, arrTypeNS);
assertEquals(1, xsnamedmap.getLength());
xobj = xsnamedmap.item(0);
assertEquals("HelloObjArray", xobj.getName());
assertTrue("HelloObjArray is a complex type?",xobj instanceof XSComplexTypeDefinition);
XSComplexTypeDefinition complexType = (XSComplexTypeDefinition) xobj;
XSModelGroupImpl sequence = (XSModelGroupImpl) complexType.getParticle().getTerm();
XSElementDecl valueElement = (XSElementDecl) ((XSParticleDecl) sequence.getParticles().item(0)).getTerm();
String name = valueElement.getTypeDefinition().getName();
assertEquals("HelloObj", name);
//Test the case when the schema files are parsed one by one
XSModel newxsmodel = utils.parseSchema(getResourceFile("tools/wsdlfixture/customtype/CustomTypeObj.xsd").getAbsolutePath());
assertNotNull("XSModel is null?", newxsmodel);
xsnamedmap = getXSNamedMap(newxsmodel, typeNS);
assertNotNull("XSNamedMap is null?", xsnamedmap);
assertEquals(1, xsnamedmap.getLength());
xobj = xsnamedmap.item(0);
assertEquals("HelloObj", xobj.getName());
assertTrue("HelloObj is a complex type?",xobj instanceof XSComplexTypeDefinition);
newxsmodel = utils.parseSchema(getResourceFile("tools/wsdlfixture/customtype/CustomTypeArrays.xsd").getAbsolutePath());
assertNotNull("XSModel is null?", newxsmodel);
xsnamedmap = getXSNamedMap(newxsmodel, arrTypeNS);
assertNotNull("XSNamedMap is null?", xsnamedmap);
assertEquals(1, xsnamedmap.getLength());
xobj = xsnamedmap.item(0);