【发布时间】:2014-05-04 23:56:24
【问题描述】:
如何将数据从 .properties 文件动态加载到我的 jBehave 故事文件中?我一直在我的故事文件中使用 $,例如:
When the stock is traded at price : $<price>
Then the alert status should be $<status>
我正在尝试从我的 src/test/resources 文件夹下的属性文件中获取值,并将我的 .properties 文件包含在 pom.xml 中,例如
<testResource>
<directory>${basedir}/src/test/resources</directory>
<filtering>false</filtering>
<includes>
include>**/*.properties</include>
</includes>
</testResource>
但它仍然无法正常工作。 当我尝试在我的 cmd 上运行“mvn integration-test”时。它抛出了这个异常
org.json.JSONException: A JSONObject text must begin with '{' at character 1
at org.json.JSONTokener.syntaxError(JSONTokener.java:410)
at org.json.JSONObject.<init>(JSONObject.java:179)
at org.json.JSONObject.<init>(JSONObject.java:402)....
我不确定我哪里出错了。请帮帮我。 等待回复!! -测试员
【问题讨论】:
标签: maven jbehave properties-file