我使用property-placeholder标记加载属性,如下所示:
<cm:property-placeholder id="myblueprint.test" persistent-id="camel.blueprint"/>在JBOSS上部署我的项目时,它将从Fuse的camel.blueprint.cfg目录中加载/etc/,当我在fabric配置文件上部署项目时,它将从profile中创建的属性文件中读取。
但是,当我运行骆驼蓝图试验时,如何将其配置为从特定位置加载属性文件?
发布于 2016-12-15 06:55:27
在浏览了文档 for property-placeholder之后,我得到了解决方案。我们可以设置测试用例文件中属性文件的位置,如下所示:
@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"};
}.cfg。否则它将被忽略。https://stackoverflow.com/questions/41157856
复制相似问题