WsdlXsdSchema extends AbstractSchemaCollection { private String getTargetNamespace(Schema schema) { return schema.getElement().getAttribute("targetNamespace"); } WsdlXsdSchema();  WsdlXsdSchema(Resource wsdl); @Override Resource loadSchemaResources(); void setWsdl(Resource wsdl);  }
@Test public void testWsdlSchemaImports() throws ParserConfigurationException, IOException, SAXException { WsdlXsdSchema wsdl = new WsdlXsdSchema(new ClassPathResource("com/consol/citrus/validation/SampleServiceWithImports.wsdl")); wsdl.afterPropertiesSet(); Assert.assertEquals(wsdl.getSchemaResources().size(), 2); Assert.assertEquals(wsdl.getTargetNamespace(), "http: Assert.assertNotNull(wsdl.getSource()); }
@Test public void testWsdlSchemaImportsNamespaceDiff() throws ParserConfigurationException, IOException, SAXException { WsdlXsdSchema wsdl = new WsdlXsdSchema(new ClassPathResource("com/consol/citrus/validation/SampleServiceWithImportsNamespaceDiff.wsdl")); wsdl.afterPropertiesSet(); Assert.assertEquals(wsdl.getSchemaResources().size(), 4); Assert.assertEquals(wsdl.getTargetNamespace(), "http: Assert.assertNotNull(wsdl.getSource()); }
@Test public void testWsdlSchemaWsdlImports() throws ParserConfigurationException, IOException, SAXException { WsdlXsdSchema wsdl = new WsdlXsdSchema(new ClassPathResource("com/consol/citrus/validation/SampleServiceWithWsdlImports.wsdl")); wsdl.afterPropertiesSet(); Assert.assertEquals(wsdl.getSchemaResources().size(), 3); Assert.assertEquals(wsdl.getTargetNamespace(), "http: Assert.assertNotNull(wsdl.getSource()); }
@Test public void testWsdlSchemaWsdlImportsOnly() throws ParserConfigurationException, IOException, SAXException { WsdlXsdSchema wsdl = new WsdlXsdSchema(new ClassPathResource("com/consol/citrus/validation/SampleServiceWithWsdlImportsOnly.wsdl")); wsdl.afterPropertiesSet(); Assert.assertEquals(wsdl.getSchemaResources().size(), 2); Assert.assertEquals(wsdl.getTargetNamespace(), "http: Assert.assertNotNull(wsdl.getSource()); }