【发布时间】:2016-12-06 14:41:59
【问题描述】:
我正在使用带有 arquillian 的 Wildfly 容器进行集成测试。 在某些情况下,我想使用 JMS 和 Standalone-full.xml,并在服务器启动时加载一些自定义配置。 所以,对于我的 int 测试,我想通过将它放在 src/test/resources 中来加载这个standalone-full.xml。
我该怎么做?
我无法输入以下行,因为它是默认的 jboss 文件,而不是我覆盖的standalone-full.xml 文件。
<property name="serverConfig">standalone-full.xml</property>
当我指定文件路径(在资源中)时,它不起作用。
<property name="serverConfig">src/test/resources/standalone-full.xml</property>
<property name="serverConfig">/src/test/resources/standalone-full.xml</property>
<property name="serverConfig">${project.basedir}/src/test/resources/standalone-full.xml</property>
[编辑]
当我像这样将 maven 变量放入 surefire-plugin 时:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<reuseForks>true</reuseForks>
<systemPropertyVariables>
<server.standalone.config.path>${project.basedir}/src/test/resources/standalone-full.xml</server.standalone.config.path>
</systemPropertyVariables>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
</configuration>
</plugin>
并在 arquillian.xml 中使用它
<property name="serverConfig">${server.standalone.config.path}</property>
我有这个错误:
java.lang.IllegalStateException: WFLYCTL0214: Could not get main file:
D:\my_project_path\int-tests/src/test/resources/standalone-full.xml. Specified
files must be relative to the configuration dir: D:\wildfly_path\wildfly-
10.1.0.Final\standalone\configuration
【问题讨论】:
标签: java jboss integration-testing jboss-arquillian wildfly-10