1
votes

We switched to JBoss EAP 7, which is roughly the same as JBoss Wildfly 10.

This came with a new version of Arquillian, and now I'm trying to test everything.

The tests work on my local machine, running on a local JBoss. However, when I try to run them on our build server, which should connect to the JBoss server (another machine), the tests fail.

I can see in the server log that the test WAR is deployed and removed after the test. However, during the test, Arquillian wants to connect to localhost:

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 10.294 sec <<< FAILURE! - in itest.com.mydomain.esv.dds.bo.DDSDokumentI18NTest
testI18NKeys(itest.com.mydomain.esv.dds.bo.DDSDokumentI18NTest)  Time elapsed: 1.024 sec  <<< ERROR!
java.lang.IllegalStateException: Error launching test itest.com.mydomain.esv.dds.bo.DDSDokumentI18NTest public void com.mydomain.esv.util.testing.i18n.I18NTestBase.testI18NKeys()
...
Caused by: java.lang.IllegalStateException: Error launching request at http://localhost:8080/dds-adapter-api-itest/ArquillianServletRunner?outputMode=serializedObject&className=itest.com.mydomain.esv.dds.bo.DDSDokumentI18NTest&methodName=testI18NKeys. No result returned
    at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.executeWithRetry(ServletMethodExecutor.java:139)
    at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.invoke(ServletMethodExecutor.java:99)
    at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.execute(RemoteTestExecuter.java:109)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

Here's my arquillian.xml:

<?xml version="1.0" encoding="UTF-8"?>
<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">
  <!-- Force the use of the Servlet 3.0 protocol with all containers, as it is the most mature -->
  <defaultProtocol type="Servlet 3.0" />

  <!-- Example configuration for a remote JBoss EAP instance -->
  <container qualifier="jboss-remote" default="true">
    <configuration>
      <property name="managementAddress">foobar.mydomain.com</property>
      <property name="managementPort">9990</property>
      <property name="username">admin</property>
      <property name="password">password</property>
    </configuration>
  </container>
</arquillian>

These are my relevant dependencies (we're using JBoss EAP 7.0.4):

<dependency>
  <groupId>org.jboss.bom</groupId>
  <artifactId>jboss-eap-javaee7-with-tools</artifactId>
  <version>7.0.4.GA</version>
  <type>pom</type>
  <scope>import</scope>
</dependency>


<dependency>
  <groupId>org.jboss.shrinkwrap.resolver</groupId>
  <artifactId>shrinkwrap-resolver-depchain</artifactId>
  <type>pom</type>
  <scope>test</scope>
  <version>2.2.2</version>
  <exclusions>
    <exclusion>
      <groupId>javax.enterprise</groupId>
      <artifactId>cdi-api</artifactId>
    </exclusion>
    <exclusion>
      <groupId>javax.inject</groupId>
      <artifactId>javax.inject</artifactId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>org.jboss.arquillian.junit</groupId>
  <artifactId>arquillian-junit-container</artifactId>
  <version>1.1.11.Final</version>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.wildfly.arquillian</groupId>
  <artifactId>wildfly-arquillian-container-remote</artifactId>
  <version>2.0.0.Final</version>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.jboss.arquillian.protocol</groupId>
  <artifactId>arquillian-protocol-servlet</artifactId>
  <version>1.1.11.Final</version>
  <scope>test</scope>
</dependency>

Here's the test class:

@RunWith(Arquillian.class)
public class DDSDokumentI18NTest extends DDSArquillianI18NFieldEnumSupplierTest {

  /**
   * {@inheritDoc}
   */
  @Override
  protected FieldEnumSupplier getFieldEnumSupplier() {
    return new DDSDokument();
  }

}

And its base class:

@RunWith(Arquillian.class)
public abstract class DDSArquillianI18NFieldEnumSupplierTest extends FieldEnumSupplierI18NTestBase<I18NService> {

  @Inject
  private I18NService i18nService;

  /**
   * Creates the deployment for the test.
   * @return the deployment
   */
  @Deployment
  public static Archive<?> createDeployment() {
    return DDSArquillianIntegrationTest.createCoreDeployment();
  }

  /**
   * {@inheritDoc}
   */
  @Override
  protected Map<String, String> getI18NKeysAndValues() {
    final Map<I18NLanguage, Map<String, String>> values = getService().getValues(DDSArquillianI18NTest.I18N_PATTERNS);
    return values.get(I18NLanguage.GERMAN);
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public I18NService getService() {
    return this.i18nService;
  }

}

What am I doing wrong?

1
What's your container adapter dependency? - bartosz.majsak
I added the relevant dependencies, thanks for any help! - eerriicc
For the full picture it would be just great to see the test class. - bartosz.majsak
OK, since we have an ecosystem around our Arquillian test classes, it's kind of hard :-) I'm adding the two classes without the framework. Nonetheless, these tests work on a local JBoss. - eerriicc
For anyone that came here looking for an answer: The problem occurs whenever JBoss is bound to 0.0.0.0 See github.com/wildfly/wildfly-arquillian/pull/108 - eerriicc

1 Answers

0
votes

The answer can be found here.

You need to configure the host and port in the arquillian.xml.

<container qualifier="wildfly" default="true">
    <protocol type="Servlet 3.0">
        <property name="host">test.example.com</property>
        <property name="port">8181</property>
    </protocol>
</container>