Hello,
I'm using delta-spike to manage camel routes as I've seen in the provided
CDI samples. I have the following route builder:
public class MyRouteBuilder extends RouteBuilder
{
@Override
@ContextName("...")
public void configure()
{
from("ftp:{{ftp.path}}").log("Uploading file
${file:name}").to("file:{{file.path}}").log("Uploaded file ${file:name}
complete.");
}
@Produces
@Named("properties")
public PropertiesComponent properties(PropertiesParser parser)
{
PropertiesComponent component = new PropertiesComponent();
component.setPropertiesParser(parser);
return component;
}
}
and I have the following class:
public class DeltaSpikeParser extends DefaultPropertiesParser {
@Override
public String parseProperty(String key, String value, Properties
properties) {
return ConfigResolver.getPropertyValue(key);
}
}
The {{...}} get injected from the apache-deltaspike.properties file.
In my unit tests I need to use the same property file, for example:
public class UnitTests extends CamelTestSupport
{
@Override
protected RouteBuilder createRouteBuilder()
{
return new RouteBuilder()
{
public void configure()
{
from("direct:start").to("ftp:{{ftp.path}}");
}
};
}
But here {{ftp.path}} is not defined any more. How could i do this ?
Many thanks in advance,
Nicolas
--
View this message in context:
http://camel.465427.n5.nabble.com/Camel-delta-spike-How-to-share-properties-between-conexts-tp5783288.html
Sent from the Camel - Users mailing list archive at Nabble.com.