m_resultWriter.toString());
}
public void testInheritance1() throws Exception
{
SchemaUniverse universe = new SchemaUniverse();
XSDSchemaExporter xsdExporter = new XSDSchemaExporter(universe);
MessageSchemaConverter schemaExporter = new MessageSchemaConverter(universe);
Message msg = m_context.getMetadata().getMessage("XML_Inherit_Schema_Reference");
Schema schema = schemaExporter.add(msg).getSchema();
xsdExporter.exportSchema(schema, m_resultWriter);
assertEquals(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<schema xmlns=\"http://www.w3.org/2001/XMLSchema\"" +
" xmlns:is1=\"urn:com.nexjsystems:ns:test:inherit:schema1\"" +
" xmlns:is3=\"urn:com.nexjsystems:ns:test:inherit:schema3\"" +
" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"" +
" targetNamespace=\"urn:com.nexjsystems:ns:test:inherit:schema1\"" +
">" +
"<import namespace=\"urn:com.nexjsystems:ns:test:inherit:schema3\"/>" +
"<complexType name=\"Schema1Type\">" +
"<sequence>" +
"<element name=\"a\" minOccurs=\"0\" type=\"xsd:string\"/>" +
"<element name=\"x\" minOccurs=\"0\" type=\"xsd:string\"/>" +
"</sequence>" +
"</complexType>" +
"<complexType name=\"Schema2Type\" block=\"#all\">" +
"<complexContent>" +
"<extension base=\"is1:Schema1Type\">" +
"<sequence>" +
"<element name=\"b\" minOccurs=\"0\" type=\"xsd:string\"/>" +
"</sequence>" +
"</extension>" +
"</complexContent>" +
"</complexType>" +
"<complexType name=\"Schema4Type\">" +
"<sequence>" +
"<element name=\"a\" minOccurs=\"0\" type=\"xsd:int\"/>" +
"<element name=\"x\" minOccurs=\"0\" type=\"xsd:string\"/>" +
"<element name=\"extra\" type=\"xsd:string\"/>" +
"</sequence>" +
"</complexType>" +
"<complexType name=\"XML_Inherit_Schema_Reference\">" +
"<sequence>" +
"<element name=\"schema1\" minOccurs=\"0\" form=\"qualified\"/>" +
"<element name=\"schema2\" minOccurs=\"0\" form=\"qualified\" type=\"is1:Schema2Type\"/>" +
"<element name=\"schema3\" minOccurs=\"0\" form=\"qualified\" type=\"is3:Schema3Type\"/>" +
"<element name=\"schema4\" minOccurs=\"0\" form=\"qualified\" type=\"is1:Schema4Type\"/>" +
"</sequence>" +
"</complexType>" +
"<element name=\"references\" type=\"is1:XML_Inherit_Schema_Reference\"/>" +
"</schema>",
m_resultWriter.toString());
m_resultWriter = new StringWriter();
schema = universe.findSchema("is3");
xsdExporter.exportSchema(schema, m_resultWriter);
assertEquals(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<schema xmlns=\"http://www.w3.org/2001/XMLSchema\"" +