4

これまで、Arquillian Testing フレームワークで管理された JBOSS AS 7 を使用して統合テストを実行してきました。オフセットを 100 に設定しています。これは正常に機能していますが、統合テストを Wildfly AS managed に転送したいのですが、同じテストが次のエラーで失敗します。

arquillianBeforeSuite(com.aeroflex.teravm.selfinstall.core.ejb.SampleServiceIT) 経過時間: 130.749 秒 <<< 失敗! org.jboss.arquillian.container.spi.client.container.LifecycleException: コンテナーを開始できませんでした

ここに私の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>

および統合テストの 1 つのサンプル:

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);
    }
}

ポート オフセットを変更せず、デフォルトのままにしておくと、問題なく動作します。

事前に助けてくれてありがとう。

4

2 に答える 2

8

私は問題を理解しました。設定する必要がある 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>
于 2014-06-17T13:30:18.240 に答える
1

このような Arquillian テストを Maven で実行していて、組み込みコンテナーを使用している場合javaVmArguments、arquillian.xml の は無視されます。

pom.xml で JVM 引数を設定する必要があります。

<plugin>
  <artifactId>maven-failsafe-plugin</artifactId>
    <configuration>
      <argLine>-Djboss.socket.binding.port-offset=300</argLine>
         <systemPropertyVariables>
            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
         </systemPropertyVariables>

        <redirectTestOutputToFile>false</redirectTestOutputToFile>
  </configuration>
</plugin>

注: これは maven-failsafe-plugin の構成です (つまり、テストが *IT.java の場合)。Arquillian テストが *Test.java の場合、maven-surefireplugin を構成する必要があります。

于 2015-01-30T19:29:57.503 に答える