首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >运行camel蓝图测试时加载属性文件

运行camel蓝图测试时加载属性文件
EN

Stack Overflow用户
提问于 2016-12-15 06:34:49
回答 1查看 666关注 0票数 1

我使用property-placeholder标记加载属性,如下所示:

代码语言:javascript
复制
<cm:property-placeholder id="myblueprint.test" persistent-id="camel.blueprint"/>

在JBOSS上部署我的项目时,它将从Fuse的camel.blueprint.cfg目录中加载/etc/,当我在fabric配置文件上部署项目时,它将从profile中创建的属性文件中读取。

但是,当我运行骆驼蓝图试验时,如何将其配置为从特定位置加载属性文件?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-12-15 06:55:27

在浏览了文档 for property-placeholder之后,我得到了解决方案。我们可以设置测试用例文件中属性文件的位置,如下所示:

代码语言:javascript
复制
@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。否则它将被忽略。
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41157856

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档