gpt4 book ai didi

jboss7.x - Wildfly 端口偏移不适用于 Arquiillain

转载 作者:行者123 更新时间:2023-12-02 19:46:25 24 4
gpt4 key购买 nike

到目前为止,我一直在使用由 Arquillian 测试框架管理的 JBOSS AS 7 运行集成测试。我已经将偏移量设置为 100 这一直工作正常,但现在我想将我的集成测试转移到 Wildfly AS 托管,但相同的测试失败并出现以下错误:

arquillianBeforeSuite(com.aeroflex.teravm.selfinstall.core.ejb.SampleServiceIT) Time elapsed: 130.749 sec <<< FAILURE! org.jboss.arquillian.container.spi.client.container.LifecycleException: Could not start container

这是我的 Arquillian.xml

   <arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<!-- <defaultProtocol type="Servlet 3.1"/> -->
<container qualifier="wildfly-managed" default="true">
<configuration>
<property name="jbossHome">target/wildfly-8.0.0.Final</property>
<property name="serverConfig">standalone.xml</property>
<property name="outputToConsole">true</property>

<property name="javaVmArguments">-Djboss.socket.binding.port-offset=100</property>
</configuration>
</container>
</arquillian>

以及其中一项集成测试的示例:

public class SampleServiceIT extends BaseServiceIT
{
@Inject
private SampleService sampleService;

@Parameters(ARQUILLIAN_DATA_PROVIDER)
@Test(groups = {"integration"})
public void testGetNotExisting() throws ServiceException
{
Long id = new Long(5);
SampleBean result = sampleService.getSampleObjectById(id);
Assert.assertNull(result);
}
}

如果我不更改端口偏移量而仅保留默认值,则它可以正常工作。

感谢您提前提供的任何帮助。

最佳答案

我发现了问题所在。我缺少需要设置的 managementPort 属性。

<property name="managementPort">10090</property>

完整的 arquillian.xml 文件:

<arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<!-- <defaultProtocol type="Servlet 3.1"/> -->
<container qualifier="wildfly-managed" default="true">
<configuration>
<property name="jbossHome">target/wildfly-8.0.0.Final</property>
<property name="serverConfig">standalone.xml</property>
<property name="outputToConsole">true</property>

<property name="javaVmArguments">-Djboss.socket.binding.port-offset=100</property>
<property name="managementPort">10090</property>
</configuration>
</container>
</arquillian>

关于jboss7.x - Wildfly 端口偏移不适用于 Arquiillain,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24259564/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com