XSDefinition definition1 = (XSDefinition)documentProcessor.read(null, URI.create("xsd/name.xsd"), url1);
Assert.assertNull(definition1.getSchema());
Assert.assertEquals("http://greeting", definition1.getNamespace());
resolver.addModel(definition);
XSDefinition resolved = resolver.resolveModel(XSDefinition.class, definition);
XmlSchemaObjectCollection collection = resolved.getSchema().getIncludes();
Assert.assertTrue(collection.getCount() == 1);
XmlSchemaType type =
((XmlSchemaInclude)collection.getItem(0)).getSchema().getTypeByName(new QName("http://greeting", "Name"));
Assert.assertNotNull(type);
resolver.addModel(definition1);
resolved = resolver.resolveModel(XSDefinition.class, definition);
collection = resolved.getSchema().getIncludes();
Assert.assertTrue(collection.getCount() == 2);
XmlSchemaType type1 =
((XmlSchemaInclude)collection.getItem(0)).getSchema().getTypeByName(new QName("http://greeting", "Name"));
XmlSchemaType type2 =
((XmlSchemaInclude)collection.getItem(1)).getSchema().getTypeByName(new QName("http://greeting", "Name"));
Assert.assertTrue(type1 != null || type2 != null);
}