use of org.apache.camel.component.properties.PropertiesComponent in project camel by apache.
the class InterceptFromPropertyPlaceholderTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext context = super.createCamelContext();
PropertiesComponent pc = new PropertiesComponent();
pc.setLocation("classpath:org/apache/camel/processor/intercept/myproperties.properties");
context.addComponent("properties", pc);
return context;
}
use of org.apache.camel.component.properties.PropertiesComponent in project camel by apache.
the class AbstractJsseParametersTest method createPropertiesPlaceholderAwareContext.
protected CamelContext createPropertiesPlaceholderAwareContext(Properties supplementalProperties) throws IOException {
Properties properties = new Properties(supplementalProperties);
properties.load(AbstractJsseParametersTest.class.getResourceAsStream("test.properties"));
if (supplementalProperties != null) {
Properties mergedProps = new Properties();
Set<String> keys = new HashSet<String>();
keys.addAll(properties.stringPropertyNames());
keys.addAll(supplementalProperties.stringPropertyNames());
for (String key : keys) {
mergedProps.setProperty(key, properties.getProperty(key));
}
properties = mergedProps;
}
properties.store(new FileOutputStream("target/jsse-test.properties"), "Generated by " + AbstractJsseParametersTest.class.getName());
PropertiesComponent pc = new PropertiesComponent();
pc.setLocation("file:./target/jsse-test.properties");
CamelContext context = new DefaultCamelContext();
context.addComponent("properties", pc);
return context;
}
use of org.apache.camel.component.properties.PropertiesComponent in project camel by apache.
the class AbstractInfluxDbTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
applicationContext = new AnnotationConfigApplicationContext(MockedInfluxDbConfiguration.class);
CamelContext ctx = new SpringCamelContext(applicationContext);
PropertiesComponent pc = new PropertiesComponent("classpath:influxdb.test.properties");
ctx.addComponent("properties", pc);
return ctx;
}
use of org.apache.camel.component.properties.PropertiesComponent in project camel by apache.
the class JasyptPropertiesTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext context = super.createCamelContext();
// START SNIPPET: e1
// create the jasypt properties parser
JasyptPropertiesParser jasypt = new JasyptPropertiesParser();
// and set the master password
jasypt.setPassword("secret");
// create the properties component
PropertiesComponent pc = new PropertiesComponent();
pc.setLocation("classpath:org/apache/camel/component/jasypt/myproperties.properties");
// and use the jasypt properties parser so we can decrypt values
pc.setPropertiesParser(jasypt);
// add properties component to camel context
context.addComponent("properties", pc);
return context;
}
use of org.apache.camel.component.properties.PropertiesComponent in project camel by apache.
the class BaseEmbeddedKafkaTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext context = super.createCamelContext();
context.addComponent("properties", new PropertiesComponent("ref:prop"));
KafkaComponent kafka = new KafkaComponent();
kafka.setBrokers("localhost:" + getKafkaPort());
context.addComponent("kafka", kafka);
return context;
}
Aggregations