@Override protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { doBeforeParse(element); super.doParse(element, parserContext, builder); // now lets parse the routes with JAXB Binder<Node> binder; try { binder = getJaxbContext().createBinder(); } catch (JAXBException e) { throw new BeanDefinitionStoreException("Failed to create the JAXB binder", e); } Object value = parseUsingJaxb(element, parserContext, binder); if (value instanceof CamelRouteContextFactoryBean) { CamelRouteContextFactoryBean factoryBean = (CamelRouteContextFactoryBean) value; builder.addPropertyValue("routes", factoryBean.getRoutes()); } // lets inject the namespaces into any namespace aware POJOs injectNamespaces(element, binder); } }
@Override public void doExecute(TestContext context) { if (StringUtils.hasText(routeContext)) { // now lets parse the routes with JAXB try { Object value = getJaxbContext().createUnmarshaller().unmarshal(new StringSource(context.replaceDynamicContentInString(routeContext))); if (value instanceof CamelRouteContextFactoryBean) { CamelRouteContextFactoryBean factoryBean = (CamelRouteContextFactoryBean) value; routes = factoryBean.getRoutes(); } } catch (JAXBException e) { throw new BeanDefinitionStoreException("Failed to create the JAXB unmarshaller", e); } } for (RouteDefinition routeDefinition : routes) { try { camelContext.addRouteDefinition(routeDefinition); log.info(String.format("Created new Camel route '%s' in context '%s'", routeDefinition.getId(), camelContext.getName())); } catch (Exception e) { throw new CitrusRuntimeException(String.format("Failed to create route definition '%s' in context '%s'", routeDefinition.getId(), camelContext.getName()), e); } } }
routesContext = true; sc = new CamelContextFactoryBean(); sc.setRoutes(((CamelRouteContextFactoryBean) object).getRoutes()); } else if (object instanceof org.apache.camel.blueprint.CamelRouteContextFactoryBean) { routesContext = true;
routesContext = true; sc = new CamelContextFactoryBean(); sc.setRoutes(((CamelRouteContextFactoryBean) object).getRoutes()); } else if (object instanceof org.apache.camel.blueprint.CamelRouteContextFactoryBean) { routesContext = true;