CamelContextConfigurator { private static void configureCamelContextXML(CamelContext context, Object value) throws Exception { Object object = CamelModelFactory.createCamelModelObjectFromXML(value.toString()); if (object instanceof CamelContextFactoryBean) { CamelModelFactory.importCamelContextFactoryBean((SwitchYardCamelContext)context, (CamelContextFactoryBean)object); } } private  CamelContextConfigurator(); static final void configure(CamelContext context, ServiceDomain domain); static final void configure(CamelContext context, Map<String, Object> properties); static final void configure(CamelContext context, String name, Object value); static final String SHUTDOWN_TIMEOUT; static final String PERFORMANCE_STATISTICS; static final String MDC_LOGGING_ENABLED; static final String CAMEL_CONTEXT_CONFIG; static final String CAMEL_CONTEXT_CONFIG_XML; }
@Test public void configureCamelContextXML() throws Exception { domain.setProperty(CamelContextConfigurator.CAMEL_CONTEXT_CONFIG_XML, PATH_CAMEL_CONTEXT_XML); Assert.assertNull(context.getProperty("abc")); Assert.assertNotEquals("foobar-camel-context", context.getName()); Assert.assertEquals(false, context.isUseMDCLogging()); Assert.assertEquals(ManagementStatisticsLevel.All , context.getManagementStrategy().getStatisticsLevel()); Assert.assertEquals(true, context.isAllowUseOriginalMessage()); Assert.assertEquals(false, context.isStreamCaching()); context.start(); Assert.assertNotNull(context.getProperty("abc")); Assert.assertEquals("xyz", context.getProperty("abc")); Assert.assertEquals("foobar-camel-context", context.getName()); Assert.assertEquals(true, context.isUseMDCLogging()); Assert.assertEquals(ManagementStatisticsLevel.RoutesOnly , context.getManagementStrategy().getStatisticsLevel()); Assert.assertEquals(false, context.isAllowUseOriginalMessage()); Assert.assertEquals(true, context.isStreamCaching()); DataFormatDefinition dfd = context.getDataFormats().get("transform-json"); Assert.assertNotNull(dfd); Assert.assertEquals("json-jackson", dfd.getDataFormatName()); Assert.assertTrue(dfd instanceof JsonDataFormat); MockEndpoint mock = context.getEndpoint("mock:output", MockEndpoint.class); mock.expectedMessageCount(1); mock.expectedBodiesReceived("foobar-input"); context.createProducerTemplate().sendBody("direct:input", "foobar-input"); mock.assertIsSatisfied(); }