Best Citrus code snippet using com.consol.citrus.xml.schema.XsdSchemaCollection
Source:SchemaRepositoryParserTest.java
...20import com.consol.citrus.xml.XsdSchemaRepository;21import com.consol.citrus.xml.schema.RootQNameSchemaMappingStrategy;22import com.consol.citrus.xml.schema.TargetNamespaceSchemaMappingStrategy;23import com.consol.citrus.xml.schema.WsdlXsdSchema;24import com.consol.citrus.xml.schema.XsdSchemaCollection;25import org.springframework.xml.xsd.SimpleXsdSchema;26import org.testng.Assert;27import org.testng.annotations.Test;28import java.util.Map;29/**30 * @author Christoph Deppisch31 */32public class SchemaRepositoryParserTest extends AbstractBeanDefinitionParserTest {33 @Test34 public void testSchemaRepositoryParser() {35 Map<String, XsdSchemaRepository> schemaRepositories = beanDefinitionContext.getBeansOfType(XsdSchemaRepository.class);36 Assert.assertEquals(schemaRepositories.size(), 4);37 // 1st schema repository38 XsdSchemaRepository schemaRepository = schemaRepositories.get("schemaRepository1");39 Assert.assertEquals(schemaRepository.getSchemaMappingStrategy().getClass(), TargetNamespaceSchemaMappingStrategy.class);40 Assert.assertNotNull(schemaRepository.getSchemas());41 Assert.assertEquals(schemaRepository.getSchemas().size(), 5);42 Assert.assertEquals(schemaRepository.getSchemas().get(0).getClass(), SimpleXsdSchema.class);43 Assert.assertEquals(schemaRepository.getSchemas().get(1).getClass(), WsdlXsdSchema.class);44 Assert.assertEquals(schemaRepository.getSchemas().get(2).getClass(), SimpleXsdSchema.class);45 Assert.assertEquals(schemaRepository.getSchemas().get(3).getClass(), WsdlXsdSchema.class);46 Assert.assertEquals(schemaRepository.getSchemas().get(4).getClass(), XsdSchemaCollection.class);47 Assert.assertNotNull(schemaRepository.getLocations());48 Assert.assertEquals(schemaRepository.getLocations().size(), 0);49 // 2nd schema repository50 schemaRepository = schemaRepositories.get("schemaRepository2");51 Assert.assertNotNull(schemaRepository.getSchemas());52 Assert.assertEquals(schemaRepository.getSchemas().size(), 15);53 Assert.assertNotNull(schemaRepository.getLocations());54 Assert.assertEquals(schemaRepository.getLocations().size(), 1);55 Assert.assertEquals(schemaRepository.getLocations().get(0), "classpath:com/consol/citrus/validation/*");56 // 3rd schema repository57 schemaRepository = schemaRepositories.get("schemaRepository3");58 Assert.assertEquals(schemaRepository.getSchemaMappingStrategy().getClass(), RootQNameSchemaMappingStrategy.class);59 Assert.assertTrue(beanDefinitionContext.containsBean("schema1"));60 Assert.assertTrue(beanDefinitionContext.containsBean("schema2"));...
Source:SchemaCollectionParserTest.java
...14 * limitations under the License.15 */16package com.consol.citrus.config.xml;17import com.consol.citrus.testng.AbstractBeanDefinitionParserTest;18import com.consol.citrus.xml.schema.XsdSchemaCollection;19import org.testng.Assert;20import org.testng.annotations.Test;21import java.util.Map;22/**23 * @author Christoph Deppisch24 */25public class SchemaCollectionParserTest extends AbstractBeanDefinitionParserTest {26 @Test27 public void testSchemaRepositoryParser() {28 Map<String, XsdSchemaCollection> schemaCollections = beanDefinitionContext.getBeansOfType(XsdSchemaCollection.class);29 30 Assert.assertEquals(schemaCollections.size(), 1);31 32 // 1st schema repository33 XsdSchemaCollection schema = schemaCollections.get("schemaCollection1");34 Assert.assertNotNull(schema.getSchemas());35 Assert.assertEquals(schema.getSchemas().size(), 2);36 Assert.assertEquals(schema.getSchemas().get(0), "classpath:com/consol/citrus/validation/test.xsd");37 Assert.assertEquals(schema.getSchemas().get(1), "classpath:com/consol/citrus/validation/sample.xsd");38 }39}...
XsdSchemaCollection
Using AI Code Generation
1package com.consol.citrus.xml.schema;2import com.consol.citrus.context.TestContext;3import com.consol.citrus.exceptions.CitrusRuntimeException;4import com.consol.citrus.util.FileUtils;5import com.consol.citrus.xml.XsdSchemaRepository;6import org.slf4j.Logger;7import org.slf4j.LoggerFactory;8import org.springframework.core.io.Resource;9import org.springframework.core.io.support.PathMatchingResourcePatternResolver;10import org.springframework.core.io.support.ResourcePatternResolver;11import org.springframework.util.StringUtils;12import org.xml.sax.SAXException;13import javax.xml.XMLConstants;14import javax.xml.transform.Source;15import javax.xml.transform.stream.StreamSource;16import javax.xml.validation.Schema;17import javax.xml.validation.SchemaFactory;18import java.io.IOException;19import java.util.*;20public class XsdSchemaRepository implements SchemaRepository {21 private static Logger log = LoggerFactory.getLogger(XsdSchemaRepository.class);22 private SchemaFactory schemaFactory;23 private Map<String, Schema> schemaCache = new HashMap<>();24 private String basePackage;25 private String schemaFileExtension = "xsd";26 public XsdSchemaRepository() {27 this.schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);28 }29 public XsdSchemaRepository(String basePackage) {30 this();31 this.basePackage = basePackage;32 }33 public Schema getSchema(String schemaName, TestContext context) {34 if (schemaCache.containsKey(schemaName)) {35 return schemaCache.get(schemaName);36 }37 if (StringUtils.hasText(basePackage)) {38 try {39 ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();40 Resource[] resources = resolver.getResources("classpath*:" + basePackage.replace('.', '/') + "/**/*." + schemaFileExtension);41 List<Source> schemaSources = new ArrayList<>();42 for (Resource resource : resources) {43 schemaSources.add(new StreamSource(resource.getInputStream()));44 }45 Schema schema = schemaFactory.newSchema(schema
XsdSchemaCollection
Using AI Code Generation
1import com.consol.citrus.xml.schema.XsdSchemaCollection;2import org.springframework.core.io.ClassPathResource;3import org.springframework.core.io.Resource;4import java.util.ArrayList;5import java.util.List;6public class XsdSchemaCollectionExample {7 public static void main(String[] args) {8 List<Resource> schemaResources = new ArrayList<>();9 schemaResources.add(new ClassPathResource("schema1.xsd"));10 schemaResources.add(new ClassPathResource("schema2.xsd"));11 XsdSchemaCollection xsdSchemaCollection = new XsdSchemaCollection(schemaResources);12 System.out.println("XSD schema collection: " + xsdSchemaCollection);13 }14}
XsdSchemaCollection
Using AI Code Generation
1public class XsdSchemaCollectionTest {2 public static void main(String[] args) {3 XsdSchemaCollection collection = new XsdSchemaCollection();4 collection.setSchemaLocations("classpath:com/consol/citrus/xml/schema/first.xsd, classpath:com/consol/citrus/xml/schema/second.xsd");5 collection.setSchemaValidationEnabled(true);6 collection.afterPropertiesSet();7 System.out.println("XsdSchemaCollectionTest.main()"+collection.toString());8 }9}10XsdSchemaCollectionTest.main()com.consol.citrus.xml.schema.XsdSchemaCollection@3c7f9f1d11public class XsdSchemaCollectionTest {12 public static void main(String[] args) {13 XsdSchemaCollection collection = new XsdSchemaCollection();14 collection.setSchemaLocations("classpath:com/consol/citrus/xml/schema/first.xsd, classpath:com/consol/citrus/xml/schema/second.xsd");15 collection.setSchemaValidationEnabled(true);16 collection.afterPropertiesSet();17 System.out.println("XsdSchemaCollectionTest.main()"+collection.toString());18 }19}20XsdSchemaCollectionTest.main()com.consol.citrus.xml.schema.XsdSchemaCollection@3c7f9f1d21public class XsdSchemaCollectionTest {22 public static void main(String[] args) {23 XsdSchemaCollection collection = new XsdSchemaCollection();24 collection.setSchemaLocations("classpath:com/consol/citrus/xml/schema/first.xsd, classpath:com/consol/citrus/xml/schema/second.xsd");25 collection.setSchemaValidationEnabled(true);26 collection.afterPropertiesSet();27 System.out.println("XsdSchemaCollectionTest.main()"+collection.toString());28 }29}30XsdSchemaCollectionTest.main()com.consol.citrus.xml.schema.XsdSchemaCollection@3c7f9f1d31public class XsdSchemaCollectionTest {
XsdSchemaCollection
Using AI Code Generation
1import com.consol.citrus.xml.schema.XsdSchemaCollection;2import com.consol.citrus.xml.schema.XsdSchemaValidationContext;3import java.io.File;4import java.io.IOException;5import java.util.ArrayList;6import java.util.List;7import javax.xml.transform.Source;8import javax.xml.transform.stream.StreamSource;9import org.springframework.core.io.ClassPathResource;10import org.springframework.core.io.Resource;11import org.springframework.xml.xsd.SimpleXsdSchema;12import org.springframework.xml.xsd.XsdSchema;13import org.springframework.xml.xsd.XsdSchemaCollection;14public class XsdSchemaCollectionDemo {15 public static void main(String[] args) throws IOException {16 XsdSchemaCollection schemaCollection = new XsdSchemaCollection();17 List<XsdSchema> schemas = new ArrayList<XsdSchema>();18 schemas.add(new SimpleXsdSchema(new ClassPathResource("xsd/first.xsd")));19 schemas.add(new SimpleXsdSchema(new ClassPathResource("xsd/second.xsd")));20 schemaCollection.setXsdSchemas(schemas);21 Resource resource = new ClassPathResource("xml/first.xml");22 Source source = new StreamSource(resource.getInputStream());23 XsdSchemaValidationContext context = new XsdSchemaValidationContext();24 context.setSchemaCollection(schemaCollection);25 context.setSource(source);26 context.validate();27 }28}29 at com.consol.citrus.xml.schema.XsdSchemaValidationContext.validate(XsdSchemaValidationContext.java:100)30 at XsdSchemaCollectionDemo.main(XsdSchemaCollectionDemo.java:31)31 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)32 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
XsdSchemaCollection
Using AI Code Generation
1import com.consol.citrus.xml.schema.XsdSchemaCollection;2import com.consol.citrus.xml.schema.XsdSchemaValidationContext;3import java.io.File;4import java.io.IOException;5import java.util.ArrayList;6import java.util.List;7import org.springframework.core.io.ClassPathResource;8import org.springframework.core.io.Resource;9import org.springframework.xml.xsd.SimpleXsdSchema;10import org.springframework.xml.xsd.XsdSchema;11import org.xml.sax.SAXException;12public class XsdSchemaCollectionTest {13 public static void main(String[] args) throws IOException, SAXException {14 XsdSchemaCollection schemaCollection = new XsdSchemaCollection();15 List<XsdSchema> xsdSchemas = new ArrayList<XsdSchema>();16 xsdSchemas.add(new SimpleXsdSchema(new ClassPathResource("schema.xsd")));17 xsdSchemas.add(new SimpleXsdSchema(new ClassPathResource("schema2.xsd")));18 schemaCollection.setSchemas(xsdSchemas);19 XsdSchemaValidationContext validationContext = new XsdSchemaValidationContext();20 validationContext.setSchemaCollection(schemaCollection);21 File file = new File("C:\\Users\\admin\\Desktop\\xmlfile.xml");22 validationContext.validate(file);23 }24}
XsdSchemaCollection
Using AI Code Generation
1import com.consol.citrus.xml.schema.XsdSchemaCollection;2import com.consol.citrus.xml.schema.XsdSchemaRepository;3import com.consol.citrus.xml.schema.XsdSchema;4import org.springframework.core.io.ClassPathResource;5import org.springframework.core.io.Resource;6import org.springframework.util.Assert;7import org.springframework.util.CollectionUtils;8import org.springframework.util.StringUtils;9import org.springframework.xml.xsd.SimpleXsdSchema;10import org.springframework.xml.xsd.XsdSchemaCollection;11import org.springframework.xml.xsd.XsdSchemaRepository;12import org.springframework.xml.xsd.XsdSchema;13import org.xml.sax.InputSource;14import org.xml.sax.SAXException;15import org.xml.sax.SAXParseException;16import org.xml.sax.helpers.DefaultHandler;17import java.io.IOException;18import java.util.*;19public class XsdSchemaCollectionTest {20public static void main(String[] args) {21XsdSchemaCollection schemaCollection = new XsdSchemaCollection();
XsdSchemaCollection
Using AI Code Generation
1package com.consol.citrus.xml.schema;2import java.io.File;3import java.net.URL;4import org.springframework.core.io.Resource;5import org.springframework.core.io.UrlResource;6import org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition;7import org.springframework.xml.xsd.SimpleXsdSchema;8import org.springframework.xml.xsd.XsdSchema;9public class SchemaCollectionTest extends DefaultWsdl11Definition {10 private XsdSchemaCollection schemaCollection;11 private XsdSchema schema;12 private String schemaLocation;13 private String schemaName;14 private String schemaNamespace;15 private String schemaUrl;16 public SchemaCollectionTest() {17 super();18 schemaCollection = new XsdSchemaCollection();19 }20 public XsdSchema getSchema() {21 return schema;22 }23 public void setSchema(XsdSchema schema) {24 this.schema = schema;25 }26 public String getSchemaLocation() {27 return schemaLocation;28 }29 public void setSchemaLocation(String schemaLocation) {30 this.schemaLocation = schemaLocation;31 }32 public String getSchemaName() {33 return schemaName;34 }35 public void setSchemaName(String schemaName) {36 this.schemaName = schemaName;37 }38 public String getSchemaNamespace() {39 return schemaNamespace;40 }41 public void setSchemaNamespace(String schemaNamespace) {42 this.schemaNamespace = schemaNamespace;43 }44 public String getSchemaUrl() {45 return schemaUrl;46 }47 public void setSchemaUrl(String schemaUrl) {48 this.schemaUrl = schemaUrl;49 }50 public void setSchemaCollection(XsdSchemaCollection schemaCollection) {51 this.schemaCollection = schemaCollection;52 }53 public void afterPropertiesSet() throws Exception {54 if (schema != null) {55 schemaCollection.addSchema(schema);56 }57 if (schemaLocation != null) {58 schemaCollection.addSchema(new SimpleXsdSchema(new File(schemaLocation)));59 }60 if (schemaName != null) {61 schemaCollection.addSchema(new SimpleXsdSchema(new UrlResource(new URL(schemaUrl)), schemaName));62 }63 if (schemaNamespace != null) {64 schemaCollection.addSchema(new SimpleXsdSchema(new UrlResource(new URL(schemaUrl)), schemaNamespace));65 }66 if (schemaUrl != null) {67 schemaCollection.addSchema(new SimpleXsdSchema(new UrlResource(new
XsdSchemaCollection
Using AI Code Generation
1package com.consol.citrus.xml.schema;2import org.springframework.core.io.ClassPathResource;3import org.springframework.core.io.Resource;4import org.testng.Assert;5import org.testng.annotations.Test;6import org.xml.sax.SAXException;7import javax.xml.transform.stream.StreamSource;8import java.io.IOException;9import java.io.InputStream;10public class XsdSchemaCollectionTest {11 public void testValidate() throws IOException, SAXException {12 XsdSchemaCollection schemaCollection = new XsdSchemaCollection();13 Resource schemaResource = new ClassPathResource("schema.xsd");14 schemaCollection.setSchemas(new Resource[]{schemaResource});15 schemaCollection.afterPropertiesSet();16 InputStream xmlStream = getClass().getClassLoader().getResourceAsStream("xml.xml");17 StreamSource xmlSource = new StreamSource(xmlStream);18 Assert.assertTrue(schemaCollection.validate(xmlSource));19 }20}21package com.consol.citrus.xml.schema;22import org.springframework.core.io.ClassPathResource;23import org.springframework.core.io.Resource;24import org.testng.Assert;25import org.testng.annotations.Test;26import org.xml.sax.SAXException;27import javax.xml.transform.stream.StreamSource;28import java.io.IOException;29import java.io.InputStream;30public class XsdSchemaCollectionTest {31 public void testValidate() throws IOException, SAXException {32 XsdSchemaCollection schemaCollection = new XsdSchemaCollection();33 Resource schemaResource = new ClassPathResource("schema.xsd");34 schemaCollection.setSchemas(new Resource[]{schemaResource});35 schemaCollection.afterPropertiesSet();36 InputStream xmlStream = getClass().getClassLoader().getResourceAsStream("xml.xml");37 StreamSource xmlSource = new StreamSource(xmlStream);38 Assert.assertTrue(schemaCollection.validate(xmlSource));39 }40}41import com.consol.citrus.xml.schema.XsdSchemaCollection;42import com.consol.citrus.xml.schema.XsdSchemaRepository;43import com.consol.citrus.xml.schema.XsdSchema;44import org.springframework.core.io.ClassPathResource;45import org.springframework.core.io.Resource;46import org.springframework.util.Assert;47import org.springframework.util.CollectionUtils;48import org.springframework.util.StringUtils;49import org.springframework.xml.xsd.SimpleXsdSchema;50import org.springframework.xml.xsd.XsdSchemaCollection;51import org.springframework.xml.xsd.XsdSchemaRepository;52import org.springframework.xml.xsd.XsdSchema;53import org.xml.sax.InputSource;54import org.xml.sax.SAXException;55import org.xml.sax.SAXParseException;56import org.xml.sax.helpers.DefaultHandler;57import java.io.IOException;58import java.util.*;59public class XsdSchemaCollectionTest {60public static void main(String[] args) {61XsdSchemaCollection schemaCollection = new XsdSchemaCollection();
XsdSchemaCollection
Using AI Code Generation
1package com.consol.citrus.xml.schema;2import java.io.File;3import java.net.URL;4import org.springframework.core.io.Resource;5import org.springframework.core.io.UrlResource;6import org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition;7import org.springframework.xml.xsd.SimpleXsdSchema;8import org.springframework.xml.xsd.XsdSchema;9public class SchemaCollectionTest extends DefaultWsdl11Definition {10 private XsdSchemaCollection schemaCollection;11 private XsdSchema schema;12 private String schemaLocation;13 private String schemaName;14 private String schemaNamespace;15 private String schemaUrl;16 public SchemaCollectionTest() {17 super();18 schemaCollection = new XsdSchemaCollection();19 }20 public XsdSchema getSchema() {21 return schema;22 }23 public void setSchema(XsdSchema schema) {24 this.schema = schema;25 }26 public String getSchemaLocation() {27 return schemaLocation;28 }29 public void setSchemaLocation(String schemaLocation) {30 this.schemaLocation = schemaLocation;31 }32 public String getSchemaName() {33 return schemaName;34 }35 public void setSchemaName(String schemaName) {36 this.schemaName = schemaName;37 }38 public String getSchemaNamespace() {39 return schemaNamespace;40 }41 public void setSchemaNamespace(String schemaNamespace) {42 this.schemaNamespace = schemaNamespace;43 }44 public String getSchemaUrl() {45 return schemaUrl;46 }47 public void setSchemaUrl(String schemaUrl) {48 this.schemaUrl = schemaUrl;49 }50 public void setSchemaCollection(XsdSchemaCollection schemaCollection) {51 this.schemaCollection = schemaCollection;52 }53 public void afterPropertiesSet() throws Exception {54 if (schema != null) {55 schemaCollection.addSchema(schema);56 }57 if (schemaLocation != null) {58 schemaCollection.addSchema(new SimpleXsdSchema(new File(schemaLocation)));59 }60 if (schemaName != null) {61 schemaCollection.addSchema(new SimpleXsdSchema(new UrlResource(new URL(schemaUrl)), schemaName));62 }63 if (schemaNamespace != null) {64 schemaCollection.addSchema(new SimpleXsdSchema(new UrlResource(new URL(schemaUrl)), schemaNamespace));65 }66 if (schemaUrl != null) {67 schemaCollection.addSchema(new SimpleXsdSchema(new UrlResource(new
XsdSchemaCollection
Using AI Code Generation
1package com.consol.citrus.xml.schema;2import org.springframework.core.io.ClassPathResource;3import org.springframework.core.io.Resource;4import org.testng.Assert;5import org.testng.annotations.Test;6import org.xml.sax.SAXException;7import javax.xml.transform.stream.StreamSource;8import java.io.IOException;9import java.io.InputStream;10public class XsdSchemaCollectionTest {11 public void testValidate() throws IOException, SAXException {12 XsdSchemaCollection schemaCollection = new XsdSchemaCollection();13 Resource schemaResource = new ClassPathResource("schema.xsd");14 schemaCollection.setSchemas(new Resource[]{schemaResource});15 schemaCollection.afterPropertiesSet();16 InputStream xmlStream = getClass().getClassLoader().getResourceAsStream("xml.xml");17 StreamSource xmlSource = new StreamSource(xmlStream);18 Assert.assertTrue(schemaCollection.validate(xmlSource));19 }20}21package com.consol.citrus.xml.schema;22import org.springframework.core.io.ClassPathResource;23import org.springframework.core.io.Resource;24import org.testng.Assert;25import org.testng.annotations.Test;26import org.xml.sax.SAXException;27import javax.xml.transform.stream.StreamSource;28import java.io.IOException;29import java.io.InputStream;30public class XsdSchemaCollectionTest {31 public void testValidate() throws IOException, SAXException {32 XsdSchemaCollection schemaCollection = new XsdSchemaCollection();33 Resource schemaResource = new ClassPathResource("schema.xsd");34 schemaCollection.setSchemas(new Resource[]{schemaResource});35 schemaCollection.afterPropertiesSet();36 InputStream xmlStream = getClass().getClassLoader().getResourceAsStream("xml.xml");37 StreamSource xmlSource = new StreamSource(xmlStream);38 Assert.assertTrue(schemaCollection.validate(xmlSource));39 }40}
XsdSchemaCollection
Using AI Code Generation
1import com.consol.citrus.xml.schema.XsdSchemaCollection;2import com.consol.citrus.xml.schema.XsdSchemaRepository;3import com.consol.citrus.xml.schema.XsdSchema;4import org.springframework.core.io.ClassPathResource;5import org.springframework.core.io.Resource;6import org.springframework.util.Assert;7import org.springframework.util.CollectionUtils;8import org.springframework.util.StringUtils;9import org.springframework.xml.xsd.SimpleXsdSchema;10import org.springframework.xml.xsd.XsdSchemaCollection;11import org.springframework.xml.xsd.XsdSchemaRepository;12import org.springframework.xml.xsd.XsdSchema;13import org.xml.sax.InputSource;14import org.xml.sax.SAXException;15import org.xml.sax.SAXParseException;16import org.xml.sax.helpers.DefaultHandler;17import java.io.IOException;18import java.util.*;19public class XsdSchemaCollectionTest {20public static void main(String[] args) {21XsdSchemaCollection schemaCollection = new XsdSchemaCollection();
XsdSchemaCollection
Using AI Code Generation
1package com.consol.citrus.xml.schema;2import java.io.File;3import java.net.URL;4import org.springframework.core.io.Resource;5import org.springframework.core.io.UrlResource;6import org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition;7import org.springframework.xml.xsd.SimpleXsdSchema;8import org.springframework.xml.xsd.XsdSchema;9public class SchemaCollectionTest extends DefaultWsdl11Definition {10 private XsdSchemaCollection schemaCollection;11 private XsdSchema schema;12 private String schemaLocation;13 private String schemaName;14 private String schemaNamespace;15 private String schemaUrl;16 public SchemaCollectionTest() {17 super();18 schemaCollection = new XsdSchemaCollection();19 }20 public XsdSchema getSchema() {21 return schema;22 }23 public void setSchema(XsdSchema schema) {24 this.schema = schema;25 }26 public String getSchemaLocation() {27 return schemaLocation;28 }29 public void setSchemaLocation(String schemaLocation) {30 this.schemaLocation = schemaLocation;31 }32 public String getSchemaName() {33 return schemaName;34 }35 public void setSchemaName(String schemaName) {36 this.schemaName = schemaName;37 }38 public String getSchemaNamespace() {39 return schemaNamespace;40 }41 public void setSchemaNamespace(String schemaNamespace) {42 this.schemaNamespace = schemaNamespace;43 }44 public String getSchemaUrl() {45 return schemaUrl;46 }47 public void setSchemaUrl(String schemaUrl) {48 this.schemaUrl = schemaUrl;49 }50 public void setSchemaCollection(XsdSchemaCollection schemaCollection) {51 this.schemaCollection = schemaCollection;52 }53 public void afterPropertiesSet() throws Exception {54 if (schema != null) {55 schemaCollection.addSchema(schema);56 }57 if (schemaLocation != null) {58 schemaCollection.addSchema(new SimpleXsdSchema(new File(schemaLocation)));59 }60 if (schemaName != null) {61 schemaCollection.addSchema(new SimpleXsdSchema(new UrlResource(new URL(schemaUrl)), schemaName));62 }63 if (schemaNamespace != null) {64 schemaCollection.addSchema(new SimpleXsdSchema(new UrlResource(new URL(schemaUrl)), schemaNamespace));65 }66 if (schemaUrl != null) {67 schemaCollection.addSchema(new SimpleXsdSchema(new UrlResource(new
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!