java使用定制的standalonefull。带arquillian的xml
我正在使用wildfly容器和arquillian进行集成测试。 在某些情况下,我希望使用JMS和独立完整。带有一些自定义配置的xml在服务器启动时加载。 所以,对于我的int测试,我想加载这个独立的完整测试。将其放入src/test/resources中
我该怎么做
我不能放下面一行,因为它是默认的jboss文件,而不是我的重写独立完整文件。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>
<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>
用在阿奎利安。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
# 1 楼答案
我们使用以下配置:
在src/test/resources-wildfly-embedded/configuration中,我们有:
看起来你需要所有这些文件才能启动,但没有办法把它们独立起来。xml位于与配置的其余部分不同的目录中
# 2 楼答案
最后,我使用了另一种方法,因为我有多个模块… 构建过程分为三个部分
wildfly容器部署
jboss_home和standalone full。xml
资源拷贝(jms.rar和custom standalone-full.xml
在阿奎利安。xml:
它很好用