Search code examples
jboss7.xtestngjboss-arquillianwildfly-8

Wildfly port offset not working with Arquillain


Up until now I've been running my intergration tests using JBOSS AS 7 managed with Arquillian Testing framework. I have been setting the offset by 100 This has been working fine but now I want to transfer my integration tests to Wildfly AS managed but the same tests fail with the following error:

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

Here is my 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>

and a sample of one of the integration tests:

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

If I don't change the port offset and just leave the defaults it works fine.

Thanks for any help in advance.


Solution

  • I figured out the problem. I was missing the managementPort property which needs to be set.

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

    Full arquillian.xml file:

    <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>