1

I am using property-placeholder tag to load a properties as follows:

<cm:property-placeholder id="myblueprint.test" persistent-id="camel.blueprint"/>

While deploying my project on JBOSS Fuse, it will load camel.blueprint.cfg from /etc/ directory of FUSE, and when I deploy project on a fabric profile, it will read from properties file created in profile.

But, when I run camel blueprint test, how can I configure it to load properties file from a particular location?

niyasc
  • 4,440
  • 1
  • 23
  • 50

1 Answers1

3

After browsing the documentation for property-placeholder, I got the solution. We can set the location for properties file in test case file as follows:

@Override
protected String[] loadConfigAdminConfigurationFile() {
    // String[0] = tell Camel the path of the .cfg file to use for OSGi ConfigAdmin in the blueprint XML file
    // String[1] = tell Camel the persistence-id of the cm:property-placeholder in the blueprint XML file
    return new String[]{"src/test/resources/etc/stuff.cfg", "stuff"};
}
  • Please ensure that, property file is having extension .cfg. otherwise it will be ignored.
niyasc
  • 4,440
  • 1
  • 23
  • 50