How to use registerXmlSchemaRepository method of com.consol.citrus.config.xml.SchemaRepositoryParser class

Best Citrus code snippet using com.consol.citrus.config.xml.SchemaRepositoryParser.registerXmlSchemaRepository

Source:SchemaRepositoryParser.java Github

copy

Full Screen

...44 private final SchemaParser schemaParser = new SchemaParser();45 @Override46 public BeanDefinition parse(Element element, ParserContext parserContext) {47 if (isXmlSchemaRepository(element)) {48 registerXmlSchemaRepository(element, parserContext);49 } else if (isJsonSchemaRepository(element)) {50 registerJsonSchemaRepository(element, parserContext);51 }52 return null;53 }54 /**55 * Registers a JsonSchemaRepository definition in the parser context56 * @param element The element to be converted into a JsonSchemaRepository definition57 * @param parserContext The parser context to add the definitions to58 */59 private void registerJsonSchemaRepository(Element element, ParserContext parserContext) {60 BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(JsonSchemaRepository.class);61 addLocationsToBuilder(element, builder);62 parseSchemasElement(element, builder, parserContext);63 parserContext.getRegistry().registerBeanDefinition(element.getAttribute(ID), builder.getBeanDefinition());64 }65 /**66 * Registers a XsdSchemaRepository definition in the parser context67 * @param element The element to be converted into a XmlSchemaRepository definition68 * @param parserContext The parser context to add the definitions to69 */70 private void registerXmlSchemaRepository(Element element, ParserContext parserContext) {71 BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(XsdSchemaRepository.class);72 BeanDefinitionParserUtils.setPropertyReference(builder, element.getAttribute("schema-mapping-strategy"), "schemaMappingStrategy");73 addLocationsToBuilder(element, builder);74 parseSchemasElement(element, builder, parserContext);75 parserContext.getRegistry().registerBeanDefinition(element.getAttribute(ID), builder.getBeanDefinition());76 }77 /**78 * Decides whether the given element is a xml schema repository.79 *80 * Note:81 * If the "type" attribute has not been set, the repository is interpreted as a xml repository by definition.82 * This is important to guarantee downwards compatibility.83 * @param element The element to be checked84 * @return Whether the given element is a xml schema repository...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Citrus automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful