Assert.assertEquals("Invalid amount of XSDs loaded", 1, collection.getXsdSchemas().length);
}
@Test
public void testInlineComplex() throws Exception {
Resource a = new ClassPathResource("A.xsd", AbstractXsdSchemaTestCase.class);
collection.setXsds(new Resource[]{a});
collection.setInline(true);
collection.afterPropertiesSet();
XsdSchema[] schemas = collection.getXsdSchemas();
Assert.assertEquals("Invalid amount of XSDs loaded", 2, schemas.length);
Assert.assertEquals("Invalid target namespace", "urn:1", schemas[0].getTargetNamespace());
Resource abc = new ClassPathResource("ABC.xsd", AbstractXsdSchemaTestCase.class);
Document expected = documentBuilder.parse(SaxUtils.createInputSource(abc));
DOMResult domResult = new DOMResult();
transformer.transform(schemas[0].getSource(), domResult);
assertXMLEqual("Invalid XSD generated", expected, (Document) domResult.getNode());
Assert.assertEquals("Invalid target namespace", "urn:2", schemas[1].getTargetNamespace());
Resource cd = new ClassPathResource("CD.xsd", AbstractXsdSchemaTestCase.class);
expected = documentBuilder.parse(SaxUtils.createInputSource(cd));
domResult = new DOMResult();
transformer.transform(schemas[1].getSource(), domResult);
assertXMLEqual("Invalid XSD generated", expected, (Document) domResult.getNode());
}